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;
248 classinfo_t*classinfo;
249 classinfo_list_t*classinfo_list;
252 unsigned int number_uint;
256 //typedcode_list_t*value_list;
257 codeandnumber_t value_list;
263 for_start_t for_start;
264 abc_exception_t *exception;
267 abc_exception_list_t *l;
273 /* Line 223 of skeleton.m4 */
274 #line 275 "parser.tab.c"
276 # define YYSTYPE_IS_TRIVIAL 1
277 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
278 # define YYSTYPE_IS_DECLARED 1
282 /* Copy the second part of user declarations. */
284 /* Line 273 of skeleton.m4 */
288 static int a3_error(char*s)
290 syntaxerror("%s", s);
291 return 0; //make gcc happy
295 static char* concat2(const char* t1, const char* t2)
299 char*text = malloc(l1+l2+1);
300 memcpy(text , t1, l1);
301 memcpy(text+l1, t2, l2);
305 static char* concat3(const char* t1, const char* t2, const char* t3)
310 char*text = malloc(l1+l2+l3+1);
311 memcpy(text , t1, l1);
312 memcpy(text+l1, t2, l2);
313 memcpy(text+l1+l2, t3, l3);
318 typedef struct _import {
322 DECLARE_LIST(import);
324 DECLARE(methodstate);
325 DECLARE_LIST(methodstate);
327 typedef struct _classstate {
333 methodstate_t*static_init;
335 //code_t*static_init;
337 char has_constructor;
340 struct _methodstate {
349 dict_t*unresolved_variables;
352 char uses_parent_function;
354 int var_index; // for inner methods
357 abc_exception_list_t*exceptions;
359 methodstate_list_t*innerfunctions;
362 typedef struct _state {
367 import_list_t*wildcard_imports;
369 char has_own_imports;
370 char new_vars; // e.g. transition between two functions
373 methodstate_t*method;
380 typedef struct _global {
384 dict_t*file2token2info;
387 static global_t*global = 0;
388 static state_t* state = 0;
392 #define MULTINAME(m,x) \
396 registry_fill_multiname(&m, &m##_ns, (slotinfo_t*)(x));
398 #define MEMBER_MULTINAME(m,f,n) \
402 m##_ns.access = (f)->access; \
406 m.namespace_set = 0; \
409 m.type = MULTINAME; \
411 m.namespace_set = &nopackage_namespace_set; \
415 /* warning: list length of namespace set is undefined */
416 #define MULTINAME_LATE(m, access, package) \
417 namespace_t m##_ns = {access, package}; \
418 namespace_set_t m##_nsset; \
419 namespace_list_t m##_l;m##_l.next = 0; \
420 m##_nsset.namespaces = &m##_l; \
421 m##_nsset = m##_nsset; \
422 m##_l.namespace = &m##_ns; \
423 multiname_t m = {MULTINAMEL, 0, &m##_nsset, 0};
425 static namespace_t ns1 = {ACCESS_PRIVATE, ""};
426 static namespace_t ns2 = {ACCESS_PROTECTED, ""};
427 static namespace_t ns3 = {ACCESS_PACKAGEINTERNAL, ""};
428 static namespace_t ns4 = {ACCESS_PACKAGE, ""};
429 static namespace_list_t nl4 = {&ns4,0};
430 static namespace_list_t nl3 = {&ns3,&nl4};
431 static namespace_list_t nl2 = {&ns2,&nl3};
432 static namespace_list_t nl1 = {&ns1,&nl2};
433 static namespace_set_t nopackage_namespace_set = {&nl1};
435 static void new_state()
438 state_t*oldstate = state;
440 memcpy(s, state, sizeof(state_t)); //shallow copy
442 s->imports = dict_new();
446 state->has_own_imports = 0;
447 state->vars = dict_new();
448 state->old = oldstate;
450 static void state_has_imports()
452 state->wildcard_imports = list_clone(state->wildcard_imports);
453 state->imports = dict_clone(state->imports);
454 state->has_own_imports = 1;
457 static void state_destroy(state_t*state)
459 if(state->has_own_imports) {
460 list_free(state->wildcard_imports);
461 dict_destroy(state->imports);state->imports=0;
463 if(state->imports && (!state->old || state->old->imports!=state->imports)) {
464 dict_destroy(state->imports);state->imports=0;
468 for(t=0;t<state->vars->hashsize;t++) {
469 dictentry_t*e =state->vars->slots[t];
471 free(e->data);e->data=0;
475 dict_destroy(state->vars);state->vars=0;
481 static void old_state()
483 if(!state || !state->old)
484 syntaxerror("invalid nesting");
485 state_t*leaving = state;
489 if(as3_pass>1 && leaving->method && leaving->method != state->method && !leaving->method->inner) {
490 free(leaving->method);
493 if(as3_pass>1 && leaving->cls && leaving->cls != state->cls) {
498 state_destroy(leaving);
501 static code_t* method_header(methodstate_t*m);
502 static code_t* wrap_function(code_t*c,code_t*header, code_t*body);
503 static void function_initvars(methodstate_t*m, params_t*params, int flags, char var0);
506 static char* internal_filename_package = 0;
507 void initialize_file(char*filename)
510 syntaxerror("invalid call to initialize_file during parsing of another file");
513 state->package = internal_filename_package = strdup(filename);
515 global->token2info = dict_lookup(global->file2token2info,
516 current_filename // use long version
518 if(!global->token2info) {
519 global->token2info = dict_new2(&ptr_type);
520 dict_put(global->file2token2info, current_filename, global->token2info);
524 state->method = rfx_calloc(sizeof(methodstate_t));
525 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
527 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
528 function_initvars(state->method, 0, 0, 1);
529 global->init = abc_initscript(global->file);
530 state->method->late_binding = 1; // init scripts use getglobalscope, so we need a getlocal0/pushscope
536 if(!state || state->level!=1) {
537 syntaxerror("unexpected end of file in pass %d", as3_pass);
541 code_t*header = method_header(state->method);
542 code_t*c = wrap_function(header, 0, global->init->method->body->code);
543 global->init->method->body->code = c;
544 free(state->method);state->method=0;
547 //free(state->package);state->package=0; // used in registry
548 state_destroy(state);state=0;
551 void initialize_parser()
553 global = rfx_calloc(sizeof(global_t));
554 global->file = abc_file_new();
555 global->file->flags &= ~ABCFILE_LAZY;
556 global->file2token2info = dict_new();
557 global->token2info = 0;
560 void* finish_parser()
562 dict_free_all(global->file2token2info, 1, (void*)dict_destroy);
564 global->token2info=0;
570 static void xx_scopetest()
572 /* findpropstrict doesn't just return a scope object- it
573 also makes it "active" somehow. Push local_0 on the
574 scope stack and read it back with findpropstrict, it'll
575 contain properties like "trace". Trying to find the same
576 property on a "vanilla" local_0 yields only a "undefined" */
577 //c = abc_findpropstrict(c, "[package]::trace");
579 /*c = abc_getlocal_0(c);
580 c = abc_findpropstrict(c, "[package]::trace");
582 c = abc_setlocal_1(c);
584 c = abc_pushbyte(c, 0);
585 c = abc_setlocal_2(c);
587 code_t*xx = c = abc_label(c);
588 c = abc_findpropstrict(c, "[package]::trace");
589 c = abc_pushstring(c, "prop:");
590 c = abc_hasnext2(c, 1, 2);
592 c = abc_setlocal_3(c);
593 c = abc_callpropvoid(c, "[package]::trace", 2);
594 c = abc_getlocal_3(c);
596 c = abc_iftrue(c,xx);*/
599 typedef struct _variable {
603 methodstate_t*method;
606 static variable_t* find_variable(state_t*s, char*name)
611 v = dict_lookup(s->vars, name);
621 static variable_t* find_variable_safe(state_t*s, char*name)
623 variable_t* v = find_variable(s, name);
625 syntaxerror("undefined variable: %s", name);
628 static char variable_exists(char*name)
630 return dict_contains(state->vars, name);
632 code_t*defaultvalue(code_t*c, classinfo_t*type);
633 static int new_variable(const char*name, classinfo_t*type, char init)
636 v->index = state->method->variable_count;
639 v->method = state->method;
641 dict_put(state->vars, name, v);
643 return state->method->variable_count++;
645 #define TEMPVARNAME "__as3_temp__"
646 static int gettempvar()
648 variable_t*v = find_variable(state, TEMPVARNAME);
651 return new_variable(TEMPVARNAME, 0, 0);
654 code_t* var_block(code_t*body)
660 for(t=0;t<state->vars->hashsize;t++) {
661 dictentry_t*e = state->vars->slots[t];
663 variable_t*v = (variable_t*)e->data;
664 if(v->type && v->init) {
665 c = defaultvalue(c, v->type);
666 c = abc_setlocal(c, v->index);
667 k = abc_kill(k, v->index);
677 if(x->opcode== OPCODE___BREAK__ ||
678 x->opcode== OPCODE___CONTINUE__) {
679 /* link kill code before break/continue */
680 code_t*e = code_dup(k);
681 code_t*s = code_start(e);
693 c = code_append(c, body);
694 c = code_append(c, k);
698 void unknown_variable(char*name)
700 if(!state->method->unresolved_variables)
701 state->method->unresolved_variables = dict_new();
702 if(!dict_contains(state->method->unresolved_variables, name))
703 dict_put(state->method->unresolved_variables, name, 0);
706 #define parserassert(b) {if(!(b)) parsererror(__FILE__, __LINE__,__func__);}
708 static void parsererror(const char*file, int line, const char*f)
710 syntaxerror("internal error in %s, %s:%d", f, file, line);
714 static code_t* method_header(methodstate_t*m)
717 if(m->late_binding && !m->inner) {
718 c = abc_getlocal_0(c);
719 c = abc_pushscope(c);
721 /*if(m->innerfunctions) {
722 c = abc_newactivation(c);
723 c = abc_pushscope(c);
725 methodstate_list_t*l = m->innerfunctions;
727 parserassert(l->methodstate->abc);
728 c = abc_newfunction(c, l->methodstate->abc);
729 c = abc_setlocal(c, l->methodstate->var_index);
730 free(l->methodstate);l->methodstate=0;
734 c = code_append(c, m->header);
737 if(m->is_constructor && !m->has_super) {
738 // call default constructor
739 c = abc_getlocal_0(c);
740 c = abc_constructsuper(c, 0);
742 list_free(m->innerfunctions);
743 m->innerfunctions = 0;
748 static code_t* wrap_function(code_t*c,code_t*header, code_t*body)
750 c = code_append(c, header);
751 c = code_append(c, var_block(body));
752 /* append return if necessary */
753 if(!c || (c->opcode != OPCODE_RETURNVOID &&
754 c->opcode != OPCODE_RETURNVALUE)) {
755 c = abc_returnvoid(c);
761 static void startpackage(char*name)
764 /*printf("entering package \"%s\"\n", name);*/
765 state->package = strdup(name);
767 static void endpackage()
769 /*printf("leaving package \"%s\"\n", state->package);*/
771 //used e.g. in classinfo_register:
772 //free(state->package);state->package=0;
777 #define FLAG_PUBLIC 256
778 #define FLAG_PROTECTED 512
779 #define FLAG_PRIVATE 1024
780 #define FLAG_PACKAGEINTERNAL 2048
781 #define FLAG_NAMESPACE 4096
783 static int flags2access(int flags)
786 if(flags&FLAG_PUBLIC) {
787 if(access&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
788 syntaxerror("invalid combination of access levels");
789 access = ACCESS_PACKAGE;
790 } else if(flags&FLAG_PRIVATE) {
791 if(access&(FLAG_PUBLIC|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
792 syntaxerror("invalid combination of access levels");
793 access = ACCESS_PRIVATE;
794 } else if(flags&FLAG_PROTECTED) {
795 if(access&(FLAG_PUBLIC|FLAG_PRIVATE|FLAG_PACKAGEINTERNAL))
796 syntaxerror("invalid combination of access levels");
797 access = ACCESS_PROTECTED;
799 access = ACCESS_PACKAGEINTERNAL;
804 static void function_initvars(methodstate_t*m, params_t*params, int flags, char var0)
809 index = new_variable("this", 0, 0);
810 else if(!m->is_global)
811 index = new_variable((flags&FLAG_STATIC)?"class":"this", state->cls?state->cls->info:0, 0);
813 index = new_variable("globalscope", 0, 0);
816 parserassert(!index);
821 for(p=params->list;p;p=p->next) {
822 new_variable(p->param->name, p->param->type, 0);
826 methodstate_list_t*l = m->innerfunctions;
828 methodstate_t*m = l->methodstate;
829 m->var_index = new_variable(m->info->name, TYPE_FUNCTION(m->info), 0);
835 char*as3_globalclass=0;
836 static void startclass(int flags, char*classname, classinfo_t*extends, classinfo_list_t*implements)
839 syntaxerror("inner classes now allowed");
843 classinfo_list_t*mlist=0;
845 if(flags&~(FLAG_PACKAGEINTERNAL|FLAG_PUBLIC|FLAG_FINAL|FLAG_DYNAMIC|FLAG_INTERFACE))
846 syntaxerror("invalid modifier(s)");
848 if((flags&(FLAG_PUBLIC|FLAG_PACKAGEINTERNAL)) == (FLAG_PUBLIC|FLAG_PACKAGEINTERNAL))
849 syntaxerror("public and internal not supported at the same time.");
851 /* create the class name, together with the proper attributes */
855 if(!(flags&FLAG_PUBLIC) && state->package==internal_filename_package) {
856 access = ACCESS_PRIVATE; package = internal_filename_package;
857 } else if(!(flags&FLAG_PUBLIC) && state->package!=internal_filename_package) {
858 access = ACCESS_PACKAGEINTERNAL; package = state->package;
859 } else if(state->package!=internal_filename_package) {
860 access = ACCESS_PACKAGE; package = state->package;
862 syntaxerror("public classes only allowed inside a package");
866 state->cls = rfx_calloc(sizeof(classstate_t));
867 state->cls->init = rfx_calloc(sizeof(methodstate_t));
868 state->cls->static_init = rfx_calloc(sizeof(methodstate_t));
869 /* notice: we make no effort to initialize the top variable (local0) here,
870 even though it has special meaning. We just rely on the facat
871 that pass 1 won't do anything with variables */
873 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->cls);
875 /* set current method to constructor- all code within the class-level (except
876 static variable initializations) will be executed during construction time */
877 state->method = state->cls->init;
879 if(registry_find(package, classname)) {
880 syntaxerror("Package \"%s\" already contains a class called \"%s\"", package, classname);
882 /* build info struct */
883 int num_interfaces = (list_length(implements));
884 state->cls->info = classinfo_register(access, package, classname, num_interfaces);
885 state->cls->info->flags |= flags & (FLAG_DYNAMIC|FLAG_INTERFACE|FLAG_FINAL);
889 state->cls = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
891 state->method = state->cls->init;
892 parserassert(state->cls && state->cls->info);
894 function_initvars(state->cls->init, 0, 0, 1);
895 function_initvars(state->cls->static_init, 0, 0, 0);
897 if(extends && (extends->flags & FLAG_FINAL))
898 syntaxerror("Can't extend final class '%s'", extends->name);
900 /* fill out interfaces and extends (we couldn't resolve those during the first pass) */
901 state->cls->info->superclass = extends?extends:TYPE_OBJECT;
903 classinfo_list_t*l = implements;
904 for(l=implements;l;l=l->next) {
905 if(!(l->classinfo->flags & FLAG_INTERFACE))
906 syntaxerror("'%s' is not an interface", l->classinfo->name);
907 state->cls->info->interfaces[pos++] = l->classinfo;
910 /* generate the abc code for this class */
911 MULTINAME(classname2,state->cls->info);
912 multiname_t*extends2 = sig2mname(extends);
914 state->cls->abc = abc_class_new(global->file, &classname2, extends2);
915 if(state->cls->info->flags&FLAG_FINAL) abc_class_final(state->cls->abc);
916 if(!(state->cls->info->flags&FLAG_DYNAMIC)) abc_class_sealed(state->cls->abc);
917 if(state->cls->info->flags&FLAG_INTERFACE) {
918 abc_class_interface(state->cls->abc);
921 abc_class_protectedNS(state->cls->abc, classname);
923 for(mlist=implements;mlist;mlist=mlist->next) {
924 MULTINAME(m, mlist->classinfo);
925 abc_class_add_interface(state->cls->abc, &m);
928 /* write the construction code for this class to the global init
930 int slotindex = abc_initscript_addClassTrait(global->init, &classname2, state->cls->abc);
932 abc_method_body_t*m = global->init->method->body;
933 __ getglobalscope(m);
934 classinfo_t*s = extends;
939 //TODO: take a look at the current scope stack, maybe
940 // we can re-use something
945 multiname_t*s2 = sig2mname(s);
947 multiname_destroy(s2);
949 __ pushscope(m); count++;
950 m->code = m->code->prev->prev; // invert
952 /* continue appending after last op end */
953 while(m->code && m->code->next) m->code = m->code->next;
955 /* TODO: if this is one of *our* classes, we can also
956 do a getglobalscope/getslot <nr> (which references
957 the init function's slots) */
959 __ getlex2(m, extends2);
961 /* notice: we get a Verify Error #1107 if the top elemnt on the scope
962 stack is not the superclass */
963 __ pushscope(m);count++;
966 /* notice: we get a verify error #1107 if the top element on the scope
967 stack is not the global object */
969 __ pushscope(m);count++;
971 __ newclass(m,state->cls->abc);
975 __ setslot(m, slotindex);
976 multiname_destroy(extends2);
978 /* flash.display.MovieClip handling */
980 if(!as3_globalclass && (flags&FLAG_PUBLIC) && slotinfo_equals((slotinfo_t*)registry_getMovieClip(),(slotinfo_t*)extends)) {
981 if(state->package && state->package[0]) {
982 as3_globalclass = concat3(state->package, ".", classname);
984 as3_globalclass = strdup(classname);
990 static void setstaticfunction(int x)
994 state->method = state->cls->static_init;
996 state->method = state->cls->init;
999 parserassert(state->method);
1003 static void endclass()
1006 if(!state->cls->has_constructor && !(state->cls->info->flags&FLAG_INTERFACE)) {
1008 c = abc_getlocal_0(c);
1009 c = abc_constructsuper(c, 0);
1010 state->cls->init->header = code_append(state->cls->init->header, c);
1011 state->cls->has_constructor=1;
1013 if(state->cls->init) {
1014 if(state->cls->info->flags&FLAG_INTERFACE) {
1015 if(state->cls->init->header)
1016 syntaxerror("interface can not have class-level code");
1018 abc_method_t*m = abc_class_getconstructor(state->cls->abc, 0);
1019 code_t*c = method_header(state->cls->init);
1020 m->body->code = wrap_function(c, 0, m->body->code);
1023 if(state->cls->static_init) {
1024 abc_method_t*m = abc_class_getstaticconstructor(state->cls->abc, 0);
1025 code_t*c = method_header(state->cls->static_init);
1026 m->body->code = wrap_function(c, 0, m->body->code);
1033 void check_code_for_break(code_t*c)
1036 if(c->opcode == OPCODE___BREAK__) {
1037 char*name = string_cstr(c->data[0]);
1038 syntaxerror("Unresolved \"break %s\"", name);
1040 if(c->opcode == OPCODE___CONTINUE__) {
1041 char*name = string_cstr(c->data[0]);
1042 syntaxerror("Unresolved \"continue %s\"", name);
1049 static void check_constant_against_type(classinfo_t*t, constant_t*c)
1051 #define xassert(b) if(!(b)) syntaxerror("Invalid default value %s for type '%s'", constant_tostring(c), t->name)
1052 if(TYPE_IS_NUMBER(t)) {
1053 xassert(c->type == CONSTANT_FLOAT
1054 || c->type == CONSTANT_INT
1055 || c->type == CONSTANT_UINT);
1056 } else if(TYPE_IS_UINT(t)) {
1057 xassert(c->type == CONSTANT_UINT ||
1058 (c->type == CONSTANT_INT && c->i>=0));
1059 } else if(TYPE_IS_INT(t)) {
1060 xassert(c->type == CONSTANT_INT);
1061 } else if(TYPE_IS_BOOLEAN(t)) {
1062 xassert(c->type == CONSTANT_TRUE
1063 || c->type == CONSTANT_FALSE);
1067 static void check_override(memberinfo_t*m, int flags)
1071 if(m->parent == state->cls->info)
1072 syntaxerror("class '%s' already contains a method/slot '%s'", m->parent->name, m->name);
1074 syntaxerror("internal error: overriding method %s, which doesn't have parent", m->name);
1075 if(m->access==ACCESS_PRIVATE)
1077 if(m->flags & FLAG_FINAL)
1078 syntaxerror("can't override final member %s", m->name);
1079 if((m->flags & FLAG_STATIC) && !(flags&FLAG_STATIC))
1080 syntaxerror("can't override static member %s", m->name);
1081 if(!(m->flags & FLAG_STATIC) && (flags&FLAG_STATIC))
1082 syntaxerror("can't override non-static member %s with static declaration", m->name);
1084 if(!(flags&FLAG_OVERRIDE)) {
1085 if(m->parent && !(m->parent->flags&FLAG_INTERFACE)) {
1086 if(m->kind == INFOTYPE_METHOD)
1087 syntaxerror("can't override without explicit 'override' declaration");
1089 syntaxerror("can't override '%s'", m->name);
1094 static methodinfo_t*registerfunction(enum yytokentype getset, int flags, char*name, params_t*params, classinfo_t*return_type, int slot)
1096 methodinfo_t*minfo = 0;
1097 U8 access = flags2access(flags);
1100 minfo = methodinfo_register_global(access, state->package, name);
1101 minfo->return_type = return_type;
1102 } else if(getset != KW_GET && getset != KW_SET) {
1104 memberinfo_t* m = registry_findmember(state->cls->info, name, 0);
1106 syntaxerror("class already contains a %s '%s'", infotypename((slotinfo_t*)m), m->name);
1108 minfo = methodinfo_register_onclass(state->cls->info, access, name);
1109 minfo->return_type = return_type;
1110 // getslot on a member slot only returns "undefined", so no need
1111 // to actually store these
1112 //state->minfo->slot = state->method->abc->method->trait->slot_id;
1114 //class getter/setter
1115 int gs = getset==KW_GET?SUBTYPE_GET:SUBTYPE_SET;
1117 if(getset == KW_GET)
1119 else if(params->list && params->list->param)
1120 type = params->list->param->type;
1121 // not sure wether to look into superclasses here, too
1122 minfo = (methodinfo_t*)registry_findmember(state->cls->info, name, 1);
1124 if(minfo->kind!=INFOTYPE_SLOT)
1125 syntaxerror("class already contains a method called '%s'", name);
1126 if(!(minfo->subtype & (SUBTYPE_GETSET)))
1127 syntaxerror("class already contains a field called '%s'", name);
1128 if(minfo->subtype & gs)
1129 syntaxerror("getter/setter for '%s' already defined", name);
1130 /* make a setter or getter into a getset */
1131 minfo->subtype |= gs;
1132 if(!minfo->return_type) {
1133 minfo->return_type = type;
1135 if(minfo && minfo->return_type != type)
1136 syntaxerror("different type in getter and setter");
1139 minfo = methodinfo_register_onclass(state->cls->info, access, name);
1140 minfo->kind = INFOTYPE_SLOT; //hack
1141 minfo->subtype = gs;
1142 minfo->return_type = type;
1144 /* can't assign a slot as getter and setter might have different slots */
1145 //minfo->slot = slot;
1147 if(flags&FLAG_FINAL) minfo->flags |= FLAG_FINAL;
1148 if(flags&FLAG_STATIC) minfo->flags |= FLAG_STATIC;
1149 if(flags&FLAG_OVERRIDE) minfo->flags |= FLAG_OVERRIDE;
1153 static void innerfunction(char*name, params_t*params, classinfo_t*return_type)
1155 //parserassert(state->method && state->method->info);
1157 methodstate_t*parent_method = state->method;
1160 return_type = 0; // not valid in pass 1
1164 state->new_vars = 1;
1167 state->method = rfx_calloc(sizeof(methodstate_t));
1168 state->method->inner = 1;
1169 state->method->variable_count = 0;
1170 state->method->abc = rfx_calloc(sizeof(abc_method_t));
1172 NEW(methodinfo_t,minfo);
1173 minfo->kind = INFOTYPE_METHOD;
1174 minfo->access = ACCESS_PACKAGEINTERNAL;
1176 state->method->info = minfo;
1179 list_append(parent_method->innerfunctions, state->method);
1181 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1183 function_initvars(state->method, params, 0, 1);
1187 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1188 state->method->variable_count = 0;
1189 parserassert(state->method);
1191 state->method->info->return_type = return_type;
1192 function_initvars(state->method, params, 0, 1);
1196 static void startfunction(token_t*ns, int flags, enum yytokentype getset, char*name,
1197 params_t*params, classinfo_t*return_type)
1199 if(state->method && state->method->info) {
1200 syntaxerror("not able to start another method scope");
1205 state->method = rfx_calloc(sizeof(methodstate_t));
1206 state->method->has_super = 0;
1209 state->method->is_constructor = !strcmp(state->cls->info->name,name);
1211 state->method->is_global = 1;
1212 state->method->late_binding = 1; // for global methods, always push local_0 on the scope stack
1214 if(state->method->is_constructor)
1215 name = "__as3_constructor__";
1218 state->method->info = registerfunction(getset, flags, name, params, return_type, 0);
1220 function_initvars(state->method, params, flags, 1);
1222 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1226 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1227 state->method->variable_count = 0;
1228 parserassert(state->method);
1231 memberinfo_t*m = registry_findmember(state->cls->info, name, 2);
1232 check_override(m, flags);
1236 state->cls->has_constructor |= state->method->is_constructor;
1239 state->method->info->return_type = return_type;
1240 function_initvars(state->method, params, flags, 1);
1244 static abc_method_t* endfunction(token_t*ns, int flags, enum yytokentype getset, char*name,
1245 params_t*params, classinfo_t*return_type, code_t*body)
1248 // store inner methods in variables
1249 function_initvars(state->method, 0, 0, 0);
1251 methodstate_list_t*ml = state->method->innerfunctions;
1253 methodstate_t*m = ml->methodstate;
1254 parserassert(m->inner);
1255 if(m->unresolved_variables) {
1256 dict_t*d = m->unresolved_variables;
1258 for(t=0;t<d->hashsize;t++) {
1259 dictentry_t*l = d->slots[t];
1261 /* check parent method's variables */
1262 if(find_variable(state, l->key)) {
1263 m->uses_parent_function = 1;
1271 dict_destroy(m->unresolved_variables);
1272 m->unresolved_variables = 0;
1281 if(state->method->uses_parent_function){
1282 syntaxerror("accessing variables of parent function from inner functions not supported yet");
1287 multiname_t*type2 = sig2mname(return_type);
1289 if(state->method->inner) {
1290 f = state->method->abc;
1291 abc_method_init(f, global->file, type2, 1);
1292 } else if(state->method->is_constructor) {
1293 f = abc_class_getconstructor(state->cls->abc, type2);
1294 } else if(!state->method->is_global) {
1295 namespace_t mname_ns = {state->method->info->access, ""};
1296 multiname_t mname = {QNAME, &mname_ns, 0, name};
1298 if(flags&FLAG_STATIC)
1299 f = abc_class_staticmethod(state->cls->abc, type2, &mname);
1301 f = abc_class_method(state->cls->abc, type2, &mname);
1302 slot = f->trait->slot_id;
1304 namespace_t mname_ns = {state->method->info->access, state->package};
1305 multiname_t mname = {QNAME, &mname_ns, 0, name};
1307 f = abc_method_new(global->file, type2, 1);
1308 trait_t*t = trait_new_method(&global->init->traits, multiname_clone(&mname), f);
1309 //abc_code_t*c = global->init->method->body->code;
1311 //flash doesn't seem to allow us to access function slots
1312 //state->method->info->slot = slot;
1314 if(flags&FLAG_OVERRIDE) f->trait->attributes |= TRAIT_ATTR_OVERRIDE;
1315 if(getset == KW_GET) f->trait->kind = TRAIT_GETTER;
1316 if(getset == KW_SET) f->trait->kind = TRAIT_SETTER;
1317 if(params->varargs) f->flags |= METHOD_NEED_REST;
1321 for(p=params->list;p;p=p->next) {
1322 if(params->varargs && !p->next) {
1323 break; //varargs: omit last parameter in function signature
1325 multiname_t*m = sig2mname(p->param->type);
1326 list_append(f->parameters, m);
1327 if(p->param->value) {
1328 check_constant_against_type(p->param->type, p->param->value);
1329 opt=1;list_append(f->optional_parameters, p->param->value);
1331 syntaxerror("non-optional parameter not allowed after optional parameters");
1334 check_code_for_break(body);
1337 f->body->code = body;
1338 f->body->exceptions = state->method->exceptions;
1339 } else { //interface
1341 syntaxerror("interface methods can't have a method body");
1351 char is_subtype_of(classinfo_t*type, classinfo_t*supertype)
1356 void breakjumpsto(code_t*c, char*name, code_t*jump)
1359 if(c->opcode == OPCODE___BREAK__) {
1360 string_t*name2 = c->data[0];
1361 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1362 c->opcode = OPCODE_JUMP;
1369 void continuejumpsto(code_t*c, char*name, code_t*jump)
1372 if(c->opcode == OPCODE___CONTINUE__) {
1373 string_t*name2 = c->data[0];
1374 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1375 c->opcode = OPCODE_JUMP;
1383 #define IS_INT(a) (TYPE_IS_INT((a)) || TYPE_IS_UINT((a)))
1384 #define IS_NUMBER_OR_INT(a) (TYPE_IS_INT((a)) || TYPE_IS_UINT((a)) || TYPE_IS_NUMBER((a)))
1385 #define BOTH_INT(a,b) (IS_INT(a) && IS_INT(b))
1387 classinfo_t*join_types(classinfo_t*type1, classinfo_t*type2, char op)
1389 if(!type1 || !type2)
1390 return registry_getanytype();
1391 if(TYPE_IS_ANY(type1) || TYPE_IS_ANY(type2))
1392 return registry_getanytype();
1395 if(IS_NUMBER_OR_INT(type1) && IS_NUMBER_OR_INT(type2)) {
1404 return registry_getanytype();
1406 code_t*converttype(code_t*c, classinfo_t*from, classinfo_t*to)
1411 return abc_coerce_a(c);
1415 // cast an "any" type to a specific type. subject to
1416 // runtime exceptions
1417 return abc_coerce2(c, &m);
1420 if((TYPE_IS_NUMBER(from) || TYPE_IS_UINT(from) || TYPE_IS_INT(from)) &&
1421 (TYPE_IS_NUMBER(to) || TYPE_IS_UINT(to) || TYPE_IS_INT(to))) {
1422 // allow conversion between number types
1423 return abc_coerce2(c, &m);
1425 //printf("%s.%s\n", from.package, from.name);
1426 //printf("%s.%s\n", to.package, to.name);
1428 classinfo_t*supertype = from;
1430 if(supertype == to) {
1431 // target type is one of from's superclasses
1432 return abc_coerce2(c, &m);
1435 while(supertype->interfaces[t]) {
1436 if(supertype->interfaces[t]==to) {
1437 // target type is one of from's interfaces
1438 return abc_coerce2(c, &m);
1442 supertype = supertype->superclass;
1444 if(TYPE_IS_FUNCTION(from) && TYPE_IS_FUNCTION(to))
1446 if(TYPE_IS_CLASS(from) && TYPE_IS_CLASS(to))
1448 if(TYPE_IS_NULL(from) && !IS_NUMBER_OR_INT(to))
1451 as3_error("can't convert type %s%s%s to %s%s%s",
1452 from->package, from->package?".":"", from->name,
1453 to->package, to->package?".":"", to->name);
1457 code_t*defaultvalue(code_t*c, classinfo_t*type)
1459 if(TYPE_IS_INT(type)) {
1460 c = abc_pushbyte(c, 0);
1461 } else if(TYPE_IS_UINT(type)) {
1462 c = abc_pushuint(c, 0);
1463 } else if(TYPE_IS_FLOAT(type)) {
1465 } else if(TYPE_IS_BOOLEAN(type)) {
1466 c = abc_pushfalse(c);
1468 //c = abc_pushundefined(c);
1470 c = abc_pushnull(c);
1472 c = abc_coerce2(c, &m);
1477 char is_pushundefined(code_t*c)
1479 return (c && !c->prev && !c->next && c->opcode == OPCODE_PUSHUNDEFINED);
1482 static slotinfo_t* find_class(char*name)
1486 c = registry_find(state->package, name);
1489 /* try explicit imports */
1490 dictentry_t* e = dict_get_slot(state->imports, name);
1493 if(!strcmp(e->key, name)) {
1494 c = (slotinfo_t*)e->data;
1500 /* try package.* imports */
1501 import_list_t*l = state->wildcard_imports;
1503 //printf("does package %s contain a class %s?\n", l->import->package, name);
1504 c = registry_find(l->import->package, name);
1509 /* try global package */
1510 c = registry_find("", name);
1513 /* try local "filename" package */
1514 c = registry_find(internal_filename_package, name);
1520 static char is_getlocal(code_t*c)
1522 if(!c || c->prev || c->next)
1524 return(c->opcode == OPCODE_GETLOCAL
1525 || c->opcode == OPCODE_GETLOCAL_0
1526 || c->opcode == OPCODE_GETLOCAL_1
1527 || c->opcode == OPCODE_GETLOCAL_2
1528 || c->opcode == OPCODE_GETLOCAL_3);
1530 static int getlocalnr(code_t*c)
1532 if(c->opcode == OPCODE_GETLOCAL) {return (ptroff_t)c->data[0];}
1533 else if(c->opcode == OPCODE_GETLOCAL_0) {return 0;}
1534 else if(c->opcode == OPCODE_GETLOCAL_1) {return 1;}
1535 else if(c->opcode == OPCODE_GETLOCAL_2) {return 2;}
1536 else if(c->opcode == OPCODE_GETLOCAL_3) {return 3;}
1537 else syntaxerror("Internal error: opcode %02x is not a getlocal call", c->opcode);
1541 static code_t* toreadwrite(code_t*in, code_t*middlepart, char justassign, char readbefore)
1545 [prefix code] [read instruction]
1549 [prefix code] ([dup]) [read instruction] [middlepart] [setvar] [write instruction] [getvar]
1551 if(in && in->opcode == OPCODE_COERCE_A) {
1552 in = code_cutlast(in);
1555 syntaxerror("internal error");
1557 /* chop off read instruction */
1561 prefix = r->prev;r->prev = 0;
1567 char use_temp_var = readbefore;
1569 /* generate the write instruction, and maybe append a dup to the prefix code */
1570 code_t* write = abc_nop(0);
1571 if(r->opcode == OPCODE_GETPROPERTY) {
1572 write->opcode = OPCODE_SETPROPERTY;
1573 multiname_t*m = (multiname_t*)r->data[0];
1574 write->data[0] = multiname_clone(m);
1575 if(m->type == QNAME || m->type == MULTINAME) {
1577 prefix = abc_dup(prefix); // we need the object, too
1580 } else if(m->type == MULTINAMEL) {
1582 /* dupping two values on the stack requires 5 operations and one register-
1583 couldn't adobe just have given us a dup2? */
1584 int temp = gettempvar();
1585 prefix = abc_setlocal(prefix, temp);
1586 prefix = abc_dup(prefix);
1587 prefix = abc_getlocal(prefix, temp);
1588 prefix = abc_swap(prefix);
1589 prefix = abc_getlocal(prefix, temp);
1591 prefix = abc_kill(prefix, temp);
1595 syntaxerror("illegal lvalue: can't assign a value to this expression (not a qname/multiname)");
1597 } else if(r->opcode == OPCODE_GETSLOT) {
1598 write->opcode = OPCODE_SETSLOT;
1599 write->data[0] = r->data[0];
1601 prefix = abc_dup(prefix); // we need the object, too
1604 } else if(r->opcode == OPCODE_GETLOCAL) {
1605 write->opcode = OPCODE_SETLOCAL;
1606 write->data[0] = r->data[0];
1607 } else if(r->opcode == OPCODE_GETLOCAL_0) {
1608 write->opcode = OPCODE_SETLOCAL_0;
1609 } else if(r->opcode == OPCODE_GETLOCAL_1) {
1610 write->opcode = OPCODE_SETLOCAL_1;
1611 } else if(r->opcode == OPCODE_GETLOCAL_2) {
1612 write->opcode = OPCODE_SETLOCAL_2;
1613 } else if(r->opcode == OPCODE_GETLOCAL_3) {
1614 write->opcode = OPCODE_SETLOCAL_3;
1617 syntaxerror("illegal lvalue: can't assign a value to this expression");
1624 /* with getproperty/getslot, we have to be extra careful not
1625 to execute the read code twice, as it might have side-effects
1626 (e.g. if the property is in fact a setter/getter combination)
1628 So read the value, modify it, and write it again,
1629 using prefix only once and making sure (by using a temporary
1630 register) that the return value is what we just wrote */
1631 temp = gettempvar();
1632 c = code_append(c, prefix);
1633 c = code_append(c, r);
1636 c = abc_setlocal(c, temp);
1638 c = code_append(c, middlepart);
1641 c = abc_setlocal(c, temp);
1643 c = code_append(c, write);
1644 c = abc_getlocal(c, temp);
1645 c = abc_kill(c, temp);
1647 /* if we're allowed to execute the read code twice *and*
1648 the middlepart doesn't modify the code, things are easier.
1650 code_t* r2 = code_dup(r);
1651 //c = code_append(c, prefix);
1652 parserassert(!prefix);
1653 c = code_append(c, r);
1654 c = code_append(c, middlepart);
1655 c = code_append(c, write);
1656 c = code_append(c, r2);
1659 /* even smaller version: overwrite the value without reading
1663 c = code_append(c, prefix);
1666 c = code_append(c, middlepart);
1667 c = code_append(c, write);
1668 c = code_append(c, r);
1671 temp = gettempvar();
1673 c = code_append(c, prefix);
1675 c = code_append(c, middlepart);
1677 c = abc_setlocal(c, temp);
1678 c = code_append(c, write);
1679 c = abc_getlocal(c, temp);
1680 c = abc_kill(c, temp);
1686 char is_break_or_jump(code_t*c)
1690 if(c->opcode == OPCODE_JUMP ||
1691 c->opcode == OPCODE___BREAK__ ||
1692 c->opcode == OPCODE___CONTINUE__ ||
1693 c->opcode == OPCODE_THROW ||
1694 c->opcode == OPCODE_RETURNVOID ||
1695 c->opcode == OPCODE_RETURNVALUE) {
1702 #define IS_FINALLY_TARGET(op) \
1703 ((op) == OPCODE___CONTINUE__ || \
1704 (op) == OPCODE___BREAK__ || \
1705 (op) == OPCODE_RETURNVOID || \
1706 (op) == OPCODE_RETURNVALUE || \
1707 (op) == OPCODE___RETHROW__)
1709 static code_t* insert_finally_lookup(code_t*c, code_t*finally, int tempvar)
1711 #define NEED_EXTRA_STACK_ARG
1712 code_t*finally_label = abc_nop(0);
1713 NEW(lookupswitch_t, l);
1719 code_t*prev = i->prev;
1720 if(IS_FINALLY_TARGET(i->opcode)) {
1723 if(i->opcode == OPCODE___RETHROW__ ||
1724 i->opcode == OPCODE_RETURNVALUE) {
1725 if(i->opcode == OPCODE___RETHROW__)
1726 i->opcode = OPCODE_THROW;
1728 p = abc_coerce_a(p);
1729 p = abc_setlocal(p, tempvar);
1731 p = abc_pushbyte(p, count++);
1732 p = abc_jump(p, finally_label);
1733 code_t*target = p = abc_label(p);
1734 #ifdef NEED_EXTRA_STACK_ARG
1738 p = abc_getlocal(p, tempvar);
1741 p->next = i;i->prev = p;
1742 list_append(l->targets, target);
1748 c = abc_pushbyte(c, -1);
1749 c = code_append(c, finally_label);
1750 c = code_append(c, finally);
1752 #ifdef NEED_EXTRA_STACK_ARG
1755 c = abc_lookupswitch(c, l);
1756 c = l->def = abc_label(c);
1757 #ifdef NEED_EXTRA_STACK_ARG
1764 static code_t* insert_finally_simple(code_t*c, code_t*finally, int tempvar)
1768 code_t*prev = i->prev;
1769 if(IS_FINALLY_TARGET(i->opcode)) {
1770 if(i->opcode == OPCODE___RETHROW__)
1771 i->opcode = OPCODE_THROW;
1772 code_t*end = code_dup(finally);
1773 code_t*start = code_start(end);
1774 if(prev) prev->next = start;
1781 return code_append(c, finally);
1784 code_t* insert_finally(code_t*c, code_t*finally, int tempvar)
1790 int num_insertion_points=0;
1792 if(IS_FINALLY_TARGET(i->opcode))
1793 num_insertion_points++;
1800 if(i->branch || i->opcode == OPCODE_LOOKUPSWITCH) {
1805 int simple_version_cost = (1+num_insertion_points)*code_size;
1806 int lookup_version_cost = 4*num_insertion_points + 5;
1808 if(cantdup || simple_version_cost > lookup_version_cost) {
1809 printf("lookup %d > *%d*\n", simple_version_cost, lookup_version_cost);
1810 return insert_finally_lookup(c, finally, tempvar);
1812 printf("simple *%d* < %d\n", simple_version_cost, lookup_version_cost);
1813 return insert_finally_simple(c, finally, tempvar);
1817 #define PASS1 }} if(as3_pass == 1) {{
1818 #define PASS1END }} if(as3_pass == 2) {{
1819 #define PASS2 }} if(as3_pass == 2) {{
1820 #define PASS12 }} {{
1821 #define PASS12END }} if(as3_pass == 2) {{
1825 /* Line 273 of skeleton.m4 */
1826 #line 1827 "parser.tab.c"
1833 typedef YYTYPE_UINT8 yytype_uint8;
1835 typedef unsigned char yytype_uint8;
1839 typedef YYTYPE_INT8 yytype_int8;
1840 #elif (defined __STDC__ || defined __C99__FUNC__ \
1841 || defined __cplusplus || defined _MSC_VER)
1842 typedef signed char yytype_int8;
1844 typedef short int yytype_int8;
1847 #ifdef YYTYPE_UINT16
1848 typedef YYTYPE_UINT16 yytype_uint16;
1850 typedef unsigned short int yytype_uint16;
1854 typedef YYTYPE_INT16 yytype_int16;
1856 typedef short int yytype_int16;
1860 # ifdef __SIZE_TYPE__
1861 # define YYSIZE_T __SIZE_TYPE__
1862 # elif defined size_t
1863 # define YYSIZE_T size_t
1864 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
1865 || defined __cplusplus || defined _MSC_VER)
1866 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1867 # define YYSIZE_T size_t
1869 # define YYSIZE_T unsigned int
1873 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
1878 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1879 # define YY_(msgid) dgettext ("bison-runtime", msgid)
1883 # define YY_(msgid) msgid
1887 /* Suppress unused-variable warnings by "using" E. */
1888 #if ! defined lint || defined __GNUC__
1889 # define YYUSE(e) ((void) (e))
1891 # define YYUSE(e) /* empty */
1894 /* Identity function, used to suppress warnings about constant conditions. */
1896 # define YYID(n) (n)
1898 #if (defined __STDC__ || defined __C99__FUNC__ \
1899 || defined __cplusplus || defined _MSC_VER)
1912 #if ! defined yyoverflow || YYERROR_VERBOSE
1914 /* The parser invokes alloca or malloc; define the necessary symbols. */
1916 # ifdef YYSTACK_USE_ALLOCA
1917 # if YYSTACK_USE_ALLOCA
1919 # define YYSTACK_ALLOC __builtin_alloca
1920 # elif defined __BUILTIN_VA_ARG_INCR
1921 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1923 # define YYSTACK_ALLOC __alloca
1924 # elif defined _MSC_VER
1925 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1926 # define alloca _alloca
1928 # define YYSTACK_ALLOC alloca
1929 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1930 || defined __cplusplus || defined _MSC_VER)
1931 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1933 # define _STDLIB_H 1
1940 # ifdef YYSTACK_ALLOC
1941 /* Pacify GCC's `empty if-body' warning. */
1942 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
1943 # ifndef YYSTACK_ALLOC_MAXIMUM
1944 /* The OS might guarantee only one guard page at the bottom of the stack,
1945 and a page size can be as small as 4096 bytes. So we cannot safely
1946 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1947 to allow for a few compiler-allocated temporary stack slots. */
1948 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1951 # define YYSTACK_ALLOC YYMALLOC
1952 # define YYSTACK_FREE YYFREE
1953 # ifndef YYSTACK_ALLOC_MAXIMUM
1954 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1956 # if (defined __cplusplus && ! defined _STDLIB_H \
1957 && ! ((defined YYMALLOC || defined malloc) \
1958 && (defined YYFREE || defined free)))
1959 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1961 # define _STDLIB_H 1
1965 # define YYMALLOC malloc
1966 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1967 || defined __cplusplus || defined _MSC_VER)
1968 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1972 # define YYFREE free
1973 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1974 || defined __cplusplus || defined _MSC_VER)
1975 void free (void *); /* INFRINGES ON USER NAME SPACE */
1979 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1982 #if (! defined yyoverflow \
1983 && (! defined __cplusplus \
1984 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1986 /* A type that is properly aligned for any stack member. */
1989 yytype_int16 yyss_alloc;
1993 /* The size of the maximum gap between one aligned stack and the next. */
1994 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1996 /* The size of an array large to enough to hold all stacks, each with
1998 # define YYSTACK_BYTES(N) \
1999 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
2000 + YYSTACK_GAP_MAXIMUM)
2002 /* Copy COUNT objects from FROM to TO. The source and destination do
2005 # if defined __GNUC__ && 1 < __GNUC__
2006 # define YYCOPY(To, From, Count) \
2007 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
2009 # define YYCOPY(To, From, Count) \
2013 for (yyi = 0; yyi < (Count); yyi++) \
2014 (To)[yyi] = (From)[yyi]; \
2020 /* Relocate STACK from its old location to the new one. The
2021 local variables YYSIZE and YYSTACKSIZE give the old and new number of
2022 elements in the stack, and YYPTR gives the new location of the
2023 stack. Advance YYPTR to a properly aligned location for the next
2025 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
2028 YYSIZE_T yynewbytes; \
2029 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
2030 Stack = &yyptr->Stack_alloc; \
2031 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
2032 yyptr += yynewbytes / sizeof (*yyptr); \
2038 /* YYFINAL -- State number of the termination state. */
2040 /* YYLAST -- Last index in YYTABLE. */
2043 /* YYNTOKENS -- Number of terminals. */
2044 #define YYNTOKENS 134
2045 /* YYNNTS -- Number of nonterminals. */
2047 /* YYNRULES -- Number of rules. */
2048 #define YYNRULES 303
2049 /* YYNRULES -- Number of states. */
2050 #define YYNSTATES 514
2052 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
2053 #define YYUNDEFTOK 2
2054 #define YYMAXUTOK 363
2056 #define YYTRANSLATE(YYX) \
2057 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
2059 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
2060 static const yytype_uint8 yytranslate[] =
2062 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2063 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2064 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2065 2, 2, 2, 118, 2, 2, 2, 116, 108, 2,
2066 122, 133, 115, 113, 100, 112, 127, 114, 2, 2,
2067 2, 2, 2, 2, 2, 2, 2, 2, 105, 99,
2068 109, 102, 110, 104, 128, 2, 2, 2, 2, 2,
2069 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2070 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2071 2, 124, 2, 125, 107, 2, 2, 2, 2, 2,
2072 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2073 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2074 2, 2, 2, 126, 106, 132, 117, 2, 2, 2,
2075 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2076 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2077 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2078 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2079 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2080 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2081 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2082 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2083 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2084 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2085 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2086 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2087 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
2088 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
2089 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
2090 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2091 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
2092 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2093 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
2094 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
2095 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2096 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
2097 95, 96, 97, 98, 101, 103, 111, 119, 120, 121,
2102 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
2104 static const yytype_uint16 yyprhs[] =
2106 0, 0, 3, 5, 6, 8, 10, 13, 15, 17,
2107 19, 21, 23, 25, 30, 32, 33, 35, 37, 40,
2108 42, 44, 46, 48, 50, 55, 57, 59, 60, 63,
2109 65, 67, 69, 71, 73, 75, 77, 79, 81, 83,
2110 85, 87, 91, 94, 96, 98, 100, 102, 104, 106,
2111 108, 113, 115, 118, 120, 122, 126, 129, 130, 133,
2112 136, 138, 142, 146, 147, 150, 151, 159, 160, 162,
2113 164, 168, 170, 173, 177, 186, 193, 194, 201, 202,
2114 210, 212, 215, 217, 220, 221, 223, 225, 228, 230,
2115 233, 238, 242, 243, 252, 253, 263, 264, 270, 272,
2116 275, 277, 280, 282, 283, 290, 293, 295, 301, 303,
2117 305, 309, 311, 312, 319, 320, 326, 329, 334, 335,
2118 337, 339, 342, 344, 346, 348, 350, 352, 354, 356,
2119 358, 360, 362, 363, 366, 367, 370, 371, 374, 375,
2120 385, 386, 395, 396, 398, 400, 403, 405, 410, 412,
2121 414, 416, 417, 419, 421, 424, 426, 429, 438, 440,
2122 442, 443, 450, 451, 454, 456, 458, 460, 462, 464,
2123 466, 468, 470, 472, 473, 475, 478, 483, 487, 489,
2124 494, 497, 499, 501, 502, 503, 516, 518, 519, 520,
2125 531, 533, 537, 539, 541, 543, 547, 549, 551, 553,
2126 556, 557, 558, 562, 563, 565, 567, 569, 572, 575,
2127 576, 581, 586, 591, 594, 596, 599, 601, 603, 607,
2128 609, 611, 613, 615, 617, 619, 621, 623, 625, 627,
2129 629, 631, 633, 635, 637, 639, 641, 643, 647, 651,
2130 655, 659, 663, 667, 671, 675, 679, 683, 686, 689,
2131 693, 697, 701, 705, 709, 713, 717, 721, 725, 729,
2132 733, 737, 741, 745, 749, 754, 757, 759, 763, 766,
2133 771, 775, 776, 778, 782, 788, 792, 796, 800, 804,
2134 808, 812, 816, 820, 824, 828, 832, 836, 842, 845,
2135 848, 851, 854, 858, 861, 866, 872, 876, 882, 886,
2139 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
2140 static const yytype_int16 yyrhs[] =
2142 135, 0, -1, 136, -1, -1, 137, -1, 138, -1,
2143 137, 138, -1, 185, -1, 197, -1, 195, -1, 214,
2144 -1, 206, -1, 147, -1, 148, 126, 136, 132, -1,
2145 99, -1, -1, 140, -1, 141, -1, 140, 141, -1,
2146 197, -1, 195, -1, 214, -1, 206, -1, 147, -1,
2147 148, 126, 139, 132, -1, 99, -1, 143, -1, -1,
2148 143, 145, -1, 145, -1, 188, -1, 159, -1, 160,
2149 -1, 161, -1, 163, -1, 171, -1, 154, -1, 182,
2150 -1, 179, -1, 236, -1, 243, -1, 126, 143, 132,
2151 -1, 126, 132, -1, 99, -1, 144, -1, 150, -1,
2152 165, -1, 166, -1, 233, -1, 181, -1, 148, 126,
2153 143, 132, -1, 242, -1, 145, 99, -1, 145, -1,
2154 144, -1, 3, 89, 3, -1, 102, 234, -1, -1,
2155 46, 151, -1, 32, 151, -1, 152, -1, 151, 100,
2156 152, -1, 3, 224, 149, -1, -1, 65, 146, -1,
2157 -1, 64, 122, 155, 235, 133, 146, 153, -1, -1,
2158 150, -1, 236, -1, 46, 3, 224, -1, 3, -1,
2159 13, 122, -1, 13, 50, 122, -1, 158, 156, 99,
2160 235, 99, 236, 133, 146, -1, 158, 157, 68, 235,
2161 133, 146, -1, -1, 14, 122, 162, 235, 133, 146,
2162 -1, -1, 15, 164, 146, 14, 122, 235, 133, -1,
2163 66, -1, 66, 3, -1, 30, -1, 30, 3, -1,
2164 -1, 168, -1, 170, -1, 168, 170, -1, 169, -1,
2165 168, 169, -1, 34, 237, 105, 142, -1, 62, 105,
2166 142, -1, -1, 16, 122, 172, 237, 133, 126, 167,
2167 132, -1, -1, 33, 122, 3, 224, 133, 174, 126,
2168 142, 132, -1, -1, 28, 126, 176, 142, 132, -1,
2169 173, -1, 177, 173, -1, 177, -1, 177, 175, -1,
2170 175, -1, -1, 52, 126, 180, 142, 132, 178, -1,
2171 37, 235, -1, 37, -1, 39, 122, 235, 133, 146,
2172 -1, 3, -1, 19, -1, 184, 127, 183, -1, 183,
2173 -1, -1, 19, 184, 126, 186, 139, 132, -1, -1,
2174 19, 126, 187, 139, 132, -1, 41, 220, -1, 41,
2175 184, 127, 115, -1, -1, 190, -1, 191, -1, 190,
2176 191, -1, 21, -1, 22, -1, 20, -1, 38, -1,
2177 47, -1, 49, -1, 48, -1, 26, -1, 24, -1,
2178 4, -1, -1, 54, 221, -1, -1, 54, 222, -1,
2179 -1, 17, 222, -1, -1, 189, 31, 3, 192, 194,
2180 126, 196, 199, 132, -1, -1, 189, 44, 3, 193,
2181 126, 198, 202, 132, -1, -1, 200, -1, 201, -1,
2182 200, 201, -1, 99, -1, 148, 126, 199, 132, -1,
2183 206, -1, 214, -1, 144, -1, -1, 203, -1, 204,
2184 -1, 203, 204, -1, 99, -1, 46, 3, -1, 189,
2185 27, 213, 3, 122, 210, 133, 224, -1, 46, -1,
2186 32, -1, -1, 189, 205, 3, 207, 224, 149, -1,
2187 -1, 102, 209, -1, 10, -1, 8, -1, 9, -1,
2188 12, -1, 5, -1, 56, -1, 55, -1, 45, -1,
2189 3, -1, -1, 211, -1, 93, 212, -1, 211, 100,
2190 93, 212, -1, 211, 100, 212, -1, 212, -1, 3,
2191 105, 223, 208, -1, 3, 208, -1, 51, -1, 35,
2192 -1, -1, -1, 189, 27, 213, 3, 122, 210, 133,
2193 224, 126, 215, 142, 132, -1, 3, -1, -1, -1,
2194 27, 216, 122, 210, 133, 224, 126, 218, 142, 132,
2195 -1, 3, -1, 184, 127, 3, -1, 220, -1, 219,
2196 -1, 221, -1, 222, 100, 221, -1, 221, -1, 115,
2197 -1, 36, -1, 105, 223, -1, -1, -1, 122, 226,
2198 133, -1, -1, 227, -1, 228, -1, 234, -1, 227,
2199 100, -1, 228, 234, -1, -1, 25, 237, 229, 225,
2200 -1, 237, 122, 226, 133, -1, 53, 122, 226, 133,
2201 -1, 63, 237, -1, 42, -1, 42, 235, -1, 237,
2202 -1, 237, -1, 235, 100, 237, -1, 235, -1, 217,
2203 -1, 238, -1, 241, -1, 230, -1, 232, -1, 231,
2204 -1, 6, -1, 10, -1, 11, -1, 8, -1, 9,
2205 -1, 12, -1, 5, -1, 29, -1, 56, -1, 55,
2206 -1, 45, -1, 237, 109, 237, -1, 237, 110, 237,
2207 -1, 237, 75, 237, -1, 237, 76, 237, -1, 237,
2208 71, 237, -1, 237, 72, 237, -1, 237, 74, 237,
2209 -1, 237, 73, 237, -1, 237, 87, 237, -1, 237,
2210 88, 237, -1, 118, 237, -1, 117, 237, -1, 237,
2211 108, 237, -1, 237, 107, 237, -1, 237, 106, 237,
2212 -1, 237, 96, 237, -1, 237, 95, 237, -1, 237,
2213 94, 237, -1, 237, 114, 237, -1, 237, 116, 237,
2214 -1, 237, 113, 237, -1, 237, 112, 237, -1, 237,
2215 115, 237, -1, 237, 68, 237, -1, 237, 69, 237,
2216 -1, 237, 40, 237, -1, 237, 67, 237, -1, 43,
2217 122, 237, 133, -1, 36, 237, -1, 36, -1, 122,
2218 235, 133, -1, 112, 237, -1, 237, 124, 237, 125,
2219 -1, 124, 226, 125, -1, -1, 240, -1, 234, 105,
2220 234, -1, 240, 100, 234, 105, 234, -1, 70, 239,
2221 132, -1, 237, 80, 237, -1, 237, 79, 237, -1,
2222 237, 85, 237, -1, 237, 84, 237, -1, 237, 86,
2223 237, -1, 237, 78, 237, -1, 237, 77, 237, -1,
2224 237, 83, 237, -1, 237, 81, 237, -1, 237, 82,
2225 237, -1, 237, 102, 237, -1, 237, 104, 237, 105,
2226 237, -1, 237, 91, -1, 237, 90, -1, 91, 237,
2227 -1, 90, 237, -1, 53, 127, 3, -1, 128, 3,
2228 -1, 237, 127, 128, 3, -1, 237, 127, 3, 89,
2229 3, -1, 237, 92, 3, -1, 237, 127, 122, 237,
2230 133, -1, 237, 127, 3, -1, 3, -1, 189, 18,
2231 3, -1, 189, 18, 3, 102, 3, -1, 189, 18,
2232 3, 102, 5, -1, 23, 18, 3, -1
2235 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
2236 static const yytype_uint16 yyrline[] =
2238 0, 1802, 1802, 1804, 1804, 1805, 1806, 1808, 1809, 1810,
2239 1811, 1812, 1813, 1814, 1815, 1817, 1817, 1818, 1819, 1821,
2240 1822, 1823, 1824, 1825, 1826, 1827, 1829, 1830, 1832, 1833,
2241 1836, 1837, 1838, 1839, 1840, 1841, 1842, 1843, 1844, 1845,
2242 1846, 1847, 1848, 1851, 1852, 1853, 1854, 1855, 1856, 1857,
2243 1858, 1860, 1864, 1865, 1869, 1876, 1880, 1881, 1885, 1886,
2244 1888, 1889, 1891, 1937, 1938, 1941, 1941, 1960, 1961, 1962,
2245 1967, 1971, 1976, 1977, 1979, 1999, 2043, 2043, 2062, 2062,
2246 2077, 2080, 2083, 2086, 2090, 2091, 2092, 2093, 2094, 2095,
2247 2097, 2108, 2111, 2111, 2140, 2140, 2160, 2160, 2176, 2177,
2248 2178, 2179, 2187, 2196, 2196, 2241, 2245, 2256, 2265, 2266,
2249 2268, 2269, 2271, 2271, 2273, 2273, 2276, 2291, 2307, 2308,
2250 2309, 2310, 2312, 2313, 2314, 2315, 2316, 2317, 2318, 2319,
2251 2320, 2321, 2323, 2324, 2326, 2327, 2329, 2330, 2334, 2332,
2252 2340, 2338, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353,
2253 2355, 2361, 2362, 2363, 2364, 2365, 2366, 2369, 2382, 2382,
2254 2384, 2384, 2457, 2458, 2460, 2461, 2462, 2463, 2464, 2466,
2255 2467, 2468, 2469, 2478, 2482, 2488, 2494, 2502, 2507, 2513,
2256 2521, 2529, 2530, 2531, 2534, 2533, 2550, 2551, 2553, 2552,
2257 2576, 2584, 2597, 2598, 2600, 2601, 2603, 2604, 2605, 2614,
2258 2615, 2619, 2620, 2622, 2623, 2624, 2626, 2630, 2631, 2636,
2259 2637, 2673, 2719, 2740, 2761, 2764, 2771, 2772, 2773, 2779,
2260 2785, 2787, 2789, 2791, 2793, 2795, 2797, 2814, 2819, 2822,
2261 2825, 2828, 2831, 2834, 2837, 2840, 2843, 2847, 2850, 2853,
2262 2856, 2859, 2862, 2865, 2868, 2872, 2883, 2901, 2906, 2911,
2263 2916, 2921, 2926, 2930, 2934, 2939, 2943, 2947, 2956, 2965,
2264 2975, 2980, 2992, 2998, 3003, 3009, 3015, 3019, 3021, 3032,
2265 3041, 3048, 3049, 3051, 3057, 3066, 3073, 3085, 3091, 3097,
2266 3103, 3109, 3115, 3121, 3127, 3140, 3151, 3158, 3171, 3198,
2267 3212, 3226, 3240, 3255, 3262, 3269, 3276, 3283, 3294, 3328,
2268 3443, 3444, 3445, 3447
2272 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
2273 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2274 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2275 static const char *const yytname[] =
2277 "$end", "error", "$undefined", "T_IDENTIFIER", "T_NAMESPACE",
2278 "T_STRING", "T_REGEXP", "T_EMPTY", "T_INT", "T_UINT", "T_BYTE",
2279 "T_SHORT", "T_FLOAT", "\"for\"", "\"while\"", "\"do\"", "\"switch\"",
2280 "\"implements\"", "\"namespace\"", "\"package\"", "\"protected\"",
2281 "\"public\"", "\"private\"", "\"use\"", "\"internal\"", "\"new\"",
2282 "\"native\"", "\"function\"", "\"finally\"", "\"undefined\"",
2283 "\"continue\"", "\"class\"", "\"const\"", "\"catch\"", "\"case\"",
2284 "\"set\"", "\"void\"", "\"throw\"", "\"static\"", "\"with\"",
2285 "\"instanceof\"", "\"import\"", "\"return\"", "\"typeof\"",
2286 "\"interface\"", "\"null\"", "\"var\"", "\"dynamic\"", "\"override\"",
2287 "\"final\"", "\"each\"", "\"get\"", "\"try\"", "\"super\"",
2288 "\"extends\"", "\"false\"", "\"true\"", "\"Boolean\"", "\"uint\"",
2289 "\"int\"", "\"Number\"", "\"String\"", "\"default\"", "\"delete\"",
2290 "\"if\"", "\"else\"", "\"break\"", "\"is\"", "\"in\"", "\"as\"",
2291 "\"{ (dictionary)\"", "\"==\"", "\"===\"", "\"!=\"", "\"!==\"", "\"<=\"",
2292 "\">=\"", "\"|=\"", "\"/=\"", "\"%=\"", "\"*=\"", "\"+=\"", "\"-=\"",
2293 "\"^=\"", "\">>=\"", "\"<<=\"", "\">>>=\"", "\"||\"", "\"&&\"", "\"::\"",
2294 "\"--\"", "\"++\"", "\"..\"", "\"...\"", "\"<<\"", "\">>>\"", "\">>\"",
2295 "prec_none", "below_semicolon", "';'", "','", "below_assignment", "'='",
2296 "\"&=\"", "'?'", "':'", "'|'", "'^'", "'&'", "'<'", "'>'", "below_minus",
2297 "'-'", "'+'", "'/'", "'*'", "'%'", "'~'", "'!'", "minusminus_prefix",
2298 "plusplus_prefix", "below_curly", "'('", "new2", "'['", "']'", "'{'",
2299 "'.'", "'@'", "above_identifier", "below_else", "above_function", "'}'",
2300 "')'", "$accept", "PROGRAM", "MAYBE_PROGRAM_CODE_LIST",
2301 "PROGRAM_CODE_LIST", "PROGRAM_CODE", "MAYBE_INPACKAGE_CODE_LIST",
2302 "INPACKAGE_CODE_LIST", "INPACKAGE_CODE", "MAYBECODE", "CODE",
2303 "CODE_STATEMENT", "CODEPIECE", "CODEBLOCK", "PACKAGE_INITCODE",
2304 "CONDITIONAL_COMPILATION", "MAYBEEXPRESSION", "VARIABLE_DECLARATION",
2305 "VARIABLE_LIST", "ONE_VARIABLE", "MAYBEELSE", "IF", "$@1", "FOR_INIT",
2306 "FOR_IN_INIT", "FOR_START", "FOR", "FOR_IN", "WHILE", "$@2", "DO_WHILE",
2307 "$@3", "BREAK", "CONTINUE", "MAYBE_CASE_LIST", "CASE_LIST", "CASE",
2308 "DEFAULT", "SWITCH", "$@4", "CATCH", "$@5", "FINALLY", "$@6",
2309 "CATCH_LIST", "CATCH_FINALLY_LIST", "TRY", "$@7", "THROW", "WITH",
2310 "X_IDENTIFIER", "PACKAGE", "PACKAGE_DECLARATION", "$@8", "$@9", "IMPORT",
2311 "MAYBE_MODIFIERS", "MODIFIER_LIST", "MODIFIER", "EXTENDS",
2312 "EXTENDS_LIST", "IMPLEMENTS_LIST", "CLASS_DECLARATION", "$@10",
2313 "INTERFACE_DECLARATION", "$@11", "MAYBE_CLASS_BODY", "CLASS_BODY",
2314 "CLASS_BODY_ITEM", "MAYBE_INTERFACE_BODY", "INTERFACE_BODY",
2315 "IDECLARATION", "VARCONST", "SLOT_DECLARATION", "$@12",
2316 "MAYBESTATICCONSTANT", "STATICCONSTANT", "MAYBE_PARAM_LIST",
2317 "PARAM_LIST", "PARAM", "GETSET", "FUNCTION_DECLARATION", "$@13",
2318 "MAYBE_IDENTIFIER", "INNERFUNCTION", "$@14", "CLASS", "PACKAGEANDCLASS",
2319 "CLASS_SPEC", "CLASS_SPEC_LIST", "TYPE", "MAYBETYPE",
2320 "MAYBE_PARAM_VALUES", "MAYBE_EXPRESSION_LIST", "EXPRESSION_LIST",
2321 "EXPRESSION_LIST_AND_COMMA", "XX", "NEW", "FUNCTIONCALL", "DELETE",
2322 "RETURN", "NONCOMMAEXPRESSION", "EXPRESSION", "VOIDEXPRESSION", "E",
2323 "CONSTANT", "MAYBE_EXPRPAIR_LIST", "EXPRPAIR_LIST", "VAR_READ",
2324 "NAMESPACE_DECLARATION", "USE_NAMESPACE", 0
2329 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
2331 static const yytype_uint16 yytoknum[] =
2333 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
2334 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
2335 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
2336 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
2337 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
2338 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
2339 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
2340 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
2341 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
2342 345, 346, 347, 348, 349, 350, 351, 352, 353, 59,
2343 44, 354, 61, 355, 63, 58, 124, 94, 38, 60,
2344 62, 356, 45, 43, 47, 42, 37, 126, 33, 357,
2345 358, 359, 40, 360, 91, 93, 123, 46, 64, 361,
2350 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2351 static const yytype_uint8 yyr1[] =
2353 0, 134, 135, 136, 136, 137, 137, 138, 138, 138,
2354 138, 138, 138, 138, 138, 139, 139, 140, 140, 141,
2355 141, 141, 141, 141, 141, 141, 142, 142, 143, 143,
2356 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
2357 144, 144, 144, 145, 145, 145, 145, 145, 145, 145,
2358 145, 145, 146, 146, 147, 148, 149, 149, 150, 150,
2359 151, 151, 152, 153, 153, 155, 154, 156, 156, 156,
2360 157, 157, 158, 158, 159, 160, 162, 161, 164, 163,
2361 165, 165, 166, 166, 167, 167, 167, 167, 168, 168,
2362 169, 170, 172, 171, 174, 173, 176, 175, 177, 177,
2363 178, 178, 178, 180, 179, 181, 181, 182, 183, 183,
2364 184, 184, 186, 185, 187, 185, 188, 188, 189, 189,
2365 190, 190, 191, 191, 191, 191, 191, 191, 191, 191,
2366 191, 191, 192, 192, 193, 193, 194, 194, 196, 195,
2367 198, 197, 199, 199, 200, 200, 201, 201, 201, 201,
2368 201, 202, 202, 203, 203, 204, 204, 204, 205, 205,
2369 207, 206, 208, 208, 209, 209, 209, 209, 209, 209,
2370 209, 209, 209, 210, 210, 210, 210, 211, 211, 212,
2371 212, 213, 213, 213, 215, 214, 216, 216, 218, 217,
2372 219, 220, 221, 221, 222, 222, 223, 223, 223, 224,
2373 224, 225, 225, 226, 226, 226, 227, 228, 227, 229,
2374 230, 231, 231, 232, 233, 233, 234, 235, 235, 236,
2375 237, 237, 237, 237, 237, 237, 237, 238, 238, 238,
2376 238, 238, 238, 238, 238, 238, 238, 237, 237, 237,
2377 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
2378 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
2379 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
2380 237, 239, 239, 240, 240, 237, 237, 237, 237, 237,
2381 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
2382 237, 237, 237, 237, 237, 237, 237, 237, 237, 241,
2386 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2387 static const yytype_uint8 yyr2[] =
2389 0, 2, 1, 0, 1, 1, 2, 1, 1, 1,
2390 1, 1, 1, 4, 1, 0, 1, 1, 2, 1,
2391 1, 1, 1, 1, 4, 1, 1, 0, 2, 1,
2392 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2393 1, 3, 2, 1, 1, 1, 1, 1, 1, 1,
2394 4, 1, 2, 1, 1, 3, 2, 0, 2, 2,
2395 1, 3, 3, 0, 2, 0, 7, 0, 1, 1,
2396 3, 1, 2, 3, 8, 6, 0, 6, 0, 7,
2397 1, 2, 1, 2, 0, 1, 1, 2, 1, 2,
2398 4, 3, 0, 8, 0, 9, 0, 5, 1, 2,
2399 1, 2, 1, 0, 6, 2, 1, 5, 1, 1,
2400 3, 1, 0, 6, 0, 5, 2, 4, 0, 1,
2401 1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
2402 1, 1, 0, 2, 0, 2, 0, 2, 0, 9,
2403 0, 8, 0, 1, 1, 2, 1, 4, 1, 1,
2404 1, 0, 1, 1, 2, 1, 2, 8, 1, 1,
2405 0, 6, 0, 2, 1, 1, 1, 1, 1, 1,
2406 1, 1, 1, 0, 1, 2, 4, 3, 1, 4,
2407 2, 1, 1, 0, 0, 12, 1, 0, 0, 10,
2408 1, 3, 1, 1, 1, 3, 1, 1, 1, 2,
2409 0, 0, 3, 0, 1, 1, 1, 2, 2, 0,
2410 4, 4, 4, 2, 1, 2, 1, 1, 3, 1,
2411 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2412 1, 1, 1, 1, 1, 1, 1, 3, 3, 3,
2413 3, 3, 3, 3, 3, 3, 3, 2, 2, 3,
2414 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2415 3, 3, 3, 3, 4, 2, 1, 3, 2, 4,
2416 3, 0, 1, 3, 5, 3, 3, 3, 3, 3,
2417 3, 3, 3, 3, 3, 3, 3, 5, 2, 2,
2418 2, 2, 3, 2, 4, 5, 3, 5, 3, 1,
2422 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2423 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2424 means the default is an error. */
2425 static const yytype_uint16 yydefact[] =
2427 118, 299, 131, 232, 226, 229, 230, 227, 228, 231,
2428 0, 0, 78, 0, 0, 124, 122, 123, 0, 130,
2429 0, 129, 187, 233, 266, 125, 0, 0, 0, 236,
2430 126, 128, 127, 0, 0, 235, 234, 0, 0, 271,
2431 0, 0, 14, 0, 0, 0, 0, 203, 118, 0,
2432 0, 2, 118, 5, 54, 12, 0, 36, 67, 31,
2433 32, 33, 34, 35, 38, 37, 7, 30, 0, 119,
2434 120, 9, 8, 11, 10, 220, 223, 225, 224, 219,
2435 39, 217, 221, 222, 40, 0, 0, 72, 76, 118,
2436 92, 108, 109, 114, 111, 0, 0, 299, 209, 186,
2437 0, 265, 0, 0, 116, 0, 103, 203, 0, 213,
2438 65, 0, 216, 0, 272, 291, 290, 268, 248, 247,
2439 0, 0, 204, 205, 206, 82, 0, 106, 214, 0,
2440 80, 43, 42, 118, 44, 29, 0, 45, 46, 47,
2441 49, 0, 48, 51, 293, 1, 6, 118, 299, 0,
2442 68, 0, 0, 69, 183, 0, 159, 0, 158, 0,
2443 121, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2444 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2445 0, 0, 0, 0, 289, 288, 0, 0, 0, 0,
2446 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2447 0, 0, 203, 0, 0, 55, 73, 0, 53, 0,
2448 0, 118, 112, 0, 303, 201, 173, 0, 0, 0,
2449 27, 0, 292, 0, 0, 275, 0, 267, 270, 207,
2450 208, 83, 200, 59, 60, 105, 215, 58, 81, 41,
2451 28, 118, 0, 0, 200, 0, 0, 182, 181, 0,
2452 132, 134, 160, 218, 262, 263, 260, 261, 241, 242,
2453 244, 243, 239, 240, 282, 281, 277, 276, 284, 285,
2454 283, 279, 278, 280, 245, 246, 296, 254, 253, 252,
2455 286, 0, 251, 250, 249, 237, 238, 258, 257, 255,
2456 259, 256, 0, 0, 298, 0, 0, 0, 52, 0,
2457 0, 25, 0, 118, 17, 23, 0, 20, 19, 22,
2458 21, 118, 110, 203, 210, 162, 0, 0, 174, 178,
2459 118, 191, 117, 264, 0, 26, 212, 0, 273, 0,
2460 0, 57, 0, 118, 300, 13, 57, 0, 0, 0,
2461 0, 136, 0, 0, 200, 0, 211, 269, 0, 0,
2462 294, 118, 0, 0, 115, 18, 118, 0, 0, 0,
2463 0, 180, 175, 200, 0, 107, 0, 118, 0, 190,
2464 198, 197, 0, 193, 192, 196, 199, 0, 62, 61,
2465 50, 0, 0, 118, 173, 133, 0, 0, 194, 135,
2466 140, 57, 287, 295, 297, 77, 0, 84, 0, 113,
2467 202, 172, 168, 165, 166, 164, 167, 171, 170, 169,
2468 163, 162, 0, 0, 177, 0, 0, 98, 102, 100,
2469 104, 63, 274, 0, 56, 301, 302, 0, 75, 0,
2470 137, 138, 0, 118, 161, 79, 0, 0, 0, 85,
2471 88, 86, 24, 179, 188, 176, 96, 0, 99, 101,
2472 118, 66, 118, 200, 118, 195, 0, 155, 0, 0,
2473 118, 153, 0, 27, 93, 89, 87, 27, 27, 200,
2474 64, 74, 0, 146, 150, 0, 0, 0, 118, 144,
2475 148, 149, 156, 183, 141, 154, 27, 91, 0, 0,
2476 0, 184, 118, 139, 145, 0, 90, 189, 97, 94,
2477 27, 0, 0, 0, 0, 147, 173, 27, 185, 0,
2481 /* YYDEFGOTO[NTERM-NUM]. */
2482 static const yytype_int16 yydefgoto[] =
2484 -1, 50, 51, 52, 53, 302, 303, 304, 324, 325,
2485 134, 135, 209, 305, 136, 378, 137, 237, 234, 451,
2486 57, 223, 151, 152, 58, 59, 60, 61, 207, 62,
2487 89, 138, 139, 438, 439, 440, 441, 63, 210, 417,
2488 503, 418, 468, 419, 420, 64, 220, 140, 65, 94,
2489 372, 66, 311, 211, 67, 141, 69, 70, 341, 343,
2490 387, 307, 454, 308, 433, 477, 478, 479, 459, 460,
2491 461, 159, 309, 344, 361, 410, 317, 318, 319, 249,
2492 310, 500, 100, 75, 467, 373, 374, 375, 389, 376,
2493 331, 314, 121, 122, 123, 215, 76, 77, 78, 142,
2494 124, 79, 80, 81, 82, 113, 114, 83, 143, 84
2497 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2499 #define YYPACT_NINF -374
2500 static const yytype_int16 yypact[] =
2502 1667, -68, -374, -374, -374, -374, -374, -374, -374, -374,
2503 -30, -97, -374, -57, 20, -374, -374, -374, 49, -374,
2504 2087, -374, 71, -374, 2157, -374, -37, 85, -35, -374,
2505 -374, -374, -374, 6, 8, -374, -374, 2087, 14, 2087,
2506 2087, 2087, -374, 2087, 2087, 2087, 2087, 2087, 627, 88,
2507 177, -374, 497, -374, -374, -374, 81, -374, 2017, -374,
2508 -374, -374, -374, -374, -374, -374, -374, -374, 308, 298,
2509 -374, -374, -374, -374, -374, -374, -374, -374, -374, 79,
2510 -374, 2562, -374, -374, -374, 197, 86, -374, -374, 1919,
2511 -374, -374, -374, -374, -374, -18, 206, -374, -46, -374,
2512 93, 133, 2087, 83, -374, 2087, -374, 2087, 215, 133,
2513 -374, 117, 2562, 94, 127, 133, 133, 201, 133, 133,
2514 -53, 103, 129, 2087, -374, 227, 228, 2087, 2087, 228,
2515 232, -374, -374, 757, -374, -374, 107, -374, -374, -374,
2516 -374, 219, -374, -374, -374, -374, -374, 1017, 170, 236,
2517 -374, 141, 176, -374, 70, 242, -374, 243, -374, 244,
2518 -374, 2087, 2087, 2087, 2087, 2087, 2087, 2087, 2087, 2087,
2519 2087, 2087, 2087, 2087, 2087, 2087, 2087, 2087, 2087, 2087,
2520 2087, 2087, 2087, 2087, -374, -374, 245, 2087, 2087, 2087,
2521 2087, 2087, 2087, 2087, 2087, 2087, 2087, 2087, 2087, 2087,
2522 2087, 2087, 2087, 2087, 11, -374, -374, 2087, 159, 247,
2523 2087, 1147, -374, 85, -374, 137, 24, -49, 16, 2182,
2524 1793, 130, -374, 2087, 2087, -374, 2087, -374, -374, -374,
2525 -374, -374, 157, 164, -374, 79, 79, 164, -374, -374,
2526 -374, 1919, 262, 134, 157, 2087, 2087, -374, -374, 269,
2527 226, 231, -374, 2562, 1009, 489, 489, 489, 2867, 2867,
2528 2867, 2867, 1009, 1009, 2562, 2562, 2562, 2562, 2562, 2562,
2529 2562, 2562, 2562, 2562, 304, 2623, -374, 349, 349, 349,
2530 2562, 2379, 2684, 2745, 2806, 1009, 1009, 201, 201, 133,
2531 133, 133, 148, 2440, 193, 2087, 281, -40, -374, 167,
2532 2253, -374, 154, 1277, -374, -374, 168, -374, -374, -374,
2533 -374, 1147, -374, 2087, -374, 96, 287, 174, 200, -374,
2534 1919, 181, -374, -374, 169, 1793, -374, -36, -374, 204,
2535 26, 208, 228, 887, 212, -374, -20, 53, -31, 199,
2536 125, 309, 125, 205, 157, 2087, -374, -374, 324, 2316,
2537 -374, 1919, 2087, 207, -374, -374, 1147, 202, 209, 67,
2538 26, -374, -374, 157, 25, -374, 110, 1919, 2087, 181,
2539 -374, -374, 210, -374, -374, -374, -374, 2087, -374, -374,
2540 -374, 39, 2087, 1919, 24, -374, 125, 217, -374, 251,
2541 -374, 208, 2562, -374, -374, -374, -14, 27, 221, -374,
2542 -374, -374, -374, -374, -374, -374, -374, -374, -374, -374,
2543 -374, 253, 233, 287, -374, 234, 241, -374, -374, 110,
2544 -374, 267, -374, 126, -374, -374, -374, 250, -374, 252,
2545 251, -374, 125, 230, -374, -374, 2087, 259, 235, 27,
2546 -374, -374, -374, -374, -374, -374, -374, 362, -374, -374,
2547 1919, -374, 1919, 157, 1407, -374, 366, -374, 347, 254,
2548 249, -374, 2501, 1793, -374, -374, -374, 1793, 1793, 157,
2549 -374, -374, 256, -374, -374, 258, 74, 255, 1537, -374,
2550 -374, -374, -374, 70, -374, -374, 1793, -374, 257, 261,
2551 264, -374, 1407, -374, -374, 385, -374, -374, -374, -374,
2552 1793, 270, 268, 265, 271, -374, 24, 1793, -374, 272,
2553 274, 157, -374, -374
2556 /* YYPGOTO[NTERM-NUM]. */
2557 static const yytype_int16 yypgoto[] =
2559 -374, -374, 260, -374, 352, -285, -374, 98, -373, -39,
2560 1, -84, -310, 31, 2, 17, 351, 289, 89, -374,
2561 -374, -374, -374, -374, -374, -374, -374, -374, -374, -374,
2562 -374, -374, -374, -374, -374, -17, -16, -374, -374, 5,
2563 -374, 13, -374, -374, -374, -374, -374, -374, -374, -202,
2564 36, -374, -374, -374, -374, 0, -374, 356, -374, -374,
2565 -374, 58, -374, 59, -374, -65, -374, -48, -374, -374,
2566 -26, -374, 3, -374, 32, -374, -369, -374, -298, -47,
2567 4, -374, -374, -374, -374, -374, 408, -318, 51, 78,
2568 -237, -374, -99, -374, -374, -374, -374, -374, -374, -374,
2569 -27, -3, -52, -7, -374, -374, -374, -374, -374, -374
2572 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2573 positive, shift that token. If negative, reduce the rule which
2574 number is the opposite. If zero, do what YYDEFACT says.
2575 If YYTABLE_NINF, syntax error. */
2576 #define YYTABLE_NINF -153
2577 static const yytype_int16 yytable[] =
2579 68, 54, 56, 73, 74, 208, 153, 336, 221, 133,
2580 365, 312, 111, 98, 294, 429, 312, 101, 362, 321,
2581 86, 85, 385, 91, 388, 88, 357, 315, 315, 369,
2582 109, 55, 112, 115, 116, 92, 117, 118, 119, 92,
2583 112, 395, 425, 120, 426, 92, 186, 161, -70, 240,
2584 95, 161, 68, 54, 56, 73, 74, 421, 71, 72,
2585 161, 436, 370, 103, 161, 90, 414, 96, 388, 161,
2586 401, 398, 402, 428, 99, 403, 404, 405, 203, 406,
2587 227, 204, 377, 55, 320, 102, 161, 105, 91, 437,
2588 487, 144, 87, 351, 488, 489, 230, 367, 219, 217,
2589 112, 154, 383, 292, 92, 247, 156, 391, 212, 213,
2590 71, 72, 407, 496, 455, 445, 112, 316, 413, 435,
2591 158, 248, 408, 409, 235, 236, 412, 504, 369, 321,
2592 107, 322, 106, 295, 510, 108, 110, 509, 415, 296,
2593 470, 371, 471, 416, 92, 92, 93, 68, 54, 56,
2594 73, 74, 382, 161, 253, 254, 255, 256, 257, 258,
2595 259, 260, 261, 262, 263, 264, 265, 266, 267, 268,
2596 269, 270, 271, 272, 273, 274, 275, 145, 55, 161,
2597 277, 278, 279, 280, 281, 282, 283, 284, 285, 286,
2598 287, 288, 289, 290, 291, 112, 293, 328, 359, 329,
2599 205, 360, 333, 300, 297, 71, 72, 147, 206, 214,
2600 218, 68, 54, 306, 358, 216, 472, 112, 222, 112,
2601 327, 312, 224, 184, 185, 186, 225, 226, 228, 229,
2602 231, 232, 490, 241, 2, 238, 208, 242, -71, 244,
2603 245, 240, 337, 338, 246, 250, 251, 252, 276, 240,
2604 15, 16, 17, 2, 19, 202, 21, 203, 298, 313,
2605 204, 299, 330, 326, 332, 334, 335, 208, 25, 15,
2606 16, 17, 339, 19, 513, 21, 456, 30, 31, 32,
2607 340, 346, 348, 208, 350, 342, 354, 25, 349, 352,
2608 315, 184, 185, 186, 356, 456, 30, 31, 32, 208,
2609 364, 366, 2, 68, 54, 306, 112, 363, -108, 368,
2610 377, 68, 54, 306, 381, 199, 200, 201, 15, 16,
2611 17, 384, 19, 202, 21, 203, 386, 393, 204, 457,
2612 427, 390, 450, 397, 399, 154, 25, 423, 392, 155,
2613 156, 422, 400, 431, 162, 30, 31, 32, 457, 396,
2614 424, 432, 157, 442, 158, 359, 68, 54, 306, 444,
2615 446, 112, -151, 447, 463, 469, 208, 464, 208, 482,
2616 112, 163, 164, 165, 483, 166, 167, 168, 169, 170,
2617 171, -152, 491, 452, 492, 453, 484, 493, 502, 497,
2618 506, 507, 183, 498, 184, 185, 186, 499, 187, 188,
2619 189, 355, 505, 508, 146, 511, 512, 243, 434, 150,
2620 192, 193, 194, 195, 196, 233, 197, 198, 199, 200,
2621 201, 379, 465, 466, 448, 160, 202, 501, 203, 462,
2622 494, 204, 449, 458, 485, 104, 495, 430, 411, 184,
2623 185, 186, 0, 443, 0, 0, 0, 0, 0, 0,
2624 0, 0, 0, 0, 476, 474, 475, 480, 481, 0,
2625 458, 197, 198, 199, 200, 201, 0, 0, 0, 0,
2626 0, 202, 0, 203, 0, 0, 204, 0, 476, 474,
2627 475, 480, 481, 0, 0, 0, 0, 0, 0, 0,
2628 0, 0, 476, 474, 475, 480, 481, -4, 0, 0,
2629 1, 2, 3, 4, 0, 5, 6, 7, 8, 9,
2630 10, 11, 12, 13, 0, 0, 14, 15, 16, 17,
2631 18, 19, 20, 21, 0, 0, 23, 0, 0, 162,
2632 0, 0, 0, 24, 0, 25, 26, 0, 27, 0,
2633 28, 0, 29, 0, 30, 31, 32, 0, 0, 33,
2634 34, 0, 35, 36, 0, 0, -153, -153, -153, 0,
2635 37, 38, 0, 0, 170, 171, 0, 39, 0, 0,
2636 0, 0, 0, 0, 0, 0, 0, 0, 0, 184,
2637 185, 186, 0, 187, 188, 189, 0, 40, 41, 0,
2638 0, 0, 0, 0, 0, 0, 42, 0, 195, 196,
2639 0, 197, 198, 199, 200, 201, 0, 0, 0, 43,
2640 0, 202, 0, 203, 44, 45, 204, 0, 0, 46,
2641 0, 47, 0, 48, 0, 49, 0, 0, 0, -4,
2642 1, 2, 3, 4, 0, 5, 6, 7, 8, 9,
2643 10, 11, 12, 13, 0, 0, 0, 15, 16, 17,
2644 18, 19, 20, 21, 22, 0, 23, 125, 0, 126,
2645 0, 0, 0, 24, 127, 25, 26, 0, 27, 128,
2646 28, 0, 29, 129, 30, 31, 32, 0, 0, 33,
2647 34, 0, 35, 36, 0, 0, 0, 0, 0, 0,
2648 37, 38, 0, 130, 0, 0, 0, 39, 0, 0,
2649 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2650 0, 0, 0, 0, 0, 0, 0, 40, 41, 0,
2651 0, 0, 0, 0, 0, 0, 131, 0, 0, 0,
2652 0, 0, 0, 0, 0, 0, 0, 0, 0, 43,
2653 0, 0, 0, 0, 44, 45, 0, 0, 0, 46,
2654 0, 47, 0, 48, 0, 49, 0, 0, 0, 132,
2655 1, 2, 3, 4, 0, 5, 6, 7, 8, 9,
2656 10, 11, 12, 13, 0, 0, 0, 15, 16, 17,
2657 18, 19, 20, 21, 22, 0, 23, 125, 0, 126,
2658 0, 0, 0, 24, 127, 25, 26, 0, 27, 128,
2659 28, 0, 29, 129, 30, 31, 32, 0, 0, 33,
2660 34, 0, 35, 36, 0, 0, 0, 0, 0, 0,
2661 37, 38, 0, 130, 0, 0, 0, 39, 0, 0,
2662 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2663 0, 0, 0, 0, 0, 0, 0, 40, 41, 0,
2664 0, 0, 0, 0, 0, 0, 131, 0, 0, 0,
2665 0, 0, 0, 0, 0, 0, 0, 0, 0, 43,
2666 0, 0, 0, 0, 44, 45, 0, 0, 0, 46,
2667 0, 47, 0, 48, 0, 49, 0, 0, 0, 239,
2668 1, 2, 3, 4, 0, 5, 6, 7, 8, 9,
2669 10, 11, 12, 13, 0, 0, 0, 15, 16, 17,
2670 18, 19, 20, 21, 22, 0, 23, 125, 0, 126,
2671 0, 0, 0, 24, 127, 25, 26, 0, 27, 128,
2672 28, 0, 29, 129, 30, 31, 32, 0, 0, 33,
2673 34, 0, 35, 36, 0, 0, 0, 0, 0, 0,
2674 37, 38, 0, 130, 0, 0, 0, 39, 0, 0,
2675 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2676 0, 0, 0, 0, 0, 0, 0, 40, 41, 0,
2677 0, 0, 0, 0, 0, 0, 131, 0, 0, 0,
2678 0, 0, 0, 0, 0, 0, 0, 0, 0, 43,
2679 0, 0, 0, 0, 44, 45, 0, 0, 0, 46,
2680 0, 47, 0, 48, 0, 49, 0, 0, 0, 380,
2681 1, 2, 3, 4, 0, 5, 6, 7, 8, 9,
2682 10, 11, 12, 13, 0, 0, 14, 15, 16, 17,
2683 18, 19, 20, 21, 0, 0, 23, 0, 0, -153,
2684 0, 0, 0, 24, 0, 25, 26, 0, 27, 0,
2685 28, 0, 29, 0, 30, 31, 32, 0, 0, 33,
2686 34, 0, 35, 36, 0, 0, 0, 0, 0, 0,
2687 37, 38, 0, 0, -153, -153, 0, 39, 0, 0,
2688 0, 0, 0, 0, 0, 0, 0, 0, 0, 184,
2689 185, 186, 0, 187, 188, 189, 0, 40, 41, 0,
2690 0, 0, 0, 0, 0, 0, 42, 0, -153, -153,
2691 0, 197, 198, 199, 200, 201, 0, 0, 0, 43,
2692 0, 202, 0, 203, 44, 45, 204, 0, 0, 46,
2693 0, 47, 0, 48, 0, 49, 0, 0, 0, -3,
2694 1, 2, 3, 4, 0, 5, 6, 7, 8, 9,
2695 10, 11, 12, 13, 0, 0, 0, 15, 16, 17,
2696 18, 19, 20, 21, 0, 0, 23, 0, 0, 0,
2697 0, 0, 0, 24, 0, 25, 26, 0, 27, 0,
2698 28, 0, 29, 0, 30, 31, 32, 0, 0, 33,
2699 34, 0, 35, 36, 0, 0, 0, 0, 0, 0,
2700 37, 38, 0, 0, 0, 0, 0, 39, 0, 0,
2701 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2702 0, 0, 0, 0, 0, 0, 0, 40, 41, 0,
2703 0, 0, 0, 0, 0, 0, 301, 0, 0, 0,
2704 0, 0, 0, 0, 0, 0, 0, 0, 0, 43,
2705 0, 0, 0, 0, 44, 45, 0, 0, 0, 46,
2706 0, 47, 0, 48, 0, 49, 0, 0, 0, -15,
2707 1, 2, 3, 4, 0, 5, 6, 7, 8, 9,
2708 10, 11, 12, 13, 0, 0, 0, 15, 16, 17,
2709 18, 19, 20, 21, 0, 0, 23, 0, 0, 0,
2710 0, 0, 0, 24, 0, 25, 26, 0, 27, 0,
2711 28, 0, 29, 0, 30, 31, 32, 0, 0, 33,
2712 34, 0, 35, 36, 0, 0, 0, 0, 0, 0,
2713 37, 38, 0, 0, 0, 0, 0, 39, 0, 0,
2714 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2715 0, 0, 0, 0, 0, 0, 0, 40, 41, 0,
2716 0, 0, 0, 0, 0, 0, 301, 0, 0, 0,
2717 0, 0, 0, 0, 0, 0, 0, 0, 0, 43,
2718 0, 0, 0, 0, 44, 45, 0, 0, 0, 46,
2719 0, 47, 0, 48, 0, 49, 0, 0, 0, -16,
2720 1, 2, 3, 4, 0, 5, 6, 7, 8, 9,
2721 10, 11, 12, 13, 0, 0, 0, 15, 16, 17,
2722 18, 19, 20, 21, 0, 0, 23, 0, 0, 0,
2723 0, 0, 0, 24, 0, 25, 26, 0, 27, 0,
2724 28, 0, 29, 0, 30, 31, 32, 0, 0, 33,
2725 34, 0, 35, 36, 0, 0, 0, 0, 0, 0,
2726 37, 38, 0, 0, 0, 0, 0, 39, 0, 0,
2727 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2728 0, 0, 0, 0, 0, 0, 0, 40, 41, 0,
2729 0, 0, 0, 0, 0, 0, 473, 0, 0, 0,
2730 0, 0, 0, 0, 0, 0, 0, 0, 0, 43,
2731 0, 0, 0, 0, 44, 45, 0, 0, 0, 46,
2732 0, 47, 0, 48, 0, 49, 0, 0, 0, -142,
2733 1, 2, 3, 4, 0, 5, 6, 7, 8, 9,
2734 10, 11, 12, 13, 0, 0, 0, 15, 16, 17,
2735 18, 19, 20, 21, 0, 0, 23, 0, 0, 0,
2736 0, 0, 0, 24, 0, 25, 26, 0, 27, 0,
2737 28, 0, 29, 0, 30, 31, 32, 0, 0, 33,
2738 34, 0, 35, 36, 0, 0, 0, 0, 0, 0,
2739 37, 38, 0, 0, 0, 0, 0, 39, 0, 0,
2740 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2741 0, 0, 0, 0, 0, 0, 0, 40, 41, 0,
2742 0, 0, 0, 0, 0, 0, 473, 0, 0, 0,
2743 0, 0, 0, 0, 0, 0, 0, 0, 0, 43,
2744 0, 0, 0, 0, 44, 45, 0, 0, 0, 46,
2745 0, 47, 0, 48, 0, 49, 0, -3, 0, -143,
2746 1, 2, 3, 4, 0, 5, 6, 7, 8, 9,
2747 10, 11, 12, 13, 0, 0, 14, 15, 16, 17,
2748 18, 19, 20, 21, 0, 0, 23, 0, 0, 0,
2749 0, 0, 0, 24, 0, 25, 26, 0, 27, 0,
2750 28, 0, 29, 0, 30, 31, 32, 0, 0, 33,
2751 34, 0, 35, 36, 0, 0, 0, 0, 0, 0,
2752 37, 38, 0, 0, 0, 0, 0, 39, 0, 0,
2753 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2754 0, 0, 0, 0, 0, 0, 0, 40, 41, 0,
2755 0, 0, 0, 0, 0, 0, 42, 0, 0, 0,
2756 0, 0, 0, 0, 0, 0, 0, 0, 0, 43,
2757 0, 0, 0, 0, 44, 45, 0, 0, 0, 46,
2758 0, 47, 0, 48, 0, 49, 1, 2, 3, 4,
2759 0, 5, 6, 7, 8, 9, 10, 11, 12, 13,
2760 0, -118, 0, 15, 16, 17, 18, 19, 20, 21,
2761 22, 0, 23, 125, 0, 126, 0, 0, 0, 24,
2762 127, 25, 26, 0, 27, 128, 28, 0, 29, 129,
2763 30, 31, 32, 0, 0, 33, 34, 0, 35, 36,
2764 0, 0, 0, 0, 0, 0, 37, 38, 0, 130,
2765 0, 0, 0, 39, 0, 0, 0, 0, 0, 0,
2766 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2767 0, 0, 0, 40, 41, 0, 0, 0, 0, 0,
2768 0, 0, 131, 0, 0, 0, 0, 0, 0, 0,
2769 0, 0, 0, 0, 0, 43, 0, 0, 0, 0,
2770 44, 45, 0, 0, 0, 46, 0, 47, 0, 48,
2771 0, 49, 1, 2, 3, 4, 0, 5, 6, 7,
2772 8, 9, 10, 11, 12, 13, 0, 0, 0, 15,
2773 16, 17, 18, 19, 20, 21, 22, 0, 23, 125,
2774 0, 126, 0, 0, 0, 24, 127, 25, 26, 0,
2775 27, 128, 28, 0, 29, 129, 30, 31, 32, 0,
2776 0, 33, 34, 0, 35, 36, 0, 0, 0, 0,
2777 0, 0, 37, 38, 0, 130, 0, 0, 0, 39,
2778 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2779 0, 0, 0, 0, 0, 0, 0, 0, 0, 40,
2780 41, 0, 0, 0, 0, 0, 0, 0, 131, 0,
2781 148, 0, 3, 4, 0, 5, 6, 7, 8, 9,
2782 0, 43, 0, 0, 0, 0, 44, 45, 0, 0,
2783 0, 46, 20, 47, 22, 48, 23, 49, 0, 126,
2784 0, 0, 0, 24, 0, 0, 0, 0, 0, 0,
2785 28, 0, 29, 149, 0, 0, 0, 0, 0, 0,
2786 34, 0, 35, 36, 0, 0, 0, 0, 0, 0,
2787 37, 0, 0, 0, 0, 0, 0, 39, 0, 0,
2788 97, 0, 3, 4, 0, 5, 6, 7, 8, 9,
2789 0, 0, 0, 0, 0, 0, 0, 40, 41, 0,
2790 0, 0, 20, 0, 22, 0, 23, 0, 0, 0,
2791 0, 0, 0, 24, 0, 0, 0, 0, 0, 43,
2792 28, 0, 29, 0, 44, 45, 0, 0, 0, 46,
2793 34, 47, 35, 36, 0, 49, 0, 0, 0, 0,
2794 37, 0, 0, 0, 0, 0, 0, 39, 0, 0,
2795 97, 0, 3, 4, 0, 5, 6, 7, 8, 9,
2796 0, 0, 0, 0, 0, 0, 0, 40, 41, 0,
2797 0, 0, 20, 0, 22, 0, 23, 0, 0, 0,
2798 0, 0, 0, 0, 0, 0, 0, 0, 0, 43,
2799 0, 0, 29, 0, 44, 45, 0, 0, 0, 46,
2800 34, 47, 35, 36, 0, 49, 0, 0, 0, 0,
2801 0, 0, 162, 0, 0, 0, 0, 39, 0, 0,
2802 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2803 0, 0, 0, 0, 0, 0, 0, 40, 41, 163,
2804 164, 165, 0, 166, 167, 168, 169, 170, 171, 172,
2805 173, 174, 175, 176, 177, 178, 179, 180, 181, 182,
2806 183, 0, 184, 185, 186, 0, 187, 188, 189, 46,
2807 0, 47, 0, 0, 190, 49, 191, 0, 192, 193,
2808 194, 195, 196, 162, 197, 198, 199, 200, 201, 0,
2809 0, 0, 0, 0, 202, 0, 203, 0, 0, 204,
2810 0, 0, 0, 0, 0, 323, 0, 0, 0, 0,
2811 163, 164, 165, 0, 166, 167, 168, 169, 170, 171,
2812 172, 173, 174, 175, 176, 177, 178, 179, 180, 181,
2813 182, 183, 0, 184, 185, 186, 0, 187, 188, 189,
2814 0, 0, 0, 0, 0, 190, 162, 191, 0, 192,
2815 193, 194, 195, 196, 0, 197, 198, 199, 200, 201,
2816 0, 0, 0, 0, 0, 202, 0, 203, 0, 0,
2817 204, 0, 0, 163, 164, 165, 353, 166, 167, 168,
2818 169, 170, 171, 172, 173, 174, 175, 176, 177, 178,
2819 179, 180, 181, 182, 183, 0, 184, 185, 186, 0,
2820 187, 188, 189, 0, 0, 0, 0, 0, 190, 162,
2821 191, 0, 192, 193, 194, 195, 196, 0, 197, 198,
2822 199, 200, 201, 0, 0, 0, 0, 0, 202, 0,
2823 203, 0, 0, 204, 0, 0, 163, 164, 165, 394,
2824 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
2825 176, 177, 178, 179, 180, 181, 182, 183, 0, 184,
2826 185, 186, 0, 187, 188, 189, 0, 0, 0, 0,
2827 162, 190, 0, 191, 345, 192, 193, 194, 195, 196,
2828 0, 197, 198, 199, 200, 201, 0, 0, 0, 0,
2829 0, 202, 0, 203, 0, 0, 204, 163, 164, 165,
2830 0, 166, 167, 168, 169, 170, 171, 172, 173, 174,
2831 175, 176, 177, 178, 179, 180, 181, 182, 183, 0,
2832 184, 185, 186, 0, 187, 188, 189, 0, 0, 0,
2833 0, 162, 190, 0, 191, 0, 192, 193, 194, 195,
2834 196, 0, 197, 198, 199, 200, 201, 0, 0, 0,
2835 0, 0, 202, 0, 203, 347, 0, 204, 163, 164,
2836 165, 0, 166, 167, 168, 169, 170, 171, 172, 173,
2837 174, 175, 176, 177, 178, 179, 180, 181, 182, 183,
2838 0, 184, 185, 186, 0, 187, 188, 189, 0, 0,
2839 0, 0, 162, 190, 0, 191, 486, 192, 193, 194,
2840 195, 196, 0, 197, 198, 199, 200, 201, 0, 0,
2841 0, 0, 0, 202, 0, 203, 0, 0, 204, 163,
2842 164, 165, 0, 166, 167, 168, 169, 170, 171, 172,
2843 173, 174, 175, 176, 177, 178, 179, 180, 181, 182,
2844 183, 0, 184, 185, 186, 0, 187, 188, 189, 0,
2845 0, 0, 0, 162, 190, 0, 191, 0, 192, 193,
2846 194, 195, 196, 0, 197, 198, 199, 200, 201, 0,
2847 0, 0, 0, 0, 202, 0, 203, 0, 0, 204,
2848 163, 164, 165, 0, 166, 167, 168, 169, 170, 171,
2849 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2850 0, 0, 0, 184, 185, 186, 0, 187, 188, 189,
2851 0, 0, 0, 0, 162, 0, 0, 0, 0, 192,
2852 193, 194, 195, 196, 0, 197, 198, 199, 200, 201,
2853 0, 0, 0, 0, 0, 202, 0, 203, 0, 0,
2854 204, 163, 164, 165, 0, 166, 167, 168, 169, 170,
2855 171, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2856 0, 0, 0, 0, 184, 185, 186, 0, 187, 188,
2857 189, 0, 0, 0, 0, 162, 0, 0, 0, 0,
2858 0, 193, 194, 195, 196, 0, 197, 198, 199, 200,
2859 201, 0, 0, 0, 0, 0, 202, 0, 203, 0,
2860 0, 204, 163, 164, 165, 0, 166, 167, 168, 169,
2861 170, 171, 0, 0, 0, 0, 0, 0, 0, 0,
2862 0, 0, 0, 0, 0, 184, 185, 186, 0, 187,
2863 188, 189, 0, 0, 0, 0, 162, 0, 0, 0,
2864 0, 0, 0, 194, 195, 196, 0, 197, 198, 199,
2865 200, 201, 0, 0, 0, 0, 0, 202, 0, 203,
2866 0, 0, 204, 163, 164, 165, 0, 166, 167, 168,
2867 169, 170, 171, 0, 0, 0, 0, 0, 0, 0,
2868 0, 0, 0, 0, 0, 0, 184, 185, 186, 0,
2869 187, 188, 189, 0, 0, 0, 0, 162, 0, 0,
2870 0, 0, 0, 0, -153, 195, 196, 0, 197, 198,
2871 199, 200, 201, 0, 0, 0, 0, 0, 202, 0,
2872 203, 0, 0, 204, 163, 164, 165, 0, -153, -153,
2873 -153, -153, 170, 171, 0, 0, 0, 0, 0, 0,
2874 0, 0, 0, 0, 0, 0, 0, 184, 185, 186,
2875 0, 187, 188, 189, 0, 0, 0, 0, 0, 0,
2876 0, 0, 0, 0, 0, 0, 195, 196, 0, 197,
2877 198, 199, 200, 201, 0, 0, 0, 0, 0, 202,
2881 static const yytype_int16 yycheck[] =
2883 0, 0, 0, 0, 0, 89, 58, 244, 107, 48,
2884 320, 213, 39, 20, 3, 384, 218, 24, 316, 3,
2885 50, 89, 340, 3, 342, 122, 311, 3, 3, 3,
2886 37, 0, 39, 40, 41, 19, 43, 44, 45, 19,
2887 47, 351, 3, 46, 5, 19, 92, 100, 68, 133,
2888 14, 100, 52, 52, 52, 52, 52, 367, 0, 0,
2889 100, 34, 36, 27, 100, 122, 364, 18, 386, 100,
2890 3, 356, 5, 383, 3, 8, 9, 10, 124, 12,
2891 133, 127, 102, 52, 133, 122, 100, 122, 3, 62,
2892 463, 3, 122, 133, 467, 468, 123, 133, 105, 102,
2893 107, 27, 133, 202, 19, 35, 32, 344, 126, 127,
2894 52, 52, 45, 486, 432, 413, 123, 93, 93, 133,
2895 46, 51, 55, 56, 127, 128, 363, 500, 3, 3,
2896 122, 115, 126, 122, 507, 127, 122, 506, 28, 128,
2897 450, 115, 452, 33, 19, 19, 126, 147, 147, 147,
2898 147, 147, 99, 100, 161, 162, 163, 164, 165, 166,
2899 167, 168, 169, 170, 171, 172, 173, 174, 175, 176,
2900 177, 178, 179, 180, 181, 182, 183, 0, 147, 100,
2901 187, 188, 189, 190, 191, 192, 193, 194, 195, 196,
2902 197, 198, 199, 200, 201, 202, 203, 224, 102, 226,
2903 3, 105, 241, 210, 207, 147, 147, 126, 122, 3,
2904 127, 211, 211, 211, 313, 122, 453, 224, 3, 226,
2905 223, 423, 105, 90, 91, 92, 132, 100, 125, 100,
2906 3, 3, 469, 126, 4, 3, 320, 18, 68, 3,
2907 99, 325, 245, 246, 68, 3, 3, 3, 3, 333,
2908 20, 21, 22, 4, 24, 122, 26, 124, 99, 122,
2909 127, 14, 105, 133, 100, 3, 132, 351, 38, 20,
2910 21, 22, 3, 24, 511, 26, 46, 47, 48, 49,
2911 54, 133, 89, 367, 3, 54, 132, 38, 295, 122,
2912 3, 90, 91, 92, 126, 46, 47, 48, 49, 383,
2913 100, 132, 4, 303, 303, 303, 313, 133, 127, 105,
2914 102, 311, 311, 311, 102, 114, 115, 116, 20, 21,
2915 22, 122, 24, 122, 26, 124, 17, 3, 127, 99,
2916 382, 126, 65, 126, 132, 27, 38, 127, 345, 31,
2917 32, 368, 133, 126, 40, 47, 48, 49, 99, 352,
2918 377, 100, 44, 132, 46, 102, 356, 356, 356, 126,
2919 126, 368, 132, 122, 105, 3, 450, 132, 452, 3,
2920 377, 67, 68, 69, 27, 71, 72, 73, 74, 75,
2921 76, 132, 126, 133, 126, 133, 132, 132, 3, 132,
2922 122, 126, 88, 132, 90, 91, 92, 133, 94, 95,
2923 96, 303, 132, 132, 52, 133, 132, 147, 391, 58,
2924 106, 107, 108, 109, 110, 126, 112, 113, 114, 115,
2925 116, 332, 439, 439, 419, 69, 122, 492, 124, 436,
2926 478, 127, 419, 433, 460, 27, 483, 386, 360, 90,
2927 91, 92, -1, 411, -1, -1, -1, -1, -1, -1,
2928 -1, -1, -1, -1, 454, 454, 454, 454, 454, -1,
2929 460, 112, 113, 114, 115, 116, -1, -1, -1, -1,
2930 -1, 122, -1, 124, -1, -1, 127, -1, 478, 478,
2931 478, 478, 478, -1, -1, -1, -1, -1, -1, -1,
2932 -1, -1, 492, 492, 492, 492, 492, 0, -1, -1,
2933 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
2934 13, 14, 15, 16, -1, -1, 19, 20, 21, 22,
2935 23, 24, 25, 26, -1, -1, 29, -1, -1, 40,
2936 -1, -1, -1, 36, -1, 38, 39, -1, 41, -1,
2937 43, -1, 45, -1, 47, 48, 49, -1, -1, 52,
2938 53, -1, 55, 56, -1, -1, 67, 68, 69, -1,
2939 63, 64, -1, -1, 75, 76, -1, 70, -1, -1,
2940 -1, -1, -1, -1, -1, -1, -1, -1, -1, 90,
2941 91, 92, -1, 94, 95, 96, -1, 90, 91, -1,
2942 -1, -1, -1, -1, -1, -1, 99, -1, 109, 110,
2943 -1, 112, 113, 114, 115, 116, -1, -1, -1, 112,
2944 -1, 122, -1, 124, 117, 118, 127, -1, -1, 122,
2945 -1, 124, -1, 126, -1, 128, -1, -1, -1, 132,
2946 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
2947 13, 14, 15, 16, -1, -1, -1, 20, 21, 22,
2948 23, 24, 25, 26, 27, -1, 29, 30, -1, 32,
2949 -1, -1, -1, 36, 37, 38, 39, -1, 41, 42,
2950 43, -1, 45, 46, 47, 48, 49, -1, -1, 52,
2951 53, -1, 55, 56, -1, -1, -1, -1, -1, -1,
2952 63, 64, -1, 66, -1, -1, -1, 70, -1, -1,
2953 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2954 -1, -1, -1, -1, -1, -1, -1, 90, 91, -1,
2955 -1, -1, -1, -1, -1, -1, 99, -1, -1, -1,
2956 -1, -1, -1, -1, -1, -1, -1, -1, -1, 112,
2957 -1, -1, -1, -1, 117, 118, -1, -1, -1, 122,
2958 -1, 124, -1, 126, -1, 128, -1, -1, -1, 132,
2959 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
2960 13, 14, 15, 16, -1, -1, -1, 20, 21, 22,
2961 23, 24, 25, 26, 27, -1, 29, 30, -1, 32,
2962 -1, -1, -1, 36, 37, 38, 39, -1, 41, 42,
2963 43, -1, 45, 46, 47, 48, 49, -1, -1, 52,
2964 53, -1, 55, 56, -1, -1, -1, -1, -1, -1,
2965 63, 64, -1, 66, -1, -1, -1, 70, -1, -1,
2966 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2967 -1, -1, -1, -1, -1, -1, -1, 90, 91, -1,
2968 -1, -1, -1, -1, -1, -1, 99, -1, -1, -1,
2969 -1, -1, -1, -1, -1, -1, -1, -1, -1, 112,
2970 -1, -1, -1, -1, 117, 118, -1, -1, -1, 122,
2971 -1, 124, -1, 126, -1, 128, -1, -1, -1, 132,
2972 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
2973 13, 14, 15, 16, -1, -1, -1, 20, 21, 22,
2974 23, 24, 25, 26, 27, -1, 29, 30, -1, 32,
2975 -1, -1, -1, 36, 37, 38, 39, -1, 41, 42,
2976 43, -1, 45, 46, 47, 48, 49, -1, -1, 52,
2977 53, -1, 55, 56, -1, -1, -1, -1, -1, -1,
2978 63, 64, -1, 66, -1, -1, -1, 70, -1, -1,
2979 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2980 -1, -1, -1, -1, -1, -1, -1, 90, 91, -1,
2981 -1, -1, -1, -1, -1, -1, 99, -1, -1, -1,
2982 -1, -1, -1, -1, -1, -1, -1, -1, -1, 112,
2983 -1, -1, -1, -1, 117, 118, -1, -1, -1, 122,
2984 -1, 124, -1, 126, -1, 128, -1, -1, -1, 132,
2985 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
2986 13, 14, 15, 16, -1, -1, 19, 20, 21, 22,
2987 23, 24, 25, 26, -1, -1, 29, -1, -1, 40,
2988 -1, -1, -1, 36, -1, 38, 39, -1, 41, -1,
2989 43, -1, 45, -1, 47, 48, 49, -1, -1, 52,
2990 53, -1, 55, 56, -1, -1, -1, -1, -1, -1,
2991 63, 64, -1, -1, 75, 76, -1, 70, -1, -1,
2992 -1, -1, -1, -1, -1, -1, -1, -1, -1, 90,
2993 91, 92, -1, 94, 95, 96, -1, 90, 91, -1,
2994 -1, -1, -1, -1, -1, -1, 99, -1, 109, 110,
2995 -1, 112, 113, 114, 115, 116, -1, -1, -1, 112,
2996 -1, 122, -1, 124, 117, 118, 127, -1, -1, 122,
2997 -1, 124, -1, 126, -1, 128, -1, -1, -1, 132,
2998 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
2999 13, 14, 15, 16, -1, -1, -1, 20, 21, 22,
3000 23, 24, 25, 26, -1, -1, 29, -1, -1, -1,
3001 -1, -1, -1, 36, -1, 38, 39, -1, 41, -1,
3002 43, -1, 45, -1, 47, 48, 49, -1, -1, 52,
3003 53, -1, 55, 56, -1, -1, -1, -1, -1, -1,
3004 63, 64, -1, -1, -1, -1, -1, 70, -1, -1,
3005 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3006 -1, -1, -1, -1, -1, -1, -1, 90, 91, -1,
3007 -1, -1, -1, -1, -1, -1, 99, -1, -1, -1,
3008 -1, -1, -1, -1, -1, -1, -1, -1, -1, 112,
3009 -1, -1, -1, -1, 117, 118, -1, -1, -1, 122,
3010 -1, 124, -1, 126, -1, 128, -1, -1, -1, 132,
3011 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
3012 13, 14, 15, 16, -1, -1, -1, 20, 21, 22,
3013 23, 24, 25, 26, -1, -1, 29, -1, -1, -1,
3014 -1, -1, -1, 36, -1, 38, 39, -1, 41, -1,
3015 43, -1, 45, -1, 47, 48, 49, -1, -1, 52,
3016 53, -1, 55, 56, -1, -1, -1, -1, -1, -1,
3017 63, 64, -1, -1, -1, -1, -1, 70, -1, -1,
3018 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3019 -1, -1, -1, -1, -1, -1, -1, 90, 91, -1,
3020 -1, -1, -1, -1, -1, -1, 99, -1, -1, -1,
3021 -1, -1, -1, -1, -1, -1, -1, -1, -1, 112,
3022 -1, -1, -1, -1, 117, 118, -1, -1, -1, 122,
3023 -1, 124, -1, 126, -1, 128, -1, -1, -1, 132,
3024 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
3025 13, 14, 15, 16, -1, -1, -1, 20, 21, 22,
3026 23, 24, 25, 26, -1, -1, 29, -1, -1, -1,
3027 -1, -1, -1, 36, -1, 38, 39, -1, 41, -1,
3028 43, -1, 45, -1, 47, 48, 49, -1, -1, 52,
3029 53, -1, 55, 56, -1, -1, -1, -1, -1, -1,
3030 63, 64, -1, -1, -1, -1, -1, 70, -1, -1,
3031 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3032 -1, -1, -1, -1, -1, -1, -1, 90, 91, -1,
3033 -1, -1, -1, -1, -1, -1, 99, -1, -1, -1,
3034 -1, -1, -1, -1, -1, -1, -1, -1, -1, 112,
3035 -1, -1, -1, -1, 117, 118, -1, -1, -1, 122,
3036 -1, 124, -1, 126, -1, 128, -1, -1, -1, 132,
3037 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
3038 13, 14, 15, 16, -1, -1, -1, 20, 21, 22,
3039 23, 24, 25, 26, -1, -1, 29, -1, -1, -1,
3040 -1, -1, -1, 36, -1, 38, 39, -1, 41, -1,
3041 43, -1, 45, -1, 47, 48, 49, -1, -1, 52,
3042 53, -1, 55, 56, -1, -1, -1, -1, -1, -1,
3043 63, 64, -1, -1, -1, -1, -1, 70, -1, -1,
3044 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3045 -1, -1, -1, -1, -1, -1, -1, 90, 91, -1,
3046 -1, -1, -1, -1, -1, -1, 99, -1, -1, -1,
3047 -1, -1, -1, -1, -1, -1, -1, -1, -1, 112,
3048 -1, -1, -1, -1, 117, 118, -1, -1, -1, 122,
3049 -1, 124, -1, 126, -1, 128, -1, 0, -1, 132,
3050 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
3051 13, 14, 15, 16, -1, -1, 19, 20, 21, 22,
3052 23, 24, 25, 26, -1, -1, 29, -1, -1, -1,
3053 -1, -1, -1, 36, -1, 38, 39, -1, 41, -1,
3054 43, -1, 45, -1, 47, 48, 49, -1, -1, 52,
3055 53, -1, 55, 56, -1, -1, -1, -1, -1, -1,
3056 63, 64, -1, -1, -1, -1, -1, 70, -1, -1,
3057 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3058 -1, -1, -1, -1, -1, -1, -1, 90, 91, -1,
3059 -1, -1, -1, -1, -1, -1, 99, -1, -1, -1,
3060 -1, -1, -1, -1, -1, -1, -1, -1, -1, 112,
3061 -1, -1, -1, -1, 117, 118, -1, -1, -1, 122,
3062 -1, 124, -1, 126, -1, 128, 3, 4, 5, 6,
3063 -1, 8, 9, 10, 11, 12, 13, 14, 15, 16,
3064 -1, 18, -1, 20, 21, 22, 23, 24, 25, 26,
3065 27, -1, 29, 30, -1, 32, -1, -1, -1, 36,
3066 37, 38, 39, -1, 41, 42, 43, -1, 45, 46,
3067 47, 48, 49, -1, -1, 52, 53, -1, 55, 56,
3068 -1, -1, -1, -1, -1, -1, 63, 64, -1, 66,
3069 -1, -1, -1, 70, -1, -1, -1, -1, -1, -1,
3070 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3071 -1, -1, -1, 90, 91, -1, -1, -1, -1, -1,
3072 -1, -1, 99, -1, -1, -1, -1, -1, -1, -1,
3073 -1, -1, -1, -1, -1, 112, -1, -1, -1, -1,
3074 117, 118, -1, -1, -1, 122, -1, 124, -1, 126,
3075 -1, 128, 3, 4, 5, 6, -1, 8, 9, 10,
3076 11, 12, 13, 14, 15, 16, -1, -1, -1, 20,
3077 21, 22, 23, 24, 25, 26, 27, -1, 29, 30,
3078 -1, 32, -1, -1, -1, 36, 37, 38, 39, -1,
3079 41, 42, 43, -1, 45, 46, 47, 48, 49, -1,
3080 -1, 52, 53, -1, 55, 56, -1, -1, -1, -1,
3081 -1, -1, 63, 64, -1, 66, -1, -1, -1, 70,
3082 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3083 -1, -1, -1, -1, -1, -1, -1, -1, -1, 90,
3084 91, -1, -1, -1, -1, -1, -1, -1, 99, -1,
3085 3, -1, 5, 6, -1, 8, 9, 10, 11, 12,
3086 -1, 112, -1, -1, -1, -1, 117, 118, -1, -1,
3087 -1, 122, 25, 124, 27, 126, 29, 128, -1, 32,
3088 -1, -1, -1, 36, -1, -1, -1, -1, -1, -1,
3089 43, -1, 45, 46, -1, -1, -1, -1, -1, -1,
3090 53, -1, 55, 56, -1, -1, -1, -1, -1, -1,
3091 63, -1, -1, -1, -1, -1, -1, 70, -1, -1,
3092 3, -1, 5, 6, -1, 8, 9, 10, 11, 12,
3093 -1, -1, -1, -1, -1, -1, -1, 90, 91, -1,
3094 -1, -1, 25, -1, 27, -1, 29, -1, -1, -1,
3095 -1, -1, -1, 36, -1, -1, -1, -1, -1, 112,
3096 43, -1, 45, -1, 117, 118, -1, -1, -1, 122,
3097 53, 124, 55, 56, -1, 128, -1, -1, -1, -1,
3098 63, -1, -1, -1, -1, -1, -1, 70, -1, -1,
3099 3, -1, 5, 6, -1, 8, 9, 10, 11, 12,
3100 -1, -1, -1, -1, -1, -1, -1, 90, 91, -1,
3101 -1, -1, 25, -1, 27, -1, 29, -1, -1, -1,
3102 -1, -1, -1, -1, -1, -1, -1, -1, -1, 112,
3103 -1, -1, 45, -1, 117, 118, -1, -1, -1, 122,
3104 53, 124, 55, 56, -1, 128, -1, -1, -1, -1,
3105 -1, -1, 40, -1, -1, -1, -1, 70, -1, -1,
3106 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3107 -1, -1, -1, -1, -1, -1, -1, 90, 91, 67,
3108 68, 69, -1, 71, 72, 73, 74, 75, 76, 77,
3109 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
3110 88, -1, 90, 91, 92, -1, 94, 95, 96, 122,
3111 -1, 124, -1, -1, 102, 128, 104, -1, 106, 107,
3112 108, 109, 110, 40, 112, 113, 114, 115, 116, -1,
3113 -1, -1, -1, -1, 122, -1, 124, -1, -1, 127,
3114 -1, -1, -1, -1, -1, 133, -1, -1, -1, -1,
3115 67, 68, 69, -1, 71, 72, 73, 74, 75, 76,
3116 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
3117 87, 88, -1, 90, 91, 92, -1, 94, 95, 96,
3118 -1, -1, -1, -1, -1, 102, 40, 104, -1, 106,
3119 107, 108, 109, 110, -1, 112, 113, 114, 115, 116,
3120 -1, -1, -1, -1, -1, 122, -1, 124, -1, -1,
3121 127, -1, -1, 67, 68, 69, 133, 71, 72, 73,
3122 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
3123 84, 85, 86, 87, 88, -1, 90, 91, 92, -1,
3124 94, 95, 96, -1, -1, -1, -1, -1, 102, 40,
3125 104, -1, 106, 107, 108, 109, 110, -1, 112, 113,
3126 114, 115, 116, -1, -1, -1, -1, -1, 122, -1,
3127 124, -1, -1, 127, -1, -1, 67, 68, 69, 133,
3128 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
3129 81, 82, 83, 84, 85, 86, 87, 88, -1, 90,
3130 91, 92, -1, 94, 95, 96, -1, -1, -1, -1,
3131 40, 102, -1, 104, 105, 106, 107, 108, 109, 110,
3132 -1, 112, 113, 114, 115, 116, -1, -1, -1, -1,
3133 -1, 122, -1, 124, -1, -1, 127, 67, 68, 69,
3134 -1, 71, 72, 73, 74, 75, 76, 77, 78, 79,
3135 80, 81, 82, 83, 84, 85, 86, 87, 88, -1,
3136 90, 91, 92, -1, 94, 95, 96, -1, -1, -1,
3137 -1, 40, 102, -1, 104, -1, 106, 107, 108, 109,
3138 110, -1, 112, 113, 114, 115, 116, -1, -1, -1,
3139 -1, -1, 122, -1, 124, 125, -1, 127, 67, 68,
3140 69, -1, 71, 72, 73, 74, 75, 76, 77, 78,
3141 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
3142 -1, 90, 91, 92, -1, 94, 95, 96, -1, -1,
3143 -1, -1, 40, 102, -1, 104, 105, 106, 107, 108,
3144 109, 110, -1, 112, 113, 114, 115, 116, -1, -1,
3145 -1, -1, -1, 122, -1, 124, -1, -1, 127, 67,
3146 68, 69, -1, 71, 72, 73, 74, 75, 76, 77,
3147 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
3148 88, -1, 90, 91, 92, -1, 94, 95, 96, -1,
3149 -1, -1, -1, 40, 102, -1, 104, -1, 106, 107,
3150 108, 109, 110, -1, 112, 113, 114, 115, 116, -1,
3151 -1, -1, -1, -1, 122, -1, 124, -1, -1, 127,
3152 67, 68, 69, -1, 71, 72, 73, 74, 75, 76,
3153 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3154 -1, -1, -1, 90, 91, 92, -1, 94, 95, 96,
3155 -1, -1, -1, -1, 40, -1, -1, -1, -1, 106,
3156 107, 108, 109, 110, -1, 112, 113, 114, 115, 116,
3157 -1, -1, -1, -1, -1, 122, -1, 124, -1, -1,
3158 127, 67, 68, 69, -1, 71, 72, 73, 74, 75,
3159 76, -1, -1, -1, -1, -1, -1, -1, -1, -1,
3160 -1, -1, -1, -1, 90, 91, 92, -1, 94, 95,
3161 96, -1, -1, -1, -1, 40, -1, -1, -1, -1,
3162 -1, 107, 108, 109, 110, -1, 112, 113, 114, 115,
3163 116, -1, -1, -1, -1, -1, 122, -1, 124, -1,
3164 -1, 127, 67, 68, 69, -1, 71, 72, 73, 74,
3165 75, 76, -1, -1, -1, -1, -1, -1, -1, -1,
3166 -1, -1, -1, -1, -1, 90, 91, 92, -1, 94,
3167 95, 96, -1, -1, -1, -1, 40, -1, -1, -1,
3168 -1, -1, -1, 108, 109, 110, -1, 112, 113, 114,
3169 115, 116, -1, -1, -1, -1, -1, 122, -1, 124,
3170 -1, -1, 127, 67, 68, 69, -1, 71, 72, 73,
3171 74, 75, 76, -1, -1, -1, -1, -1, -1, -1,
3172 -1, -1, -1, -1, -1, -1, 90, 91, 92, -1,
3173 94, 95, 96, -1, -1, -1, -1, 40, -1, -1,
3174 -1, -1, -1, -1, 108, 109, 110, -1, 112, 113,
3175 114, 115, 116, -1, -1, -1, -1, -1, 122, -1,
3176 124, -1, -1, 127, 67, 68, 69, -1, 71, 72,
3177 73, 74, 75, 76, -1, -1, -1, -1, -1, -1,
3178 -1, -1, -1, -1, -1, -1, -1, 90, 91, 92,
3179 -1, 94, 95, 96, -1, -1, -1, -1, -1, -1,
3180 -1, -1, -1, -1, -1, -1, 109, 110, -1, 112,
3181 113, 114, 115, 116, -1, -1, -1, -1, -1, 122,
3182 -1, 124, -1, -1, 127
3185 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
3186 symbol of state STATE-NUM. */
3187 static const yytype_uint8 yystos[] =
3189 0, 3, 4, 5, 6, 8, 9, 10, 11, 12,
3190 13, 14, 15, 16, 19, 20, 21, 22, 23, 24,
3191 25, 26, 27, 29, 36, 38, 39, 41, 43, 45,
3192 47, 48, 49, 52, 53, 55, 56, 63, 64, 70,
3193 90, 91, 99, 112, 117, 118, 122, 124, 126, 128,
3194 135, 136, 137, 138, 144, 147, 148, 154, 158, 159,
3195 160, 161, 163, 171, 179, 182, 185, 188, 189, 190,
3196 191, 195, 197, 206, 214, 217, 230, 231, 232, 235,
3197 236, 237, 238, 241, 243, 89, 50, 122, 122, 164,
3198 122, 3, 19, 126, 183, 184, 18, 3, 237, 3,
3199 216, 237, 122, 184, 220, 122, 126, 122, 127, 237,
3200 122, 234, 237, 239, 240, 237, 237, 237, 237, 237,
3201 235, 226, 227, 228, 234, 30, 32, 37, 42, 46,
3202 66, 99, 132, 143, 144, 145, 148, 150, 165, 166,
3203 181, 189, 233, 242, 3, 0, 138, 126, 3, 46,
3204 150, 156, 157, 236, 27, 31, 32, 44, 46, 205,
3205 191, 100, 40, 67, 68, 69, 71, 72, 73, 74,
3206 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
3207 85, 86, 87, 88, 90, 91, 92, 94, 95, 96,
3208 102, 104, 106, 107, 108, 109, 110, 112, 113, 114,
3209 115, 116, 122, 124, 127, 3, 122, 162, 145, 146,
3210 172, 187, 126, 127, 3, 229, 122, 235, 127, 237,
3211 180, 226, 3, 155, 105, 132, 100, 133, 125, 100,
3212 234, 3, 3, 151, 152, 235, 235, 151, 3, 132,
3213 145, 126, 18, 136, 3, 99, 68, 35, 51, 213,
3214 3, 3, 3, 237, 237, 237, 237, 237, 237, 237,
3215 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
3216 237, 237, 237, 237, 237, 237, 3, 237, 237, 237,
3217 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
3218 237, 237, 226, 237, 3, 122, 128, 235, 99, 14,
3219 237, 99, 139, 140, 141, 147, 148, 195, 197, 206,
3220 214, 186, 183, 122, 225, 3, 93, 210, 211, 212,
3221 133, 3, 115, 133, 142, 143, 133, 235, 234, 234,
3222 105, 224, 100, 143, 3, 132, 224, 235, 235, 3,
3223 54, 192, 54, 193, 207, 105, 133, 125, 89, 237,
3224 3, 133, 122, 133, 132, 141, 126, 139, 226, 102,
3225 105, 208, 212, 133, 100, 146, 132, 133, 105, 3,
3226 36, 115, 184, 219, 220, 221, 223, 102, 149, 152,
3227 132, 102, 99, 133, 122, 221, 17, 194, 221, 222,
3228 126, 224, 237, 3, 133, 146, 235, 126, 139, 132,
3229 133, 3, 5, 8, 9, 10, 12, 45, 55, 56,
3230 209, 223, 224, 93, 212, 28, 33, 173, 175, 177,
3231 178, 146, 234, 127, 234, 3, 5, 236, 146, 210,
3232 222, 126, 100, 198, 149, 133, 34, 62, 167, 168,
3233 169, 170, 132, 208, 126, 212, 126, 122, 173, 175,
3234 65, 153, 133, 133, 196, 221, 46, 99, 189, 202,
3235 203, 204, 237, 105, 132, 169, 170, 218, 176, 3,
3236 146, 146, 224, 99, 144, 148, 189, 199, 200, 201,
3237 206, 214, 3, 27, 132, 204, 105, 142, 142, 142,
3238 224, 126, 126, 132, 201, 213, 142, 132, 132, 133,
3239 215, 199, 3, 174, 142, 132, 122, 126, 132, 210,
3243 #define yyerrok (yyerrstatus = 0)
3244 #define yyclearin (yychar = YYEMPTY)
3245 #define YYEMPTY (-2)
3248 #define YYACCEPT goto yyacceptlab
3249 #define YYABORT goto yyabortlab
3250 #define YYERROR goto yyerrorlab
3253 /* Like YYERROR except do call yyerror. This remains here temporarily
3254 to ease the transition to the new meaning of YYERROR, for GCC.
3255 Once GCC version 2 has supplanted version 1, this can go. */
3257 #define YYFAIL goto yyerrlab
3259 #define YYRECOVERING() (!!yyerrstatus)
3261 #define YYBACKUP(Token, Value) \
3263 if (yychar == YYEMPTY && yylen == 1) \
3267 yytoken = YYTRANSLATE (yychar); \
3273 yyerror (YY_("syntax error: cannot back up")); \
3280 #define YYERRCODE 256
3283 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
3284 If N is 0, then set CURRENT to the empty location which ends
3285 the previous symbol: RHS[0] (always defined). */
3287 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
3288 #ifndef YYLLOC_DEFAULT
3289 # define YYLLOC_DEFAULT(Current, Rhs, N) \
3293 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
3294 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
3295 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
3296 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
3300 (Current).first_line = (Current).last_line = \
3301 YYRHSLOC (Rhs, 0).last_line; \
3302 (Current).first_column = (Current).last_column = \
3303 YYRHSLOC (Rhs, 0).last_column; \
3309 /* YY_LOCATION_PRINT -- Print the location on the stream.
3310 This macro was not mandated originally: define only if we know
3311 we won't break user code: when these are the locations we know. */
3313 #ifndef YY_LOCATION_PRINT
3314 # if YYLTYPE_IS_TRIVIAL
3315 # define YY_LOCATION_PRINT(File, Loc) \
3316 fprintf (File, "%d.%d-%d.%d", \
3317 (Loc).first_line, (Loc).first_column, \
3318 (Loc).last_line, (Loc).last_column)
3320 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
3325 /* YYLEX -- calling `yylex' with the right arguments. */
3328 # define YYLEX yylex (YYLEX_PARAM)
3330 # define YYLEX yylex ()
3333 /* Enable debugging if requested. */
3337 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
3338 # define YYFPRINTF fprintf
3341 # define YYDPRINTF(Args) \
3347 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
3351 YYFPRINTF (stderr, "%s ", Title); \
3352 yy_symbol_print (stderr, \
3354 YYFPRINTF (stderr, "\n"); \
3359 /*--------------------------------.
3360 | Print this symbol on YYOUTPUT. |
3361 `--------------------------------*/
3364 #if (defined __STDC__ || defined __C99__FUNC__ \
3365 || defined __cplusplus || defined _MSC_VER)
3367 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3370 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
3373 YYSTYPE const * const yyvaluep;
3379 if (yytype < YYNTOKENS)
3380 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
3392 /*--------------------------------.
3393 | Print this symbol on YYOUTPUT. |
3394 `--------------------------------*/
3396 #if (defined __STDC__ || defined __C99__FUNC__ \
3397 || defined __cplusplus || defined _MSC_VER)
3399 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3402 yy_symbol_print (yyoutput, yytype, yyvaluep)
3405 YYSTYPE const * const yyvaluep;
3408 if (yytype < YYNTOKENS)
3409 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
3411 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
3413 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
3414 YYFPRINTF (yyoutput, ")");
3417 /*------------------------------------------------------------------.
3418 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3420 `------------------------------------------------------------------*/
3422 #if (defined __STDC__ || defined __C99__FUNC__ \
3423 || defined __cplusplus || defined _MSC_VER)
3425 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
3428 yy_stack_print (yybottom, yytop)
3429 yytype_int16 *yybottom;
3430 yytype_int16 *yytop;
3433 YYFPRINTF (stderr, "Stack now");
3434 for (; yybottom <= yytop; yybottom++)
3436 int yybot = *yybottom;
3437 YYFPRINTF (stderr, " %d", yybot);
3439 YYFPRINTF (stderr, "\n");
3442 # define YY_STACK_PRINT(Bottom, Top) \
3445 yy_stack_print ((Bottom), (Top)); \
3449 /*------------------------------------------------.
3450 | Report that the YYRULE is going to be reduced. |
3451 `------------------------------------------------*/
3453 #if (defined __STDC__ || defined __C99__FUNC__ \
3454 || defined __cplusplus || defined _MSC_VER)
3456 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3459 yy_reduce_print (yyvsp, yyrule)
3464 int yynrhs = yyr2[yyrule];
3466 unsigned long int yylno = yyrline[yyrule];
3467 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3469 /* The symbols being reduced. */
3470 for (yyi = 0; yyi < yynrhs; yyi++)
3472 YYFPRINTF (stderr, " $%d = ", yyi + 1);
3473 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3474 &(yyvsp[(yyi + 1) - (yynrhs)])
3476 YYFPRINTF (stderr, "\n");
3480 # define YY_REDUCE_PRINT(Rule) \
3483 yy_reduce_print (yyvsp, Rule); \
3486 /* Nonzero means print parse trace. It is left uninitialized so that
3487 multiple parsers can coexist. */
3489 #else /* !YYDEBUG */
3490 # define YYDPRINTF(Args)
3491 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3492 # define YY_STACK_PRINT(Bottom, Top)
3493 # define YY_REDUCE_PRINT(Rule)
3494 #endif /* !YYDEBUG */
3497 /* YYINITDEPTH -- initial size of the parser's stacks. */
3499 # define YYINITDEPTH 200
3502 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3503 if the built-in stack extension method is used).
3505 Do not make this value too large; the results are undefined if
3506 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3507 evaluated with infinite-precision integer arithmetic. */
3510 # define YYMAXDEPTH 10000
3518 # if defined __GLIBC__ && defined _STRING_H
3519 # define yystrlen strlen
3521 /* Return the length of YYSTR. */
3522 #if (defined __STDC__ || defined __C99__FUNC__ \
3523 || defined __cplusplus || defined _MSC_VER)
3525 yystrlen (const char *yystr)
3533 for (yylen = 0; yystr[yylen]; yylen++)
3541 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3542 # define yystpcpy stpcpy
3544 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3546 #if (defined __STDC__ || defined __C99__FUNC__ \
3547 || defined __cplusplus || defined _MSC_VER)
3549 yystpcpy (char *yydest, const char *yysrc)
3552 yystpcpy (yydest, yysrc)
3558 const char *yys = yysrc;
3560 while ((*yyd++ = *yys++) != '\0')
3569 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3570 quotes and backslashes, so that it's suitable for yyerror. The
3571 heuristic is that double-quoting is unnecessary unless the string
3572 contains an apostrophe, a comma, or backslash (other than
3573 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3574 null, do not copy; instead, return the length of what the result
3577 yytnamerr (char *yyres, const char *yystr)
3582 char const *yyp = yystr;
3589 goto do_not_strip_quotes;
3593 goto do_not_strip_quotes;
3606 do_not_strip_quotes: ;
3610 return yystrlen (yystr);
3612 return yystpcpy (yyres, yystr) - yyres;
3616 /* Copy into YYRESULT an error message about the unexpected token
3617 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3618 including the terminating null byte. If YYRESULT is null, do not
3619 copy anything; just return the number of bytes that would be
3620 copied. As a special case, return 0 if an ordinary "syntax error"
3621 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3622 size calculation. */
3624 yysyntax_error (char *yyresult, int yystate, int yychar)
3626 int yyn = yypact[yystate];
3628 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3632 int yytype = YYTRANSLATE (yychar);
3633 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3634 YYSIZE_T yysize = yysize0;
3636 int yysize_overflow = 0;
3637 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3638 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3642 /* This is so xgettext sees the translatable formats that are
3643 constructed on the fly. */
3644 YY_("syntax error, unexpected %s");
3645 YY_("syntax error, unexpected %s, expecting %s");
3646 YY_("syntax error, unexpected %s, expecting %s or %s");
3647 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3648 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3652 static char const yyunexpected[] = "syntax error, unexpected %s";
3653 static char const yyexpecting[] = ", expecting %s";
3654 static char const yyor[] = " or %s";
3655 char yyformat[sizeof yyunexpected
3656 + sizeof yyexpecting - 1
3657 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3658 * (sizeof yyor - 1))];
3659 char const *yyprefix = yyexpecting;
3661 /* Start YYX at -YYN if negative to avoid negative indexes in
3663 int yyxbegin = yyn < 0 ? -yyn : 0;
3665 /* Stay within bounds of both yycheck and yytname. */
3666 int yychecklim = YYLAST - yyn + 1;
3667 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3670 yyarg[0] = yytname[yytype];
3671 yyfmt = yystpcpy (yyformat, yyunexpected);
3673 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3674 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3676 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3680 yyformat[sizeof yyunexpected - 1] = '\0';
3683 yyarg[yycount++] = yytname[yyx];
3684 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3685 yysize_overflow |= (yysize1 < yysize);
3687 yyfmt = yystpcpy (yyfmt, yyprefix);
3691 yyf = YY_(yyformat);
3692 yysize1 = yysize + yystrlen (yyf);
3693 yysize_overflow |= (yysize1 < yysize);
3696 if (yysize_overflow)
3697 return YYSIZE_MAXIMUM;
3701 /* Avoid sprintf, as that infringes on the user's name space.
3702 Don't have undefined behavior even if the translation
3703 produced a string with the wrong number of "%s"s. */
3704 char *yyp = yyresult;
3706 while ((*yyp = *yyf) != '\0')
3708 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3710 yyp += yytnamerr (yyp, yyarg[yyi++]);
3723 #endif /* YYERROR_VERBOSE */
3726 /*-----------------------------------------------.
3727 | Release the memory associated to this symbol. |
3728 `-----------------------------------------------*/
3731 #if (defined __STDC__ || defined __C99__FUNC__ \
3732 || defined __cplusplus || defined _MSC_VER)
3734 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
3737 yydestruct (yymsg, yytype, yyvaluep)
3747 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
3757 /* Prevent warnings from -Wmissing-prototypes. */
3758 #ifdef YYPARSE_PARAM
3759 #if defined __STDC__ || defined __cplusplus
3760 int yyparse (void *YYPARSE_PARAM);
3764 #else /* ! YYPARSE_PARAM */
3765 #if defined __STDC__ || defined __cplusplus
3770 #endif /* ! YYPARSE_PARAM */
3773 /* The lookahead symbol. */
3776 /* The semantic value of the lookahead symbol. */
3779 /* Number of syntax errors so far. */
3784 /*-------------------------.
3785 | yyparse or yypush_parse. |
3786 `-------------------------*/
3788 #ifdef YYPARSE_PARAM
3789 #if (defined __STDC__ || defined __C99__FUNC__ \
3790 || defined __cplusplus || defined _MSC_VER)
3792 yyparse (void *YYPARSE_PARAM)
3795 yyparse (YYPARSE_PARAM)
3796 void *YYPARSE_PARAM;
3798 #else /* ! YYPARSE_PARAM */
3799 #if (defined __STDC__ || defined __C99__FUNC__ \
3800 || defined __cplusplus || defined _MSC_VER)
3813 /* Number of tokens to shift before error messages enabled. */
3816 /* The stacks and their tools:
3817 `yyss': related to states.
3818 `yyvs': related to semantic values.
3820 Refer to the stacks thru separate pointers, to allow yyoverflow
3821 to reallocate them elsewhere. */
3823 /* The state stack. */
3824 yytype_int16 yyssa[YYINITDEPTH];
3826 yytype_int16 *yyssp;
3828 /* The semantic value stack. */
3829 YYSTYPE yyvsa[YYINITDEPTH];
3833 YYSIZE_T yystacksize;
3837 /* Lookahead token as an internal (translated) token number. */
3839 /* The variables used to return semantic value and location from the
3844 /* Buffer for error messages, and its allocated size. */
3846 char *yymsg = yymsgbuf;
3847 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
3850 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
3852 /* The number of symbols on the RHS of the reduced rule.
3853 Keep to zero when no symbol should be popped. */
3859 yystacksize = YYINITDEPTH;
3861 YYDPRINTF ((stderr, "Starting parse\n"));
3866 yychar = YYEMPTY; /* Cause a token to be read. */
3868 /* Initialize stack pointers.
3869 Waste one element of value and location stack
3870 so that they stay on the same level as the state stack.
3871 The wasted elements are never initialized. */
3877 /*------------------------------------------------------------.
3878 | yynewstate -- Push a new state, which is found in yystate. |
3879 `------------------------------------------------------------*/
3881 /* In all cases, when you get here, the value and location stacks
3882 have just been pushed. So pushing a state here evens the stacks. */
3888 if (yyss + yystacksize - 1 <= yyssp)
3890 /* Get the current used size of the three stacks, in elements. */
3891 YYSIZE_T yysize = yyssp - yyss + 1;
3895 /* Give user a chance to reallocate the stack. Use copies of
3896 these so that the &'s don't force the real ones into
3898 YYSTYPE *yyvs1 = yyvs;
3899 yytype_int16 *yyss1 = yyss;
3901 /* Each stack pointer address is followed by the size of the
3902 data in use in that stack, in bytes. This used to be a
3903 conditional around just the two extra args, but that might
3904 be undefined if yyoverflow is a macro. */
3905 yyoverflow (YY_("memory exhausted"),
3906 &yyss1, yysize * sizeof (*yyssp),
3907 &yyvs1, yysize * sizeof (*yyvsp),
3913 #else /* no yyoverflow */
3914 # ifndef YYSTACK_RELOCATE
3915 goto yyexhaustedlab;
3917 /* Extend the stack our own way. */
3918 if (YYMAXDEPTH <= yystacksize)
3919 goto yyexhaustedlab;
3921 if (YYMAXDEPTH < yystacksize)
3922 yystacksize = YYMAXDEPTH;
3925 yytype_int16 *yyss1 = yyss;
3926 union yyalloc *yyptr =
3927 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
3929 goto yyexhaustedlab;
3930 YYSTACK_RELOCATE (yyss_alloc, yyss);
3931 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
3932 # undef YYSTACK_RELOCATE
3934 YYSTACK_FREE (yyss1);
3937 #endif /* no yyoverflow */
3939 yyssp = yyss + yysize - 1;
3940 yyvsp = yyvs + yysize - 1;
3942 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
3943 (unsigned long int) yystacksize));
3945 if (yyss + yystacksize - 1 <= yyssp)
3949 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3951 if (yystate == YYFINAL)
3961 /* Do appropriate processing given the current state. Read a
3962 lookahead token if we need one and don't already have one. */
3964 /* First try to decide what to do without reference to lookahead token. */
3965 yyn = yypact[yystate];
3966 if (yyn == YYPACT_NINF)
3969 /* Not known => get a lookahead token if don't already have one. */
3971 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
3972 if (yychar == YYEMPTY)
3974 YYDPRINTF ((stderr, "Reading a token: "));
3978 if (yychar <= YYEOF)
3980 yychar = yytoken = YYEOF;
3981 YYDPRINTF ((stderr, "Now at end of input.\n"));
3985 yytoken = YYTRANSLATE (yychar);
3986 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3989 /* If the proper action on seeing token YYTOKEN is to reduce or to
3990 detect an error, take that action. */
3992 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3997 if (yyn == 0 || yyn == YYTABLE_NINF)
4003 /* Count tokens shifted since error; after three, turn off error
4008 /* Shift the lookahead token. */
4009 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
4011 /* Discard the shifted token. */
4020 /*-----------------------------------------------------------.
4021 | yydefault -- do the default action for the current state. |
4022 `-----------------------------------------------------------*/
4024 yyn = yydefact[yystate];
4030 /*-----------------------------.
4031 | yyreduce -- Do a reduction. |
4032 `-----------------------------*/
4034 /* yyn is the number of a rule to reduce with. */
4037 /* If YYLEN is nonzero, implement the default value of the action:
4040 Otherwise, the following line sets YYVAL to garbage.
4041 This behavior is undocumented and Bison
4042 users should not rely upon it. Assigning to YYVAL
4043 unconditionally makes the parser a bit smaller, and it avoids a
4044 GCC warning that YYVAL may be used uninitialized. */
4045 yyval = yyvsp[1-yylen];
4048 YY_REDUCE_PRINT (yyn);
4055 /* Line 1464 of skeleton.m4 */
4056 #line 1829 "parser.y"
4057 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4066 /* Line 1464 of skeleton.m4 */
4067 #line 1830 "parser.y"
4068 {(yyval.code)=code_new();}
4077 /* Line 1464 of skeleton.m4 */
4078 #line 1832 "parser.y"
4079 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
4088 /* Line 1464 of skeleton.m4 */
4089 #line 1833 "parser.y"
4090 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4099 /* Line 1464 of skeleton.m4 */
4100 #line 1847 "parser.y"
4101 {(yyval.code)=(yyvsp[(2) - (3)].code);}
4110 /* Line 1464 of skeleton.m4 */
4111 #line 1848 "parser.y"
4121 /* Line 1464 of skeleton.m4 */
4122 #line 1851 "parser.y"
4132 /* Line 1464 of skeleton.m4 */
4133 #line 1858 "parser.y"
4134 {(yyval.code)=(yyvsp[(3) - (4)].code);}
4143 /* Line 1464 of skeleton.m4 */
4144 #line 1860 "parser.y"
4145 {/*TODO*/(yyval.code)=0;}
4154 /* Line 1464 of skeleton.m4 */
4155 #line 1864 "parser.y"
4156 {(yyval.code)=(yyvsp[(1) - (2)].code);}
4165 /* Line 1464 of skeleton.m4 */
4166 #line 1865 "parser.y"
4167 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4176 /* Line 1464 of skeleton.m4 */
4177 #line 1869 "parser.y"
4179 code_t**cc = &global->init->method->body->code;
4180 *cc = code_append(*cc, (yyvsp[(1) - (1)].code));
4190 /* Line 1464 of skeleton.m4 */
4191 #line 1880 "parser.y"
4192 {(yyval.value)=(yyvsp[(2) - (2)].value);}
4201 /* Line 1464 of skeleton.m4 */
4202 #line 1881 "parser.y"
4203 {(yyval.value).c=abc_pushundefined(0);
4204 (yyval.value).t=TYPE_ANY;
4214 /* Line 1464 of skeleton.m4 */
4215 #line 1885 "parser.y"
4216 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4225 /* Line 1464 of skeleton.m4 */
4226 #line 1886 "parser.y"
4227 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4236 /* Line 1464 of skeleton.m4 */
4237 #line 1888 "parser.y"
4238 {(yyval.code) = (yyvsp[(1) - (1)].code);}
4247 /* Line 1464 of skeleton.m4 */
4248 #line 1889 "parser.y"
4249 {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));}
4258 /* Line 1464 of skeleton.m4 */
4259 #line 1892 "parser.y"
4262 if(variable_exists((yyvsp[(1) - (3)].id)))
4263 syntaxerror("Variable %s already defined", (yyvsp[(1) - (3)].id));
4265 new_variable((yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].classinfo), 1);
4268 if(!is_subtype_of((yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo))) {
4269 syntaxerror("Can't convert %s to %s", (yyvsp[(3) - (3)].value).t->name,
4270 (yyvsp[(2) - (3)].classinfo)->name);
4272 int index = new_variable((yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].classinfo), 1);
4274 if((yyvsp[(2) - (3)].classinfo)) {
4275 if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) {
4276 (yyval.code) = (yyvsp[(3) - (3)].value).c;
4277 (yyval.code) = converttype((yyval.code), (yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo));
4278 (yyval.code) = abc_setlocal((yyval.code), index);
4280 code_free((yyvsp[(3) - (3)].value).c);
4281 (yyval.code) = defaultvalue(0, (yyvsp[(2) - (3)].classinfo));
4282 (yyval.code) = abc_setlocal((yyval.code), index);
4285 if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) {
4286 (yyval.code) = (yyvsp[(3) - (3)].value).c;
4287 (yyval.code) = abc_coerce_a((yyval.code));
4288 (yyval.code) = abc_setlocal((yyval.code), index);
4290 code_free((yyvsp[(3) - (3)].value).c);
4291 (yyval.code) = code_new();
4295 /* that's the default for a local register, anyway
4297 state->method->initcode = abc_pushundefined(state->method->initcode);
4298 state->method->initcode = abc_setlocal(state->method->initcode, index);
4300 //printf("variable %s -> %d (%s)\n", $2->text, index, $4.t?$4.t->name:"");
4310 /* Line 1464 of skeleton.m4 */
4311 #line 1937 "parser.y"
4312 {(yyval.code) = code_new();}
4321 /* Line 1464 of skeleton.m4 */
4322 #line 1938 "parser.y"
4323 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4332 /* Line 1464 of skeleton.m4 */
4333 #line 1941 "parser.y"
4334 {PASS12 new_state();}
4343 /* Line 1464 of skeleton.m4 */
4344 #line 1941 "parser.y"
4347 (yyval.code) = code_new();
4348 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (7)].value).c);
4349 code_t*myjmp,*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4351 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].code));
4352 if((yyvsp[(7) - (7)].code)) {
4353 myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4355 myif->branch = (yyval.code) = abc_nop((yyval.code));
4356 if((yyvsp[(7) - (7)].code)) {
4357 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (7)].code));
4358 myjmp->branch = (yyval.code) = abc_nop((yyval.code));
4360 (yyval.code) = var_block((yyval.code));
4371 /* Line 1464 of skeleton.m4 */
4372 #line 1960 "parser.y"
4373 {(yyval.code)=code_new();}
4382 /* Line 1464 of skeleton.m4 */
4383 #line 1967 "parser.y"
4386 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1);
4396 /* Line 1464 of skeleton.m4 */
4397 #line 1971 "parser.y"
4400 (yyval.id)=(yyvsp[(1) - (1)].id);
4410 /* Line 1464 of skeleton.m4 */
4411 #line 1976 "parser.y"
4412 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (2)].id);(yyval.for_start).each=0;}
4421 /* Line 1464 of skeleton.m4 */
4422 #line 1977 "parser.y"
4423 {PASS12 new_state();(yyval.for_start).name=(yyvsp[(1) - (3)].id);(yyval.for_start).each=1;}
4432 /* Line 1464 of skeleton.m4 */
4433 #line 1979 "parser.y"
4435 if((yyvsp[(1) - (8)].for_start).each) syntaxerror("invalid syntax: ; not allowed in for each statement");
4436 (yyval.code) = code_new();
4437 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (8)].code));
4438 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4439 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (8)].value).c);
4440 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4441 (yyval.code) = code_append((yyval.code), (yyvsp[(8) - (8)].code));
4442 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4443 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (8)].code));
4444 (yyval.code) = abc_jump((yyval.code), loopstart);
4445 code_t*out = (yyval.code) = abc_nop((yyval.code));
4446 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, out);
4447 continuejumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, cont);
4450 (yyval.code) = var_block((yyval.code));
4461 /* Line 1464 of skeleton.m4 */
4462 #line 1999 "parser.y"
4464 variable_t*var = find_variable(state, (yyvsp[(2) - (6)].id));
4465 char*tmp1name = concat2((yyvsp[(2) - (6)].id), "__tmp1__");
4466 int it = new_variable(tmp1name, TYPE_INT, 0);
4467 char*tmp2name = concat2((yyvsp[(2) - (6)].id), "__array__");
4468 int array = new_variable(tmp1name, 0, 0);
4470 (yyval.code) = code_new();
4471 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
4472 (yyval.code) = abc_coerce_a((yyval.code));
4473 (yyval.code) = abc_setlocal((yyval.code), array);
4474 (yyval.code) = abc_pushbyte((yyval.code), 0);
4475 (yyval.code) = abc_setlocal((yyval.code), it);
4477 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4479 (yyval.code) = abc_hasnext2((yyval.code), array, it);
4480 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4481 (yyval.code) = abc_getlocal((yyval.code), array);
4482 (yyval.code) = abc_getlocal((yyval.code), it);
4483 if(!(yyvsp[(1) - (6)].for_start).each)
4484 (yyval.code) = abc_nextname((yyval.code));
4486 (yyval.code) = abc_nextvalue((yyval.code));
4487 (yyval.code) = converttype((yyval.code), 0, var->type);
4488 (yyval.code) = abc_setlocal((yyval.code), var->index);
4490 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
4491 (yyval.code) = abc_jump((yyval.code), loopstart);
4493 code_t*out = (yyval.code) = abc_nop((yyval.code));
4494 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, out);
4495 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, loopstart);
4499 (yyval.code) = var_block((yyval.code));
4514 /* Line 1464 of skeleton.m4 */
4515 #line 2043 "parser.y"
4516 {PASS12 new_state();}
4525 /* Line 1464 of skeleton.m4 */
4526 #line 2043 "parser.y"
4529 (yyval.code) = code_new();
4531 code_t*myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4532 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4533 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
4534 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4535 myjmp->branch = cont;
4536 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
4537 (yyval.code) = abc_iftrue((yyval.code), loopstart);
4538 code_t*out = (yyval.code) = abc_nop((yyval.code));
4539 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].id), out);
4540 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].id), cont);
4542 (yyval.code) = var_block((yyval.code));
4553 /* Line 1464 of skeleton.m4 */
4554 #line 2062 "parser.y"
4555 {PASS12 new_state();}
4564 /* Line 1464 of skeleton.m4 */
4565 #line 2062 "parser.y"
4567 (yyval.code) = code_new();
4568 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4569 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (7)].code));
4570 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4571 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].value).c);
4572 (yyval.code) = abc_iftrue((yyval.code), loopstart);
4573 code_t*out = (yyval.code) = abc_nop((yyval.code));
4574 breakjumpsto((yyval.code), (yyvsp[(1) - (7)].id), out);
4575 continuejumpsto((yyval.code), (yyvsp[(1) - (7)].id), cont);
4577 (yyval.code) = var_block((yyval.code));
4588 /* Line 1464 of skeleton.m4 */
4589 #line 2077 "parser.y"
4591 (yyval.code) = abc___break__(0, "");
4601 /* Line 1464 of skeleton.m4 */
4602 #line 2080 "parser.y"
4604 (yyval.code) = abc___break__(0, (yyvsp[(2) - (2)].id));
4614 /* Line 1464 of skeleton.m4 */
4615 #line 2083 "parser.y"
4617 (yyval.code) = abc___continue__(0, "");
4627 /* Line 1464 of skeleton.m4 */
4628 #line 2086 "parser.y"
4630 (yyval.code) = abc___continue__(0, (yyvsp[(2) - (2)].id));
4640 /* Line 1464 of skeleton.m4 */
4641 #line 2090 "parser.y"
4651 /* Line 1464 of skeleton.m4 */
4652 #line 2091 "parser.y"
4653 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4662 /* Line 1464 of skeleton.m4 */
4663 #line 2092 "parser.y"
4664 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4673 /* Line 1464 of skeleton.m4 */
4674 #line 2093 "parser.y"
4675 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
4684 /* Line 1464 of skeleton.m4 */
4685 #line 2094 "parser.y"
4686 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4695 /* Line 1464 of skeleton.m4 */
4696 #line 2095 "parser.y"
4697 {(yyval.code)=code_append((yyval.code),(yyvsp[(2) - (2)].code));}
4706 /* Line 1464 of skeleton.m4 */
4707 #line 2097 "parser.y"
4709 (yyval.code) = abc_dup(0);
4710 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (4)].value).c);
4711 code_t*j = (yyval.code) = abc_ifne((yyval.code), 0);
4712 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (4)].code));
4713 if((yyval.code)->opcode != OPCODE___BREAK__) {
4714 (yyval.code) = abc___fallthrough__((yyval.code), "");
4716 code_t*e = (yyval.code) = abc_nop((yyval.code));
4727 /* Line 1464 of skeleton.m4 */
4728 #line 2108 "parser.y"
4730 (yyval.code) = (yyvsp[(3) - (3)].code);
4740 /* Line 1464 of skeleton.m4 */
4741 #line 2111 "parser.y"
4742 {PASS12 new_state();}
4751 /* Line 1464 of skeleton.m4 */
4752 #line 2111 "parser.y"
4754 (yyval.code)=(yyvsp[(4) - (8)].value).c;
4755 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (8)].code));
4756 code_t*out = (yyval.code) = abc_pop((yyval.code));
4757 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].id), out);
4759 code_t*c = (yyval.code),*lastblock=0;
4761 if(c->opcode == OPCODE_IFNE) {
4762 if(!c->next) syntaxerror("internal error in fallthrough handling");
4764 } else if(c->opcode == OPCODE___FALLTHROUGH__) {
4766 c->opcode = OPCODE_JUMP;
4767 c->branch = lastblock;
4769 /* fall through end of switch */
4770 c->opcode = OPCODE_NOP;
4776 (yyval.code) = var_block((yyval.code));
4787 /* Line 1464 of skeleton.m4 */
4788 #line 2140 "parser.y"
4789 {PASS12 new_state();state->exception_name=(yyvsp[(3) - (5)].id);new_variable((yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].classinfo), 0);}
4798 /* Line 1464 of skeleton.m4 */
4799 #line 2141 "parser.y"
4801 namespace_t name_ns = {ACCESS_PACKAGE, ""};
4802 multiname_t name = {QNAME, &name_ns, 0, (yyvsp[(3) - (9)].id)};
4804 NEW(abc_exception_t, e)
4805 e->exc_type = sig2mname((yyvsp[(4) - (9)].classinfo));
4806 e->var_name = multiname_clone(&name);
4807 (yyval.exception) = e;
4810 int i = find_variable_safe(state, (yyvsp[(3) - (9)].id))->index;
4811 e->target = c = abc_nop(0);
4812 c = abc_setlocal(c, i);
4813 c = code_append(c, (yyvsp[(8) - (9)].code));
4827 /* Line 1464 of skeleton.m4 */
4828 #line 2160 "parser.y"
4829 {PASS12 new_state();state->exception_name=0;}
4838 /* Line 1464 of skeleton.m4 */
4839 #line 2160 "parser.y"
4841 (yyvsp[(4) - (5)].code) = var_block((yyvsp[(4) - (5)].code));
4842 if(!(yyvsp[(4) - (5)].code)) {
4843 (yyval.exception)=0;
4845 NEW(abc_exception_t, e)
4846 e->exc_type = 0; //all exceptions
4847 e->var_name = 0; //no name
4850 e->to = code_append(e->to, (yyvsp[(4) - (5)].code));
4851 (yyval.exception) = e;
4863 /* Line 1464 of skeleton.m4 */
4864 #line 2176 "parser.y"
4865 {(yyval.catch_list).l=list_new();(yyval.catch_list).finally=0;list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));}
4874 /* Line 1464 of skeleton.m4 */
4875 #line 2177 "parser.y"
4876 {(yyval.catch_list)=(yyvsp[(1) - (2)].catch_list);list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));}
4885 /* Line 1464 of skeleton.m4 */
4886 #line 2178 "parser.y"
4887 {(yyval.catch_list)=(yyvsp[(1) - (1)].catch_list);}
4896 /* Line 1464 of skeleton.m4 */
4897 #line 2179 "parser.y"
4899 (yyval.catch_list) = (yyvsp[(1) - (2)].catch_list);
4900 (yyval.catch_list).finally = 0;
4901 if((yyvsp[(2) - (2)].exception)) {
4902 list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));
4903 (yyval.catch_list).finally = (yyvsp[(2) - (2)].exception)->to;(yyvsp[(2) - (2)].exception)->to=0;
4914 /* Line 1464 of skeleton.m4 */
4915 #line 2187 "parser.y"
4917 (yyval.catch_list).l=list_new();
4918 (yyval.catch_list).finally = 0;
4919 if((yyvsp[(1) - (1)].exception)) {
4920 list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));
4921 (yyval.catch_list).finally = (yyvsp[(1) - (1)].exception)->to;(yyvsp[(1) - (1)].exception)->to=0;
4932 /* Line 1464 of skeleton.m4 */
4933 #line 2196 "parser.y"
4934 {PASS12 new_state();}
4943 /* Line 1464 of skeleton.m4 */
4944 #line 2196 "parser.y"
4946 code_t*out = abc_nop(0);
4948 code_t*start = abc_nop(0);
4949 (yyval.code) = code_append(start, (yyvsp[(4) - (6)].code));
4950 if(!is_break_or_jump((yyvsp[(4) - (6)].code))) {
4951 (yyval.code) = abc_jump((yyval.code), out);
4953 code_t*end = (yyval.code) = abc_nop((yyval.code));
4956 if((yyvsp[(6) - (6)].catch_list).finally)
4957 tmp = new_variable("__finally__", 0, 0);
4959 abc_exception_list_t*l = (yyvsp[(6) - (6)].catch_list).l;
4962 abc_exception_t*e = l->abc_exception;
4964 (yyval.code) = code_append((yyval.code), e->target);
4965 (yyval.code) = abc_jump((yyval.code), out);
4967 parserassert((ptroff_t)(yyvsp[(6) - (6)].catch_list).finally);
4969 e->target = (yyval.code) = abc_nop((yyval.code));
4970 (yyval.code) = abc___rethrow__((yyval.code));
4978 (yyval.code) = code_append((yyval.code), out);
4980 (yyval.code) = insert_finally((yyval.code), (yyvsp[(6) - (6)].catch_list).finally, tmp);
4982 list_concat(state->method->exceptions, (yyvsp[(6) - (6)].catch_list).l);
4984 (yyval.code) = var_block((yyval.code));
4995 /* Line 1464 of skeleton.m4 */
4996 #line 2241 "parser.y"
4998 (yyval.code)=(yyvsp[(2) - (2)].value).c;
4999 (yyval.code)=abc_throw((yyval.code));
5009 /* Line 1464 of skeleton.m4 */
5010 #line 2245 "parser.y"
5012 if(!state->exception_name)
5013 syntaxerror("re-throw only possible within a catch block");
5014 variable_t*v = find_variable(state, state->exception_name);
5015 (yyval.code)=code_new();
5016 (yyval.code)=abc_getlocal((yyval.code), v->index);
5017 (yyval.code)=abc_throw((yyval.code));
5027 /* Line 1464 of skeleton.m4 */
5028 #line 2256 "parser.y"
5030 (yyval.code) = (yyvsp[(3) - (5)].value).c;
5031 (yyval.code) = abc_pushscope((yyval.code));
5032 (yyval.code) = code_append((yyval.code), (yyvsp[(5) - (5)].code));
5033 (yyval.code) = abc_popscope((yyval.code));
5043 /* Line 1464 of skeleton.m4 */
5044 #line 2266 "parser.y"
5045 {PASS12 (yyval.id)="package";}
5054 /* Line 1464 of skeleton.m4 */
5055 #line 2268 "parser.y"
5056 {PASS12 (yyval.id) = concat3((yyvsp[(1) - (3)].id),".",(yyvsp[(3) - (3)].id));free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;}
5065 /* Line 1464 of skeleton.m4 */
5066 #line 2269 "parser.y"
5067 {PASS12 (yyval.id)=strdup((yyvsp[(1) - (1)].id));}
5076 /* Line 1464 of skeleton.m4 */
5077 #line 2271 "parser.y"
5078 {PASS12 startpackage((yyvsp[(2) - (3)].id));free((yyvsp[(2) - (3)].id));(yyvsp[(2) - (3)].id)=0;}
5087 /* Line 1464 of skeleton.m4 */
5088 #line 2272 "parser.y"
5089 {PASS12 endpackage();(yyval.code)=0;}
5098 /* Line 1464 of skeleton.m4 */
5099 #line 2273 "parser.y"
5100 {PASS12 startpackage("");}
5109 /* Line 1464 of skeleton.m4 */
5110 #line 2274 "parser.y"
5111 {PASS12 endpackage();(yyval.code)=0;}
5120 /* Line 1464 of skeleton.m4 */
5121 #line 2276 "parser.y"
5124 slotinfo_t*s = registry_find((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5125 if(!s) {// || !(s->flags&FLAG_BUILTIN)) {
5126 as3_schedule_class((yyvsp[(2) - (2)].classinfo)->package, (yyvsp[(2) - (2)].classinfo)->name);
5130 classinfo_t*c = (yyvsp[(2) - (2)].classinfo);
5132 syntaxerror("Couldn't import class\n");
5133 state_has_imports();
5134 dict_put(state->imports, c->name, c);
5145 /* Line 1464 of skeleton.m4 */
5146 #line 2291 "parser.y"
5149 if(strncmp("flash.", (yyvsp[(2) - (4)].id), 6)) {
5150 as3_schedule_package((yyvsp[(2) - (4)].id));
5155 i->package = (yyvsp[(2) - (4)].id);
5156 state_has_imports();
5157 list_append(state->wildcard_imports, i);
5168 /* Line 1464 of skeleton.m4 */
5169 #line 2307 "parser.y"
5170 {PASS12 (yyval.flags)=0;}
5179 /* Line 1464 of skeleton.m4 */
5180 #line 2308 "parser.y"
5181 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
5190 /* Line 1464 of skeleton.m4 */
5191 #line 2309 "parser.y"
5192 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].token);}
5201 /* Line 1464 of skeleton.m4 */
5202 #line 2310 "parser.y"
5203 {PASS12 (yyval.flags)=(yyvsp[(1) - (2)].flags)|(yyvsp[(2) - (2)].token);}
5212 /* Line 1464 of skeleton.m4 */
5213 #line 2312 "parser.y"
5214 {PASS12 (yyval.token)=FLAG_PUBLIC;}
5223 /* Line 1464 of skeleton.m4 */
5224 #line 2313 "parser.y"
5225 {PASS12 (yyval.token)=FLAG_PRIVATE;}
5234 /* Line 1464 of skeleton.m4 */
5235 #line 2314 "parser.y"
5236 {PASS12 (yyval.token)=FLAG_PROTECTED;}
5245 /* Line 1464 of skeleton.m4 */
5246 #line 2315 "parser.y"
5247 {PASS12 (yyval.token)=FLAG_STATIC;}
5256 /* Line 1464 of skeleton.m4 */
5257 #line 2316 "parser.y"
5258 {PASS12 (yyval.token)=FLAG_DYNAMIC;}
5267 /* Line 1464 of skeleton.m4 */
5268 #line 2317 "parser.y"
5269 {PASS12 (yyval.token)=FLAG_FINAL;}
5278 /* Line 1464 of skeleton.m4 */
5279 #line 2318 "parser.y"
5280 {PASS12 (yyval.token)=FLAG_OVERRIDE;}
5289 /* Line 1464 of skeleton.m4 */
5290 #line 2319 "parser.y"
5291 {PASS12 (yyval.token)=FLAG_NATIVE;}
5300 /* Line 1464 of skeleton.m4 */
5301 #line 2320 "parser.y"
5302 {PASS12 (yyval.token)=FLAG_PACKAGEINTERNAL;}
5311 /* Line 1464 of skeleton.m4 */
5312 #line 2321 "parser.y"
5313 {PASS12 (yyval.token)=FLAG_NAMESPACE;}
5322 /* Line 1464 of skeleton.m4 */
5323 #line 2323 "parser.y"
5324 {(yyval.classinfo)=registry_getobjectclass();}
5333 /* Line 1464 of skeleton.m4 */
5334 #line 2324 "parser.y"
5335 {(yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
5344 /* Line 1464 of skeleton.m4 */
5345 #line 2326 "parser.y"
5346 {PASS12 (yyval.classinfo_list)=list_new();}
5355 /* Line 1464 of skeleton.m4 */
5356 #line 2327 "parser.y"
5357 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5366 /* Line 1464 of skeleton.m4 */
5367 #line 2329 "parser.y"
5368 {PASS12 (yyval.classinfo_list)=list_new();}
5377 /* Line 1464 of skeleton.m4 */
5378 #line 2330 "parser.y"
5379 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5388 /* Line 1464 of skeleton.m4 */
5389 #line 2334 "parser.y"
5390 {PASS12 startclass((yyvsp[(1) - (6)].flags),(yyvsp[(3) - (6)].id),(yyvsp[(4) - (6)].classinfo),(yyvsp[(5) - (6)].classinfo_list));}
5399 /* Line 1464 of skeleton.m4 */
5400 #line 2336 "parser.y"
5401 {PASS12 endclass();(yyval.code)=0;}
5410 /* Line 1464 of skeleton.m4 */
5411 #line 2340 "parser.y"
5412 {PASS12 startclass((yyvsp[(1) - (5)].flags)|FLAG_INTERFACE,(yyvsp[(3) - (5)].id),0,(yyvsp[(4) - (5)].classinfo_list));}
5421 /* Line 1464 of skeleton.m4 */
5422 #line 2342 "parser.y"
5423 {PASS12 endclass();(yyval.code)=0;}
5432 /* Line 1464 of skeleton.m4 */
5433 #line 2355 "parser.y"
5435 code_t*c = state->cls->static_init->header;
5436 c = code_append(c, (yyvsp[(1) - (1)].code));
5437 state->cls->static_init->header = c;
5447 /* Line 1464 of skeleton.m4 */
5448 #line 2366 "parser.y"
5450 syntaxerror("variable declarations not allowed in interfaces");
5460 /* Line 1464 of skeleton.m4 */
5461 #line 2369 "parser.y"
5464 (yyvsp[(1) - (8)].flags) |= FLAG_PUBLIC;
5465 if((yyvsp[(1) - (8)].flags)&(FLAG_PRIVATE|FLAG_PACKAGEINTERNAL|FLAG_PROTECTED)) {
5466 syntaxerror("invalid method modifiers: interface methods always need to be public");
5468 startfunction(0,(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo));
5469 endfunction(0,(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo), 0);
5470 list_deep_free((yyvsp[(6) - (8)].params).list);
5480 /* Line 1464 of skeleton.m4 */
5481 #line 2384 "parser.y"
5482 {setstaticfunction((yyvsp[(1) - (3)].flags));}
5491 /* Line 1464 of skeleton.m4 */
5492 #line 2384 "parser.y"
5494 int flags = (yyvsp[(1) - (6)].flags);
5495 U8 access = flags2access((yyvsp[(1) - (6)].flags));
5497 varinfo_t* info = 0;
5499 memberinfo_t*i = registry_findmember(state->cls->info, (yyvsp[(3) - (6)].id), 1);
5501 check_override(i, flags);
5503 info = varinfo_register_onclass(state->cls->info, access, (yyvsp[(3) - (6)].id));
5505 slotinfo_t*i = registry_find(state->package, (yyvsp[(3) - (6)].id));
5507 syntaxerror("package %s already contains '%s'", state->package, (yyvsp[(3) - (6)].id));
5509 info = varinfo_register_global(access, state->package, (yyvsp[(3) - (6)].id));
5512 info->type = (yyvsp[(5) - (6)].classinfo);
5513 info->flags = flags;
5516 namespace_t mname_ns = {access, ""};
5517 multiname_t mname = {QNAME, &mname_ns, 0, (yyvsp[(3) - (6)].id)};
5519 trait_list_t**traits;
5523 mname_ns.name = state->package;
5524 traits = &global->init->traits;
5525 code = &global->init->method->body->code;
5526 } else if(flags&FLAG_STATIC) {
5528 traits = &state->cls->abc->static_traits;
5529 code = &state->cls->static_init->header;
5531 // instance variable
5532 traits = &state->cls->abc->traits;
5533 code = &state->cls->init->header;
5537 if((yyvsp[(5) - (6)].classinfo)) {
5538 MULTINAME(m, (yyvsp[(5) - (6)].classinfo));
5539 t = trait_new_member(traits, multiname_clone(&m), multiname_clone(&mname), 0);
5541 t = trait_new_member(traits, 0, multiname_clone(&mname), 0);
5543 info->slot = t->slot_id;
5545 /* initalization code (if needed) */
5547 if((yyvsp[(6) - (6)].value).c && !is_pushundefined((yyvsp[(6) - (6)].value).c)) {
5548 c = abc_getlocal_0(c);
5549 c = code_append(c, (yyvsp[(6) - (6)].value).c);
5550 c = converttype(c, (yyvsp[(6) - (6)].value).t, (yyvsp[(5) - (6)].classinfo));
5551 c = abc_setslot(c, t->slot_id);
5554 *code = code_append(*code, c);
5556 if((yyvsp[(2) - (6)].token)==KW_CONST) {
5557 t->kind= TRAIT_CONST;
5561 setstaticfunction(0);
5571 /* Line 1464 of skeleton.m4 */
5572 #line 2457 "parser.y"
5573 {(yyval.constant)=0;}
5582 /* Line 1464 of skeleton.m4 */
5583 #line 2458 "parser.y"
5584 {(yyval.constant)=(yyvsp[(2) - (2)].constant);}
5593 /* Line 1464 of skeleton.m4 */
5594 #line 2460 "parser.y"
5595 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_uint));}
5604 /* Line 1464 of skeleton.m4 */
5605 #line 2461 "parser.y"
5606 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_int));}
5615 /* Line 1464 of skeleton.m4 */
5616 #line 2462 "parser.y"
5617 {(yyval.constant) = constant_new_uint((yyvsp[(1) - (1)].number_uint));}
5626 /* Line 1464 of skeleton.m4 */
5627 #line 2463 "parser.y"
5628 {(yyval.constant) = constant_new_float((yyvsp[(1) - (1)].number_float));}
5637 /* Line 1464 of skeleton.m4 */
5638 #line 2464 "parser.y"
5639 {(yyval.constant) = constant_new_string2((yyvsp[(1) - (1)].str).str,(yyvsp[(1) - (1)].str).len);free((char*)(yyvsp[(1) - (1)].str).str);}
5648 /* Line 1464 of skeleton.m4 */
5649 #line 2466 "parser.y"
5650 {(yyval.constant) = constant_new_true((yyvsp[(1) - (1)].token));}
5659 /* Line 1464 of skeleton.m4 */
5660 #line 2467 "parser.y"
5661 {(yyval.constant) = constant_new_false((yyvsp[(1) - (1)].token));}
5670 /* Line 1464 of skeleton.m4 */
5671 #line 2468 "parser.y"
5672 {(yyval.constant) = constant_new_null((yyvsp[(1) - (1)].token));}
5681 /* Line 1464 of skeleton.m4 */
5682 #line 2469 "parser.y"
5685 as3_warning("Couldn't resolve %s", (yyvsp[(1) - (1)].id));
5686 (yyval.constant) = constant_new_null((yyvsp[(1) - (1)].id));
5696 /* Line 1464 of skeleton.m4 */
5697 #line 2478 "parser.y"
5700 memset(&(yyval.params),0,sizeof((yyval.params)));
5710 /* Line 1464 of skeleton.m4 */
5711 #line 2482 "parser.y"
5714 (yyval.params)=(yyvsp[(1) - (1)].params);
5724 /* Line 1464 of skeleton.m4 */
5725 #line 2488 "parser.y"
5728 memset(&(yyval.params),0,sizeof((yyval.params)));
5729 (yyval.params).varargs=1;
5730 list_append((yyval.params).list, (yyvsp[(2) - (2)].param));
5740 /* Line 1464 of skeleton.m4 */
5741 #line 2494 "parser.y"
5744 (yyval.params) =(yyvsp[(1) - (4)].params);
5745 (yyval.params).varargs=1;
5746 list_append((yyval.params).list, (yyvsp[(4) - (4)].param));
5756 /* Line 1464 of skeleton.m4 */
5757 #line 2502 "parser.y"
5760 (yyval.params) = (yyvsp[(1) - (3)].params);
5761 list_append((yyval.params).list, (yyvsp[(3) - (3)].param));
5771 /* Line 1464 of skeleton.m4 */
5772 #line 2507 "parser.y"
5775 memset(&(yyval.params),0,sizeof((yyval.params)));
5776 list_append((yyval.params).list, (yyvsp[(1) - (1)].param));
5786 /* Line 1464 of skeleton.m4 */
5787 #line 2513 "parser.y"
5790 (yyval.param) = rfx_calloc(sizeof(param_t));
5791 (yyval.param)->name=(yyvsp[(1) - (4)].id);
5792 (yyval.param)->type = (yyvsp[(3) - (4)].classinfo);
5794 (yyval.param)->value = (yyvsp[(4) - (4)].constant);
5804 /* Line 1464 of skeleton.m4 */
5805 #line 2521 "parser.y"
5808 (yyval.param) = rfx_calloc(sizeof(param_t));
5809 (yyval.param)->name=(yyvsp[(1) - (2)].id);
5810 (yyval.param)->type = TYPE_ANY;
5812 (yyval.param)->value = (yyvsp[(2) - (2)].constant);
5822 /* Line 1464 of skeleton.m4 */
5823 #line 2529 "parser.y"
5824 {(yyval.token)=(yyvsp[(1) - (1)].token);}
5833 /* Line 1464 of skeleton.m4 */
5834 #line 2530 "parser.y"
5835 {(yyval.token)=(yyvsp[(1) - (1)].token);}
5844 /* Line 1464 of skeleton.m4 */
5845 #line 2531 "parser.y"
5855 /* Line 1464 of skeleton.m4 */
5856 #line 2534 "parser.y"
5857 {PASS12 startfunction(0,(yyvsp[(1) - (9)].flags),(yyvsp[(3) - (9)].token),(yyvsp[(4) - (9)].id),&(yyvsp[(6) - (9)].params),(yyvsp[(8) - (9)].classinfo));}
5866 /* Line 1464 of skeleton.m4 */
5867 #line 2535 "parser.y"
5870 endfunction(0,(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),0,0);
5872 if(!state->method->info) syntaxerror("internal error");
5874 code_t*c = method_header(state->method);
5875 c = wrap_function(c, 0, (yyvsp[(11) - (12)].code));
5877 endfunction(0,(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),(yyvsp[(8) - (12)].classinfo),c);
5879 list_deep_free((yyvsp[(6) - (12)].params).list);
5890 /* Line 1464 of skeleton.m4 */
5891 #line 2551 "parser.y"
5892 {PASS12 (yyval.id)=0;}
5901 /* Line 1464 of skeleton.m4 */
5902 #line 2553 "parser.y"
5903 {PASS12 innerfunction((yyvsp[(2) - (7)].id),&(yyvsp[(4) - (7)].params),(yyvsp[(6) - (7)].classinfo));}
5912 /* Line 1464 of skeleton.m4 */
5913 #line 2554 "parser.y"
5916 endfunction(0,0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),0,0);
5918 methodinfo_t*f = state->method->info;
5919 if(!f || !f->kind) syntaxerror("internal error");
5921 code_t*c = method_header(state->method);
5922 c = wrap_function(c, 0, (yyvsp[(9) - (10)].code));
5924 int index = state->method->var_index;
5925 endfunction(0,0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),(yyvsp[(6) - (10)].classinfo),c);
5927 (yyval.value).c = abc_getlocal(0, index);
5928 (yyval.value).t = TYPE_FUNCTION(f);
5930 PASS12 list_deep_free((yyvsp[(4) - (10)].params).list);
5940 /* Line 1464 of skeleton.m4 */
5941 #line 2576 "parser.y"
5943 PASS1 (yyval.classinfo)=0;
5945 slotinfo_t*s = find_class((yyvsp[(1) - (1)].id));
5946 if(!s) syntaxerror("Could not find class/method %s (current package: %s)\n", (yyvsp[(1) - (1)].id), state->package);
5947 (yyval.classinfo) = (classinfo_t*)s;
5957 /* Line 1464 of skeleton.m4 */
5958 #line 2584 "parser.y"
5960 PASS1 static classinfo_t c;
5961 memset(&c, 0, sizeof(c));
5962 c.package = (yyvsp[(1) - (3)].id);
5963 c.name = (yyvsp[(3) - (3)].id);
5964 (yyval.classinfo)=&c;
5966 slotinfo_t*s = registry_find((yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
5967 if(!s) syntaxerror("Couldn't find class/method %s.%s\n", (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
5968 free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;
5969 (yyval.classinfo) = (classinfo_t*)s;
5979 /* Line 1464 of skeleton.m4 */
5980 #line 2600 "parser.y"
5981 {PASS12 (yyval.classinfo_list)=list_new();list_append((yyval.classinfo_list), (yyvsp[(1) - (1)].classinfo));}
5990 /* Line 1464 of skeleton.m4 */
5991 #line 2601 "parser.y"
5992 {PASS12 (yyval.classinfo_list)=(yyvsp[(1) - (3)].classinfo_list);list_append((yyval.classinfo_list),(yyvsp[(3) - (3)].classinfo));}
6001 /* Line 1464 of skeleton.m4 */
6002 #line 2603 "parser.y"
6003 {(yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);}
6012 /* Line 1464 of skeleton.m4 */
6013 #line 2604 "parser.y"
6014 {(yyval.classinfo)=registry_getanytype();}
6023 /* Line 1464 of skeleton.m4 */
6024 #line 2605 "parser.y"
6025 {(yyval.classinfo)=registry_getanytype();}
6034 /* Line 1464 of skeleton.m4 */
6035 #line 2614 "parser.y"
6036 {(yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
6045 /* Line 1464 of skeleton.m4 */
6046 #line 2615 "parser.y"
6047 {(yyval.classinfo)=0;}
6056 /* Line 1464 of skeleton.m4 */
6057 #line 2619 "parser.y"
6058 {(yyval.value_list).cc=0;(yyval.value_list).len=0;}
6067 /* Line 1464 of skeleton.m4 */
6068 #line 2620 "parser.y"
6069 {(yyval.value_list)=(yyvsp[(2) - (3)].value_list);}
6078 /* Line 1464 of skeleton.m4 */
6079 #line 2622 "parser.y"
6080 {(yyval.value_list).cc=0;(yyval.value_list).len=0;}
6089 /* Line 1464 of skeleton.m4 */
6090 #line 2626 "parser.y"
6091 {(yyval.value_list).len=1;
6092 (yyval.value_list).cc = (yyvsp[(1) - (1)].value).c;
6102 /* Line 1464 of skeleton.m4 */
6103 #line 2630 "parser.y"
6104 {(yyval.value_list) = (yyvsp[(1) - (2)].value_list);}
6113 /* Line 1464 of skeleton.m4 */
6114 #line 2631 "parser.y"
6116 (yyval.value_list).len= (yyvsp[(1) - (2)].value_list).len+1;
6117 (yyval.value_list).cc = code_append((yyvsp[(1) - (2)].value_list).cc, (yyvsp[(2) - (2)].value).c);
6127 /* Line 1464 of skeleton.m4 */
6128 #line 2637 "parser.y"
6130 (yyval.value).c = (yyvsp[(2) - (4)].value).c;
6131 if((yyval.value).c->opcode == OPCODE_COERCE_A) (yyval.value).c = code_cutlast((yyval.value).c);
6133 code_t*paramcode = (yyvsp[(4) - (4)].value_list).cc;
6134 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6135 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6136 (yyval.value).c = code_cutlast((yyval.value).c);
6137 (yyval.value).c = code_append((yyval.value).c, paramcode);
6138 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).len);
6139 multiname_destroy(name);
6140 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
6141 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
6142 trait_t*t = abc_class_find_slotid(state->cls->abc,slot);//FIXME
6143 multiname_t*name = t->name;
6144 (yyval.value).c = code_cutlast((yyval.value).c);
6145 (yyval.value).c = code_append((yyval.value).c, paramcode);
6146 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).len);
6148 (yyval.value).c = code_append((yyval.value).c, paramcode);
6149 (yyval.value).c = abc_construct((yyval.value).c, (yyvsp[(4) - (4)].value_list).len);
6152 (yyval.value).t = TYPE_ANY;
6153 if(TYPE_IS_CLASS((yyvsp[(2) - (4)].value).t) && (yyvsp[(2) - (4)].value).t->data) {
6154 (yyval.value).t = (yyvsp[(2) - (4)].value).t->data;
6156 (yyval.value).c = abc_coerce_a((yyval.value).c);
6157 (yyval.value).t = TYPE_ANY;
6168 /* Line 1464 of skeleton.m4 */
6169 #line 2673 "parser.y"
6172 (yyval.value).c = (yyvsp[(1) - (4)].value).c;
6173 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
6174 (yyval.value).c = code_cutlast((yyval.value).c);
6176 code_t*paramcode = (yyvsp[(3) - (4)].value_list).cc;
6178 (yyval.value).t = TYPE_ANY;
6179 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6180 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6181 (yyval.value).c = code_cutlast((yyval.value).c);
6182 (yyval.value).c = code_append((yyval.value).c, paramcode);
6183 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).len);
6184 multiname_destroy(name);
6185 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
6186 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
6187 trait_t*t = abc_class_find_slotid(state->cls->abc,slot);//FIXME
6188 if(t->kind!=TRAIT_METHOD) {
6189 //ok: flash allows to assign closures to members.
6191 multiname_t*name = t->name;
6192 (yyval.value).c = code_cutlast((yyval.value).c);
6193 (yyval.value).c = code_append((yyval.value).c, paramcode);
6194 //$$.c = abc_callmethod($$.c, t->method, len); //#1051 illegal early access binding
6195 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).len);
6196 } else if((yyval.value).c->opcode == OPCODE_GETSUPER) {
6197 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
6198 (yyval.value).c = code_cutlast((yyval.value).c);
6199 (yyval.value).c = code_append((yyval.value).c, paramcode);
6200 (yyval.value).c = abc_callsuper2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).len);
6201 multiname_destroy(name);
6203 (yyval.value).c = abc_getglobalscope((yyval.value).c);
6204 (yyval.value).c = code_append((yyval.value).c, paramcode);
6205 (yyval.value).c = abc_call((yyval.value).c, (yyvsp[(3) - (4)].value_list).len);
6208 if(TYPE_IS_FUNCTION((yyvsp[(1) - (4)].value).t) && (yyvsp[(1) - (4)].value).t->data) {
6209 (yyval.value).t = ((methodinfo_t*)((yyvsp[(1) - (4)].value).t->data))->return_type;
6211 (yyval.value).c = abc_coerce_a((yyval.value).c);
6212 (yyval.value).t = TYPE_ANY;
6223 /* Line 1464 of skeleton.m4 */
6224 #line 2719 "parser.y"
6226 if(!state->cls) syntaxerror("super() not allowed outside of a class");
6227 if(!state->method) syntaxerror("super() not allowed outside of a function");
6228 if(!state->method->is_constructor) syntaxerror("super() not allowed outside of a constructor");
6230 (yyval.value).c = code_new();
6231 (yyval.value).c = abc_getlocal_0((yyval.value).c);
6233 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value_list).cc);
6235 this is dependent on the control path, check this somewhere else
6236 if(state->method->has_super)
6237 syntaxerror("constructor may call super() only once");
6239 state->method->has_super = 1;
6241 (yyval.value).c = abc_constructsuper((yyval.value).c, (yyvsp[(3) - (4)].value_list).len);
6242 (yyval.value).c = abc_pushundefined((yyval.value).c);
6243 (yyval.value).t = TYPE_ANY;
6253 /* Line 1464 of skeleton.m4 */
6254 #line 2740 "parser.y"
6256 (yyval.value).c = (yyvsp[(2) - (2)].value).c;
6257 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
6258 (yyval.value).c = code_cutlast((yyval.value).c);
6260 multiname_t*name = 0;
6261 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
6262 (yyval.value).c->opcode = OPCODE_DELETEPROPERTY;
6263 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
6264 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
6265 multiname_t*name = abc_class_find_slotid(state->cls->abc,slot)->name;
6266 (yyval.value).c = code_cutlast((yyval.value).c);
6267 (yyval.value).c = abc_deleteproperty2((yyval.value).c, name);
6269 (yyval.value).c = abc_getlocal_0((yyval.value).c);
6270 MULTINAME_LATE(m, (yyvsp[(2) - (2)].value).t?(yyvsp[(2) - (2)].value).t->access:ACCESS_PACKAGE, "");
6271 (yyval.value).c = abc_deleteproperty2((yyval.value).c, &m);
6273 (yyval.value).t = TYPE_BOOLEAN;
6283 /* Line 1464 of skeleton.m4 */
6284 #line 2761 "parser.y"
6286 (yyval.code) = abc_returnvoid(0);
6296 /* Line 1464 of skeleton.m4 */
6297 #line 2764 "parser.y"
6299 (yyval.code) = (yyvsp[(2) - (2)].value).c;
6300 (yyval.code) = abc_returnvalue((yyval.code));
6310 /* Line 1464 of skeleton.m4 */
6311 #line 2771 "parser.y"
6312 {(yyval.value)=(yyvsp[(1) - (1)].value);}
6321 /* Line 1464 of skeleton.m4 */
6322 #line 2772 "parser.y"
6323 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6332 /* Line 1464 of skeleton.m4 */
6333 #line 2773 "parser.y"
6335 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
6336 (yyval.value).c = cut_last_push((yyval.value).c);
6337 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
6338 (yyval.value).t = (yyvsp[(3) - (3)].value).t;
6348 /* Line 1464 of skeleton.m4 */
6349 #line 2779 "parser.y"
6351 (yyval.code)=cut_last_push((yyvsp[(1) - (1)].value).c);
6361 /* Line 1464 of skeleton.m4 */
6362 #line 2785 "parser.y"
6363 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6372 /* Line 1464 of skeleton.m4 */
6373 #line 2789 "parser.y"
6374 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6383 /* Line 1464 of skeleton.m4 */
6384 #line 2791 "parser.y"
6385 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6394 /* Line 1464 of skeleton.m4 */
6395 #line 2793 "parser.y"
6396 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6405 /* Line 1464 of skeleton.m4 */
6406 #line 2797 "parser.y"
6408 (yyval.value).c = 0;
6409 namespace_t ns = {ACCESS_PACKAGE, ""};
6410 multiname_t m = {QNAME, &ns, 0, "RegExp"};
6411 if(!(yyvsp[(1) - (1)].regexp).options) {
6412 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
6413 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern);
6414 (yyval.value).c = abc_construct((yyval.value).c, 1);
6416 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
6417 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern);
6418 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).options);
6419 (yyval.value).c = abc_construct((yyval.value).c, 2);
6421 (yyval.value).t = TYPE_REGEXP;
6431 /* Line 1464 of skeleton.m4 */
6432 #line 2814 "parser.y"
6433 {(yyval.value).c = abc_pushbyte(0, (yyvsp[(1) - (1)].number_uint));
6434 //MULTINAME(m, registry_getintclass());
6435 //$$.c = abc_coerce2($$.c, &m); // FIXME
6436 (yyval.value).t = TYPE_INT;
6446 /* Line 1464 of skeleton.m4 */
6447 #line 2819 "parser.y"
6448 {(yyval.value).c = abc_pushshort(0, (yyvsp[(1) - (1)].number_uint));
6449 (yyval.value).t = TYPE_INT;
6459 /* Line 1464 of skeleton.m4 */
6460 #line 2822 "parser.y"
6461 {(yyval.value).c = abc_pushint(0, (yyvsp[(1) - (1)].number_int));
6462 (yyval.value).t = TYPE_INT;
6472 /* Line 1464 of skeleton.m4 */
6473 #line 2825 "parser.y"
6474 {(yyval.value).c = abc_pushuint(0, (yyvsp[(1) - (1)].number_uint));
6475 (yyval.value).t = TYPE_UINT;
6485 /* Line 1464 of skeleton.m4 */
6486 #line 2828 "parser.y"
6487 {(yyval.value).c = abc_pushdouble(0, (yyvsp[(1) - (1)].number_float));
6488 (yyval.value).t = TYPE_FLOAT;
6498 /* Line 1464 of skeleton.m4 */
6499 #line 2831 "parser.y"
6500 {(yyval.value).c = abc_pushstring2(0, &(yyvsp[(1) - (1)].str));free((char*)(yyvsp[(1) - (1)].str).str);
6501 (yyval.value).t = TYPE_STRING;
6511 /* Line 1464 of skeleton.m4 */
6512 #line 2834 "parser.y"
6513 {(yyval.value).c = abc_pushundefined(0);
6514 (yyval.value).t = TYPE_ANY;
6524 /* Line 1464 of skeleton.m4 */
6525 #line 2837 "parser.y"
6526 {(yyval.value).c = abc_pushtrue(0);
6527 (yyval.value).t = TYPE_BOOLEAN;
6537 /* Line 1464 of skeleton.m4 */
6538 #line 2840 "parser.y"
6539 {(yyval.value).c = abc_pushfalse(0);
6540 (yyval.value).t = TYPE_BOOLEAN;
6550 /* Line 1464 of skeleton.m4 */
6551 #line 2843 "parser.y"
6552 {(yyval.value).c = abc_pushnull(0);
6553 (yyval.value).t = TYPE_NULL;
6563 /* Line 1464 of skeleton.m4 */
6564 #line 2847 "parser.y"
6565 {(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);
6566 (yyval.value).t = TYPE_BOOLEAN;
6576 /* Line 1464 of skeleton.m4 */
6577 #line 2850 "parser.y"
6578 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterthan((yyval.value).c);
6579 (yyval.value).t = TYPE_BOOLEAN;
6589 /* Line 1464 of skeleton.m4 */
6590 #line 2853 "parser.y"
6591 {(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);
6592 (yyval.value).t = TYPE_BOOLEAN;
6602 /* Line 1464 of skeleton.m4 */
6603 #line 2856 "parser.y"
6604 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterequals((yyval.value).c);
6605 (yyval.value).t = TYPE_BOOLEAN;
6615 /* Line 1464 of skeleton.m4 */
6616 #line 2859 "parser.y"
6617 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_equals((yyval.value).c);
6618 (yyval.value).t = TYPE_BOOLEAN;
6628 /* Line 1464 of skeleton.m4 */
6629 #line 2862 "parser.y"
6630 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_strictequals((yyval.value).c);
6631 (yyval.value).t = TYPE_BOOLEAN;
6641 /* Line 1464 of skeleton.m4 */
6642 #line 2865 "parser.y"
6643 {(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);
6644 (yyval.value).t = TYPE_BOOLEAN;
6654 /* Line 1464 of skeleton.m4 */
6655 #line 2868 "parser.y"
6656 {(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);
6657 (yyval.value).t = TYPE_BOOLEAN;
6667 /* Line 1464 of skeleton.m4 */
6668 #line 2872 "parser.y"
6669 {(yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'O');
6670 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
6671 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t);
6672 (yyval.value).c = abc_dup((yyval.value).c);
6673 code_t*jmp = (yyval.value).c = abc_iftrue((yyval.value).c, 0);
6674 (yyval.value).c = cut_last_push((yyval.value).c);
6675 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
6676 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t);
6677 code_t*label = (yyval.value).c = abc_label((yyval.value).c);
6678 jmp->branch = label;
6688 /* Line 1464 of skeleton.m4 */
6689 #line 2883 "parser.y"
6691 (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'A');
6692 /*printf("%08x:\n",$1.t);
6693 code_dump($1.c, 0, 0, "", stdout);
6694 printf("%08x:\n",$3.t);
6695 code_dump($3.c, 0, 0, "", stdout);
6696 printf("joining %08x and %08x to %08x\n", $1.t, $3.t, $$.t);*/
6697 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
6698 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t);
6699 (yyval.value).c = abc_dup((yyval.value).c);
6700 code_t*jmp = (yyval.value).c = abc_iffalse((yyval.value).c, 0);
6701 (yyval.value).c = cut_last_push((yyval.value).c);
6702 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
6703 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t);
6704 code_t*label = (yyval.value).c = abc_label((yyval.value).c);
6705 jmp->branch = label;
6715 /* Line 1464 of skeleton.m4 */
6716 #line 2901 "parser.y"
6717 {(yyval.value).c=(yyvsp[(2) - (2)].value).c;
6718 (yyval.value).c = abc_not((yyval.value).c);
6719 (yyval.value).t = TYPE_BOOLEAN;
6729 /* Line 1464 of skeleton.m4 */
6730 #line 2906 "parser.y"
6731 {(yyval.value).c=(yyvsp[(2) - (2)].value).c;
6732 (yyval.value).c = abc_bitnot((yyval.value).c);
6733 (yyval.value).t = TYPE_INT;
6743 /* Line 1464 of skeleton.m4 */
6744 #line 2911 "parser.y"
6745 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6746 (yyval.value).c = abc_bitand((yyval.value).c);
6747 (yyval.value).t = TYPE_INT;
6757 /* Line 1464 of skeleton.m4 */
6758 #line 2916 "parser.y"
6759 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6760 (yyval.value).c = abc_bitxor((yyval.value).c);
6761 (yyval.value).t = TYPE_INT;
6771 /* Line 1464 of skeleton.m4 */
6772 #line 2921 "parser.y"
6773 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6774 (yyval.value).c = abc_bitor((yyval.value).c);
6775 (yyval.value).t = TYPE_INT;
6785 /* Line 1464 of skeleton.m4 */
6786 #line 2926 "parser.y"
6787 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6788 (yyval.value).c = abc_rshift((yyval.value).c);
6789 (yyval.value).t = TYPE_INT;
6799 /* Line 1464 of skeleton.m4 */
6800 #line 2930 "parser.y"
6801 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6802 (yyval.value).c = abc_urshift((yyval.value).c);
6803 (yyval.value).t = TYPE_INT;
6813 /* Line 1464 of skeleton.m4 */
6814 #line 2934 "parser.y"
6815 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6816 (yyval.value).c = abc_lshift((yyval.value).c);
6817 (yyval.value).t = TYPE_INT;
6827 /* Line 1464 of skeleton.m4 */
6828 #line 2939 "parser.y"
6829 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6830 (yyval.value).c = abc_divide((yyval.value).c);
6831 (yyval.value).t = TYPE_NUMBER;
6841 /* Line 1464 of skeleton.m4 */
6842 #line 2943 "parser.y"
6843 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6844 (yyval.value).c = abc_modulo((yyval.value).c);
6845 (yyval.value).t = TYPE_NUMBER;
6855 /* Line 1464 of skeleton.m4 */
6856 #line 2947 "parser.y"
6857 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6858 if(BOTH_INT((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t)) {
6859 (yyval.value).c = abc_add_i((yyval.value).c);
6860 (yyval.value).t = TYPE_INT;
6862 (yyval.value).c = abc_add((yyval.value).c);
6863 (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t,'+');
6874 /* Line 1464 of skeleton.m4 */
6875 #line 2956 "parser.y"
6876 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6877 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
6878 (yyval.value).c = abc_subtract_i((yyval.value).c);
6879 (yyval.value).t = TYPE_INT;
6881 (yyval.value).c = abc_subtract((yyval.value).c);
6882 (yyval.value).t = TYPE_NUMBER;
6893 /* Line 1464 of skeleton.m4 */
6894 #line 2965 "parser.y"
6895 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6896 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
6897 (yyval.value).c = abc_multiply_i((yyval.value).c);
6898 (yyval.value).t = TYPE_INT;
6900 (yyval.value).c = abc_multiply((yyval.value).c);
6901 (yyval.value).t = TYPE_NUMBER;
6912 /* Line 1464 of skeleton.m4 */
6913 #line 2975 "parser.y"
6914 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6915 (yyval.value).c = abc_in((yyval.value).c);
6916 (yyval.value).t = TYPE_BOOLEAN;
6926 /* Line 1464 of skeleton.m4 */
6927 #line 2980 "parser.y"
6928 {char use_astype=0; // flash player's astype works differently than astypelate
6929 if(use_astype && TYPE_IS_CLASS((yyvsp[(3) - (3)].value).t) && (yyvsp[(3) - (3)].value).t->data) {
6930 MULTINAME(m, (classinfo_t*)((yyvsp[(3) - (3)].value).t->data));
6931 (yyval.value).c = abc_astype2((yyvsp[(1) - (3)].value).c, &m);
6932 (yyval.value).t = (yyvsp[(3) - (3)].value).t->data;
6934 (yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
6935 (yyval.value).c = abc_astypelate((yyval.value).c);
6936 (yyval.value).t = TYPE_ANY;
6947 /* Line 1464 of skeleton.m4 */
6948 #line 2993 "parser.y"
6949 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
6950 (yyval.value).c = abc_instanceof((yyval.value).c);
6951 (yyval.value).t = TYPE_BOOLEAN;
6961 /* Line 1464 of skeleton.m4 */
6962 #line 2998 "parser.y"
6963 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
6964 (yyval.value).c = abc_istypelate((yyval.value).c);
6965 (yyval.value).t = TYPE_BOOLEAN;
6975 /* Line 1464 of skeleton.m4 */
6976 #line 3003 "parser.y"
6978 (yyval.value).c = (yyvsp[(3) - (4)].value).c;
6979 (yyval.value).c = abc_typeof((yyval.value).c);
6980 (yyval.value).t = TYPE_STRING;
6990 /* Line 1464 of skeleton.m4 */
6991 #line 3009 "parser.y"
6993 (yyval.value).c = cut_last_push((yyvsp[(2) - (2)].value).c);
6994 (yyval.value).c = abc_pushundefined((yyval.value).c);
6995 (yyval.value).t = TYPE_ANY;
7005 /* Line 1464 of skeleton.m4 */
7006 #line 3015 "parser.y"
7007 { (yyval.value).c = abc_pushundefined(0);
7008 (yyval.value).t = TYPE_ANY;
7018 /* Line 1464 of skeleton.m4 */
7019 #line 3019 "parser.y"
7020 {(yyval.value)=(yyvsp[(2) - (3)].value);}
7029 /* Line 1464 of skeleton.m4 */
7030 #line 3021 "parser.y"
7032 (yyval.value)=(yyvsp[(2) - (2)].value);
7033 if(IS_INT((yyvsp[(2) - (2)].value).t)) {
7034 (yyval.value).c=abc_negate_i((yyval.value).c);
7035 (yyval.value).t = TYPE_INT;
7037 (yyval.value).c=abc_negate((yyval.value).c);
7038 (yyval.value).t = TYPE_NUMBER;
7049 /* Line 1464 of skeleton.m4 */
7050 #line 3032 "parser.y"
7052 (yyval.value).c = (yyvsp[(1) - (4)].value).c;
7053 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value).c);
7055 MULTINAME_LATE(m, (yyvsp[(1) - (4)].value).t?(yyvsp[(1) - (4)].value).t->access:ACCESS_PACKAGE, "");
7056 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7057 (yyval.value).t = 0; // array elements have unknown type
7067 /* Line 1464 of skeleton.m4 */
7068 #line 3041 "parser.y"
7070 (yyval.value).c = code_new();
7071 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc);
7072 (yyval.value).c = abc_newarray((yyval.value).c, (yyvsp[(2) - (3)].value_list).len);
7073 (yyval.value).t = registry_getarrayclass();
7083 /* Line 1464 of skeleton.m4 */
7084 #line 3048 "parser.y"
7085 {(yyval.value_list).cc=0;(yyval.value_list).len=0;}
7094 /* Line 1464 of skeleton.m4 */
7095 #line 3049 "parser.y"
7096 {(yyval.value_list)=(yyvsp[(1) - (1)].value_list);}
7105 /* Line 1464 of skeleton.m4 */
7106 #line 3051 "parser.y"
7108 (yyval.value_list).cc = 0;
7109 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(1) - (3)].value).c);
7110 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (3)].value).c);
7111 (yyval.value_list).len = 2;
7121 /* Line 1464 of skeleton.m4 */
7122 #line 3057 "parser.y"
7124 (yyval.value_list).cc = (yyvsp[(1) - (5)].value_list).cc;
7125 (yyval.value_list).len = (yyvsp[(1) - (5)].value_list).len+2;
7126 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (5)].value).c);
7127 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(5) - (5)].value).c);
7137 /* Line 1464 of skeleton.m4 */
7138 #line 3066 "parser.y"
7140 (yyval.value).c = code_new();
7141 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc);
7142 (yyval.value).c = abc_newobject((yyval.value).c, (yyvsp[(2) - (3)].value_list).len/2);
7143 (yyval.value).t = registry_getobjectclass();
7153 /* Line 1464 of skeleton.m4 */
7154 #line 3073 "parser.y"
7156 code_t*c = (yyvsp[(3) - (3)].value).c;
7157 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
7158 c=abc_multiply_i(c);
7162 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '*'), (yyvsp[(1) - (3)].value).t);
7163 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7164 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7174 /* Line 1464 of skeleton.m4 */
7175 #line 3085 "parser.y"
7177 code_t*c = abc_modulo((yyvsp[(3) - (3)].value).c);
7178 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '%'), (yyvsp[(1) - (3)].value).t);
7179 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7180 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7190 /* Line 1464 of skeleton.m4 */
7191 #line 3091 "parser.y"
7193 code_t*c = abc_lshift((yyvsp[(3) - (3)].value).c);
7194 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '<'), (yyvsp[(1) - (3)].value).t);
7195 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7196 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7206 /* Line 1464 of skeleton.m4 */
7207 #line 3097 "parser.y"
7209 code_t*c = abc_rshift((yyvsp[(3) - (3)].value).c);
7210 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '>'), (yyvsp[(1) - (3)].value).t);
7211 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7212 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7222 /* Line 1464 of skeleton.m4 */
7223 #line 3103 "parser.y"
7225 code_t*c = abc_urshift((yyvsp[(3) - (3)].value).c);
7226 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'U'), (yyvsp[(1) - (3)].value).t);
7227 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7228 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7238 /* Line 1464 of skeleton.m4 */
7239 #line 3109 "parser.y"
7241 code_t*c = abc_divide((yyvsp[(3) - (3)].value).c);
7242 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '/'), (yyvsp[(1) - (3)].value).t);
7243 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7244 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7254 /* Line 1464 of skeleton.m4 */
7255 #line 3115 "parser.y"
7257 code_t*c = abc_bitor((yyvsp[(3) - (3)].value).c);
7258 c=converttype(c, TYPE_INT, (yyvsp[(1) - (3)].value).t);
7259 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7260 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7270 /* Line 1464 of skeleton.m4 */
7271 #line 3121 "parser.y"
7273 code_t*c = abc_bitxor((yyvsp[(3) - (3)].value).c);
7274 c=converttype(c, TYPE_INT, (yyvsp[(1) - (3)].value).t);
7275 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7276 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7286 /* Line 1464 of skeleton.m4 */
7287 #line 3127 "parser.y"
7289 code_t*c = (yyvsp[(3) - (3)].value).c;
7291 if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) {
7295 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '+'), (yyvsp[(1) - (3)].value).t);
7298 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7299 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7309 /* Line 1464 of skeleton.m4 */
7310 #line 3140 "parser.y"
7311 { code_t*c = (yyvsp[(3) - (3)].value).c;
7312 if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) {
7313 c=abc_subtract_i(c);
7316 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '-'), (yyvsp[(1) - (3)].value).t);
7319 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
7320 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7330 /* Line 1464 of skeleton.m4 */
7331 #line 3151 "parser.y"
7333 c = code_append(c, (yyvsp[(3) - (3)].value).c);
7334 c = converttype(c, (yyvsp[(3) - (3)].value).t, (yyvsp[(1) - (3)].value).t);
7335 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 1, 0);
7336 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
7346 /* Line 1464 of skeleton.m4 */
7347 #line 3158 "parser.y"
7349 (yyval.value).t = join_types((yyvsp[(3) - (5)].value).t,(yyvsp[(5) - (5)].value).t,'?');
7350 (yyval.value).c = (yyvsp[(1) - (5)].value).c;
7351 code_t*j1 = (yyval.value).c = abc_iffalse((yyval.value).c, 0);
7352 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (5)].value).c);
7353 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (5)].value).t, (yyval.value).t);
7354 code_t*j2 = (yyval.value).c = abc_jump((yyval.value).c, 0);
7355 (yyval.value).c = j1->branch = abc_label((yyval.value).c);
7356 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(5) - (5)].value).c);
7357 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (5)].value).t, (yyval.value).t);
7358 (yyval.value).c = j2->branch = abc_label((yyval.value).c);
7368 /* Line 1464 of skeleton.m4 */
7369 #line 3171 "parser.y"
7371 classinfo_t*type = (yyvsp[(1) - (2)].value).t;
7372 if((is_getlocal((yyvsp[(1) - (2)].value).c) && TYPE_IS_INT((yyvsp[(1) - (2)].value).t)) || TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t)) {
7373 int nr = getlocalnr((yyvsp[(1) - (2)].value).c);
7374 code_free((yyvsp[(1) - (2)].value).c);(yyvsp[(1) - (2)].value).c=0;
7375 if(TYPE_IS_INT((yyvsp[(1) - (2)].value).t)) {
7376 (yyval.value).c = abc_getlocal(0, nr);
7377 (yyval.value).c = abc_inclocal_i((yyval.value).c, nr);
7378 } else if(TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t)) {
7379 (yyval.value).c = abc_getlocal(0, nr);
7380 (yyval.value).c = abc_inclocal((yyval.value).c, nr);
7381 } else syntaxerror("internal error");
7383 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7384 c=abc_increment_i(c);
7390 c=converttype(c, type, (yyvsp[(1) - (2)].value).t);
7391 (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1);
7392 (yyval.value).t = (yyvsp[(1) - (2)].value).t;
7403 /* Line 1464 of skeleton.m4 */
7404 #line 3198 "parser.y"
7406 classinfo_t*type = (yyvsp[(1) - (2)].value).t;
7407 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7408 c=abc_decrement_i(c);
7414 c=converttype(c, type, (yyvsp[(1) - (2)].value).t);
7415 (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1);
7416 (yyval.value).t = (yyvsp[(1) - (2)].value).t;
7426 /* Line 1464 of skeleton.m4 */
7427 #line 3212 "parser.y"
7429 classinfo_t*type = (yyvsp[(2) - (2)].value).t;
7430 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7431 c=abc_increment_i(c);
7437 c=converttype(c, type, (yyvsp[(2) - (2)].value).t);
7438 (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0);
7439 (yyval.value).t = (yyvsp[(2) - (2)].value).t;
7449 /* Line 1464 of skeleton.m4 */
7450 #line 3226 "parser.y"
7452 classinfo_t*type = (yyvsp[(2) - (2)].value).t;
7453 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7454 c=abc_decrement_i(c);
7460 c=converttype(c, type, (yyvsp[(2) - (2)].value).t);
7461 (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0);
7462 (yyval.value).t = (yyvsp[(2) - (2)].value).t;
7472 /* Line 1464 of skeleton.m4 */
7473 #line 3241 "parser.y"
7474 { if(!state->cls->info)
7475 syntaxerror("super keyword not allowed outside a class");
7476 classinfo_t*t = state->cls->info->superclass;
7477 if(!t) t = TYPE_OBJECT;
7479 memberinfo_t*f = registry_findmember(t, (yyvsp[(3) - (3)].id), 1);
7480 namespace_t ns = {f->access, ""};
7481 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
7482 (yyval.value).c = 0;
7483 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7484 (yyval.value).c = abc_getsuper2((yyval.value).c, &m);
7485 (yyval.value).t = slotinfo_gettype((slotinfo_t*)f);
7495 /* Line 1464 of skeleton.m4 */
7496 #line 3255 "parser.y"
7499 (yyval.value).c = abc_pushundefined(0);
7500 (yyval.value).t = 0;
7501 as3_warning("ignored @ operator");
7511 /* Line 1464 of skeleton.m4 */
7512 #line 3262 "parser.y"
7514 // child attribute TODO
7515 (yyval.value).c = abc_pushundefined(0);
7516 (yyval.value).t = 0;
7517 as3_warning("ignored .@ operator");
7527 /* Line 1464 of skeleton.m4 */
7528 #line 3269 "parser.y"
7530 // namespace declaration TODO
7531 (yyval.value).c = abc_pushundefined(0);
7532 (yyval.value).t = 0;
7533 as3_warning("ignored :: operator");
7543 /* Line 1464 of skeleton.m4 */
7544 #line 3276 "parser.y"
7547 (yyval.value).c = abc_pushundefined(0);
7548 (yyval.value).t = 0;
7549 as3_warning("ignored .. operator");
7559 /* Line 1464 of skeleton.m4 */
7560 #line 3283 "parser.y"
7563 (yyval.value).c = abc_pushundefined(0);
7564 (yyval.value).t = 0;
7565 as3_warning("ignored .() operator");
7575 /* Line 1464 of skeleton.m4 */
7576 #line 3295 "parser.y"
7577 {(yyval.value).c = (yyvsp[(1) - (3)].value).c;
7578 classinfo_t*t = (yyvsp[(1) - (3)].value).t;
7580 if(TYPE_IS_CLASS(t) && t->data) {
7585 memberinfo_t*f = registry_findmember(t, (yyvsp[(3) - (3)].id), 1);
7587 if(f && !is_static != !(f->flags&FLAG_STATIC))
7589 if(f && f->slot && !noslot) {
7590 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
7592 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
7593 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7595 /* determine type */
7596 (yyval.value).t = slotinfo_gettype((slotinfo_t*)f);
7597 if(!(yyval.value).t)
7598 (yyval.value).c = abc_coerce_a((yyval.value).c);
7600 /* when resolving a property on an unknown type, we do know the
7601 name of the property (and don't seem to need the package), but
7602 we need to make avm2 try out all access modes */
7603 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
7604 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7605 (yyval.value).c = abc_coerce_a((yyval.value).c);
7606 (yyval.value).t = registry_getanytype();
7617 /* Line 1464 of skeleton.m4 */
7618 #line 3328 "parser.y"
7621 /* Queue unresolved identifiers for checking against the parent
7622 function's variables.
7623 We consider everything which is not a local variable "unresolved".
7624 This encompasses class names, members of the surrounding class
7625 etc. which *correct* because local variables of the parent function
7628 if(state->method->inner && !find_variable(state, (yyvsp[(1) - (1)].id))) {
7629 unknown_variable((yyvsp[(1) - (1)].id));
7633 (yyval.value).t = 0;
7634 (yyval.value).c = 0;
7639 /* look at variables */
7640 if((v = find_variable(state, (yyvsp[(1) - (1)].id)))) {
7641 // $1 is a local variable
7642 (yyval.value).c = abc_getlocal((yyval.value).c, v->index);
7643 (yyval.value).t = v->type;
7647 int i_am_static = (state->method && state->method->info)?(state->method->info->flags&FLAG_STATIC):FLAG_STATIC;
7649 /* look at current class' members */
7650 if(state->cls && (f = registry_findmember(state->cls->info, (yyvsp[(1) - (1)].id), 1)) &&
7651 (f->flags&FLAG_STATIC) >= i_am_static) {
7652 // $1 is a function in this class
7653 int var_is_static = (f->flags&FLAG_STATIC);
7655 if(f->kind == INFOTYPE_METHOD) {
7656 (yyval.value).t = TYPE_FUNCTION(f);
7658 (yyval.value).t = f->type;
7660 if(var_is_static && !i_am_static) {
7661 /* access to a static member from a non-static location.
7662 do this via findpropstrict:
7663 there doesn't seem to be any non-lookup way to access
7664 static properties of a class */
7665 state->method->late_binding = 1;
7666 (yyval.value).t = f->type;
7667 namespace_t ns = {f->access, ""};
7668 multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)};
7669 (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
7670 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7672 } else if(f->slot>0) {
7673 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7674 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
7677 namespace_t ns = {f->access, ""};
7678 multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)};
7679 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7680 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7685 /* look at actual classes, in the current package and imported */
7686 if((a = find_class((yyvsp[(1) - (1)].id)))) {
7687 if(a->access == ACCESS_PACKAGEINTERNAL &&
7688 strcmp(a->package, state->package) &&
7689 strcmp(a->package, internal_filename_package)
7691 syntaxerror("Can't access internal %s %s in package '%s' from package '%s'",
7692 infotypename(a),(yyvsp[(1) - (1)].id), a->package, state->package);
7694 if(a->kind != INFOTYPE_CLASS) {
7696 (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
7697 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7698 if(a->kind == INFOTYPE_METHOD) {
7699 methodinfo_t*f = (methodinfo_t*)a;
7700 (yyval.value).t = TYPE_FUNCTION(f);
7702 varinfo_t*v = (varinfo_t*)a;
7703 (yyval.value).t = v->type;
7706 classinfo_t*c = (classinfo_t*)a;
7708 (yyval.value).c = abc_getglobalscope((yyval.value).c);
7709 (yyval.value).c = abc_getslot((yyval.value).c, c->slot);
7712 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
7714 (yyval.value).t = TYPE_CLASS(c);
7719 /* unknown object, let the avm2 resolve it */
7721 as3_softwarning("Couldn't resolve '%s', doing late binding", (yyvsp[(1) - (1)].id));
7722 state->method->late_binding = 1;
7724 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(1) - (1)].id)};
7726 (yyval.value).t = 0;
7727 (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
7728 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7739 /* Line 1464 of skeleton.m4 */
7740 #line 3443 "parser.y"
7750 /* Line 1464 of skeleton.m4 */
7751 #line 3444 "parser.y"
7761 /* Line 1464 of skeleton.m4 */
7762 #line 3445 "parser.y"
7772 /* Line 1464 of skeleton.m4 */
7773 #line 3447 "parser.y"
7776 tokenizer_register_namespace((yyvsp[(3) - (3)].id));
7785 /* Line 1464 of skeleton.m4 */
7786 #line 7787 "parser.tab.c"
7789 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
7793 YY_STACK_PRINT (yyss, yyssp);
7797 /* Now `shift' the result of the reduction. Determine what state
7798 that goes to, based on the state we popped back to and the rule
7799 number reduced by. */
7803 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
7804 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
7805 yystate = yytable[yystate];
7807 yystate = yydefgoto[yyn - YYNTOKENS];
7812 /*------------------------------------.
7813 | yyerrlab -- here on detecting error |
7814 `------------------------------------*/
7816 /* If not already recovering from an error, report this error. */
7820 #if ! YYERROR_VERBOSE
7821 yyerror (YY_("syntax error"));
7824 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
7825 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
7827 YYSIZE_T yyalloc = 2 * yysize;
7828 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
7829 yyalloc = YYSTACK_ALLOC_MAXIMUM;
7830 if (yymsg != yymsgbuf)
7831 YYSTACK_FREE (yymsg);
7832 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
7834 yymsg_alloc = yyalloc;
7838 yymsg_alloc = sizeof yymsgbuf;
7842 if (0 < yysize && yysize <= yymsg_alloc)
7844 (void) yysyntax_error (yymsg, yystate, yychar);
7849 yyerror (YY_("syntax error"));
7851 goto yyexhaustedlab;
7859 if (yyerrstatus == 3)
7861 /* If just tried and failed to reuse lookahead token after an
7862 error, discard it. */
7864 if (yychar <= YYEOF)
7866 /* Return failure if at end of input. */
7867 if (yychar == YYEOF)
7872 yydestruct ("Error: discarding",
7878 /* Else will try to reuse lookahead token after shifting the error
7883 /*---------------------------------------------------.
7884 | yyerrorlab -- error raised explicitly by YYERROR. |
7885 `---------------------------------------------------*/
7888 /* Pacify compilers like GCC when the user code never invokes
7889 YYERROR and the label yyerrorlab therefore never appears in user
7891 if (/*CONSTCOND*/ 0)
7894 /* Do not reclaim the symbols of the rule which action triggered
7898 YY_STACK_PRINT (yyss, yyssp);
7903 /*-------------------------------------------------------------.
7904 | yyerrlab1 -- common code for both syntax error and YYERROR. |
7905 `-------------------------------------------------------------*/
7907 yyerrstatus = 3; /* Each real token shifted decrements this. */
7911 yyn = yypact[yystate];
7912 if (yyn != YYPACT_NINF)
7915 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
7923 /* Pop the current state because it cannot handle the error token. */
7928 yydestruct ("Error: popping",
7929 yystos[yystate], yyvsp);
7932 YY_STACK_PRINT (yyss, yyssp);
7938 /* Shift the error token. */
7939 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
7945 /*-------------------------------------.
7946 | yyacceptlab -- YYACCEPT comes here. |
7947 `-------------------------------------*/
7952 /*-----------------------------------.
7953 | yyabortlab -- YYABORT comes here. |
7954 `-----------------------------------*/
7959 #if !defined(yyoverflow) || YYERROR_VERBOSE
7960 /*-------------------------------------------------.
7961 | yyexhaustedlab -- memory exhaustion comes here. |
7962 `-------------------------------------------------*/
7964 yyerror (YY_("memory exhausted"));
7970 if (yychar != YYEMPTY)
7971 yydestruct ("Cleanup: discarding lookahead",
7973 /* Do not reclaim the symbols of the rule which action triggered
7974 this YYABORT or YYACCEPT. */
7976 YY_STACK_PRINT (yyss, yyssp);
7977 while (yyssp != yyss)
7979 yydestruct ("Cleanup: popping",
7980 yystos[*yyssp], yyvsp);
7985 YYSTACK_FREE (yyss);
7988 if (yymsg != yymsgbuf)
7989 YYSTACK_FREE (yymsg);
7991 /* Make sure YYID is used. */
7992 return YYID (yyresult);