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"
96 /* Line 198 of skeleton.m4 */
97 #line 98 "parser.tab.c"
99 /* Enabling traces. */
104 /* Enabling verbose error messages. */
105 #ifdef YYERROR_VERBOSE
106 # undef YYERROR_VERBOSE
107 # define YYERROR_VERBOSE 1
109 # define YYERROR_VERBOSE 1
112 /* Enabling the token table. */
113 #ifndef YYTOKEN_TABLE
114 # define YYTOKEN_TABLE 0
121 /* Put the tokens into the symbol table, so that GDB and other debuggers
216 below_semicolon = 350,
217 below_assignment = 351,
219 minusminus_prefix = 355,
220 plusplus_prefix = 356,
222 above_identifier = 358,
230 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
232 /* Line 223 of skeleton.m4 */
237 /* Line 223 of skeleton.m4 */
240 enum yytokentype token;
243 classinfo_t*classinfo;
244 classinfo_list_t*classinfo_list;
247 unsigned int number_uint;
251 //typedcode_list_t*value_list;
252 codeandnumber_t value_list;
258 for_start_t for_start;
259 abc_exception_t *exception;
262 abc_exception_list_t *l;
268 /* Line 223 of skeleton.m4 */
269 #line 270 "parser.tab.c"
271 # define YYSTYPE_IS_TRIVIAL 1
272 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
273 # define YYSTYPE_IS_DECLARED 1
277 /* Copy the second part of user declarations. */
279 /* Line 273 of skeleton.m4 */
283 static int a3_error(char*s)
285 syntaxerror("%s", s);
286 return 0; //make gcc happy
290 static char* concat2(const char* t1, const char* t2)
294 char*text = malloc(l1+l2+1);
295 memcpy(text , t1, l1);
296 memcpy(text+l1, t2, l2);
300 static char* concat3(const char* t1, const char* t2, const char* t3)
305 char*text = malloc(l1+l2+l3+1);
306 memcpy(text , t1, l1);
307 memcpy(text+l1, t2, l2);
308 memcpy(text+l1+l2, t3, l3);
313 typedef struct _import {
317 DECLARE_LIST(import);
319 typedef struct _classstate {
325 char has_constructor;
328 DECLARE_LIST(methodstate);
330 typedef struct _methodstate {
341 int var_index; // for inner methods
343 abc_exception_list_t*exceptions;
345 methodstate_list_t*innerfunctions;
348 typedef struct _state {
353 import_list_t*wildcard_imports;
355 char has_own_imports;
356 char new_vars; // e.g. transition between two functions
359 methodstate_t*method;
366 typedef struct _global {
372 static global_t*global = 0;
373 static state_t* state = 0;
377 #define MULTINAME(m,x) \
380 registry_fill_multiname(&m, &m##_ns, x);
382 #define MEMBER_MULTINAME(m,f,n) \
386 m##_ns = flags2namespace(f->flags, ""); \
389 m.namespace_set = 0; \
392 m.type = MULTINAME; \
394 m.namespace_set = &nopackage_namespace_set; \
398 /* warning: list length of namespace set is undefined */
399 #define MULTINAME_LATE(m, access, package) \
400 namespace_t m##_ns = {access, package}; \
401 namespace_set_t m##_nsset; \
402 namespace_list_t m##_l;m##_l.next = 0; \
403 m##_nsset.namespaces = &m##_l; \
404 m##_nsset = m##_nsset; \
405 m##_l.namespace = &m##_ns; \
406 multiname_t m = {MULTINAMEL, 0, &m##_nsset, 0};
408 static namespace_t ns1 = {ACCESS_PRIVATE, ""};
409 static namespace_t ns2 = {ACCESS_PROTECTED, ""};
410 static namespace_t ns3 = {ACCESS_PACKAGEINTERNAL, ""};
411 static namespace_t ns4 = {ACCESS_PACKAGE, ""};
412 static namespace_list_t nl4 = {&ns4,0};
413 static namespace_list_t nl3 = {&ns3,&nl4};
414 static namespace_list_t nl2 = {&ns2,&nl3};
415 static namespace_list_t nl1 = {&ns1,&nl2};
416 static namespace_set_t nopackage_namespace_set = {&nl1};
418 static void new_state()
421 state_t*oldstate = state;
423 memcpy(s, state, sizeof(state_t)); //shallow copy
425 s->imports = dict_new();
429 state->has_own_imports = 0;
430 state->vars = dict_new();
431 state->old = oldstate;
433 static void state_has_imports()
435 state->wildcard_imports = list_clone(state->wildcard_imports);
436 state->imports = dict_clone(state->imports);
437 state->has_own_imports = 1;
440 static void state_destroy(state_t*state)
442 if(state->has_own_imports) {
443 list_free(state->wildcard_imports);
444 dict_destroy(state->imports);state->imports=0;
446 if(state->imports && (!state->old || state->old->imports!=state->imports)) {
447 dict_destroy(state->imports);state->imports=0;
451 for(t=0;t<state->vars->hashsize;t++) {
452 dictentry_t*e =state->vars->slots[t];
454 free(e->data);e->data=0;
458 dict_destroy(state->vars);state->vars=0;
464 static void old_state()
466 if(!state || !state->old)
467 syntaxerror("invalid nesting");
468 state_t*leaving = state;
472 if(as3_pass>1 && leaving->method && leaving->method != state->method && !leaving->method->inner) {
473 free(leaving->method);
476 if(leaving->cls && leaving->cls != state->cls) {
481 state_destroy(leaving);
484 void initialize_file(char*filename)
487 state->package = filename;
489 state->method = rfx_calloc(sizeof(methodstate_t));
490 state->method->variable_count = 1;
495 if(!state || state->level!=1) {
496 syntaxerror("unexpected end of file in pass %d", as3_pass);
498 state_destroy(state);state=0;
501 void initialize_parser()
503 global = rfx_calloc(sizeof(global_t));
504 global->file = abc_file_new();
505 global->file->flags &= ~ABCFILE_LAZY;
506 global->token2info = dict_new2(&ptr_type);
508 global->init = abc_initscript(global->file);
509 code_t*c = global->init->method->body->code;
510 c = abc_getlocal_0(c);
511 c = abc_pushscope(c);
512 global->init->method->body->code = c;
515 void* finish_parser()
517 code_t*c = global->init->method->body->code;
518 /*c = abc_findpropstrict(c, "[package]::trace");
519 c = abc_pushstring(c, "[leaving global init function]");
520 c = abc_callpropvoid(c, "[package]::trace", 1);*/
521 c = abc_returnvoid(c);
522 global->init->method->body->code = c;
523 dict_destroy(global->token2info);global->token2info=0;
528 static void xx_scopetest()
530 /* findpropstrict doesn't just return a scope object- it
531 also makes it "active" somehow. Push local_0 on the
532 scope stack and read it back with findpropstrict, it'll
533 contain properties like "trace". Trying to find the same
534 property on a "vanilla" local_0 yields only a "undefined" */
535 //c = abc_findpropstrict(c, "[package]::trace");
537 /*c = abc_getlocal_0(c);
538 c = abc_findpropstrict(c, "[package]::trace");
540 c = abc_setlocal_1(c);
542 c = abc_pushbyte(c, 0);
543 c = abc_setlocal_2(c);
545 code_t*xx = c = abc_label(c);
546 c = abc_findpropstrict(c, "[package]::trace");
547 c = abc_pushstring(c, "prop:");
548 c = abc_hasnext2(c, 1, 2);
550 c = abc_setlocal_3(c);
551 c = abc_callpropvoid(c, "[package]::trace", 2);
552 c = abc_getlocal_3(c);
554 c = abc_iftrue(c,xx);*/
558 typedef struct _variable {
564 static variable_t* find_variable(char*name)
570 v = dict_lookup(s->vars, name);
580 static variable_t* find_variable_safe(char*name)
582 variable_t* v = find_variable(name);
584 syntaxerror("undefined variable: %s", name);
587 static char variable_exists(char*name)
589 return dict_lookup(state->vars, name)!=0;
591 code_t*defaultvalue(code_t*c, classinfo_t*type);
592 static int new_variable(const char*name, classinfo_t*type, char init)
595 v->index = state->method->variable_count;
599 dict_put(state->vars, name, v);
601 return state->method->variable_count++;
603 #define TEMPVARNAME "__as3_temp__"
604 static int gettempvar()
606 variable_t*v = find_variable(TEMPVARNAME);
609 return new_variable(TEMPVARNAME, 0, 0);
612 code_t* var_block(code_t*body)
618 for(t=0;t<state->vars->hashsize;t++) {
619 dictentry_t*e = state->vars->slots[t];
621 variable_t*v = (variable_t*)e->data;
622 if(v->type && v->init) {
623 c = defaultvalue(c, v->type);
624 c = abc_setlocal(c, v->index);
625 k = abc_kill(k, v->index);
635 if(x->opcode== OPCODE___BREAK__ ||
636 x->opcode== OPCODE___CONTINUE__) {
637 /* link kill code before break/continue */
638 code_t*e = code_dup(k);
639 code_t*s = code_start(e);
651 c = code_append(c, body);
652 c = code_append(c, k);
656 static code_t* wrap_function(code_t*c,code_t*header, code_t*body)
658 c = code_append(c, header);
659 c = code_append(c, var_block(body));
660 /* append return if necessary */
661 if(!c || (c->opcode != OPCODE_RETURNVOID &&
662 c->opcode != OPCODE_RETURNVALUE)) {
663 c = abc_returnvoid(c);
669 static void startpackage(char*name)
672 /*printf("entering package \"%s\"\n", name);*/
673 state->package = strdup(name);
675 static void endpackage()
677 /*printf("leaving package \"%s\"\n", state->package);*/
679 //used e.g. in classinfo_register:
680 //free(state->package);state->package=0;
685 #define _TRACE_ {printf("vfw: %s: %d (%s)\n",__FILE__,__LINE__,__func__);fflush(stdout);}
686 #define parserassert(b) {if(!(b)) parsererror(__FILE__, __LINE__,__func__);}
688 static void parsererror(const char*file, int line, const char*f)
690 syntaxerror("internal error in %s, %s:%d", f, file, line);
694 char*as3_globalclass=0;
695 static void startclass(int flags, char*classname, classinfo_t*extends, classinfo_list_t*implements, char interface)
698 syntaxerror("inner classes now allowed");
701 state->cls = rfx_calloc(sizeof(classstate_t));
702 state->method = rfx_calloc(sizeof(methodstate_t)); // method state, for static constructor
703 state->method->variable_count = 1;
706 classinfo_list_t*mlist=0;
708 if(flags&~(FLAG_PACKAGEINTERNAL|FLAG_PUBLIC|FLAG_FINAL|FLAG_DYNAMIC))
709 syntaxerror("invalid modifier(s)");
711 if((flags&(FLAG_PUBLIC|FLAG_PACKAGEINTERNAL)) == (FLAG_PUBLIC|FLAG_PACKAGEINTERNAL))
712 syntaxerror("public and internal not supported at the same time.");
714 /* create the class name, together with the proper attributes */
718 if(!(flags&FLAG_PUBLIC) && !state->package) {
719 access = ACCESS_PRIVATE; package = current_filename;
720 } else if(!(flags&FLAG_PUBLIC) && state->package) {
721 access = ACCESS_PACKAGEINTERNAL; package = state->package;
722 } else if(state->package) {
723 access = ACCESS_PACKAGE; package = state->package;
725 syntaxerror("public classes only allowed inside a package");
729 if(registry_findclass(package, classname)) {
730 syntaxerror("Package \"%s\" already contains a class called \"%s\"", package, classname);
732 /* build info struct */
733 int num_interfaces = (list_length(implements));
734 state->cls->info = classinfo_register(access, package, classname, num_interfaces);
738 state->cls->info = registry_findclass(package, classname);
739 parserassert((int)state->cls->info);
741 /* fill out interfaces and extends (we couldn't resolve those during the first pass) */
742 state->cls->info->superclass = extends?extends:TYPE_OBJECT;
744 classinfo_list_t*l = implements;
745 for(l=implements;l;l=l->next) {
746 state->cls->info->interfaces[pos++] = l->classinfo;
749 /* generate the abc code for this class */
750 MULTINAME(classname2,state->cls->info);
751 multiname_t*extends2 = sig2mname(extends);
753 state->cls->abc = abc_class_new(global->file, &classname2, extends2);
754 if(flags&FLAG_FINAL) abc_class_final(state->cls->abc);
755 if(!(flags&FLAG_DYNAMIC)) abc_class_sealed(state->cls->abc);
757 state->cls->info->flags |= CLASS_INTERFACE;
758 abc_class_interface(state->cls->abc);
761 abc_class_protectedNS(state->cls->abc, classname);
763 for(mlist=implements;mlist;mlist=mlist->next) {
764 MULTINAME(m, mlist->classinfo);
765 abc_class_add_interface(state->cls->abc, &m);
768 /* write the construction code for this class to the global init
770 int slotindex = abc_initscript_addClassTrait(global->init, &classname2, state->cls->abc);
772 abc_method_body_t*m = global->init->method->body;
773 __ getglobalscope(m);
774 classinfo_t*s = extends;
779 //TODO: take a look at the current scope stack, maybe
780 // we can re-use something
785 multiname_t*s2 = sig2mname(s);
787 multiname_destroy(s2);
789 __ pushscope(m); count++;
790 m->code = m->code->prev->prev; // invert
792 /* continue appending after last op end */
793 while(m->code && m->code->next) m->code = m->code->next;
795 /* TODO: if this is one of *our* classes, we can also
796 do a getglobalscope/getslot <nr> (which references
797 the init function's slots) */
799 __ getlex2(m, extends2);
801 /* notice: we get a Verify Error #1107 if the top elemnt on the scope
802 stack is not the superclass */
803 __ pushscope(m);count++;
806 /* notice: we get a verify error #1107 if the top element on the scope
807 stack is not the global object */
809 __ pushscope(m);count++;
811 __ newclass(m,state->cls->abc);
815 __ setslot(m, slotindex);
816 multiname_destroy(extends2);
818 /* flash.display.MovieClip handling */
820 if(!as3_globalclass && (flags&FLAG_PUBLIC) && classinfo_equals(registry_getMovieClip(),extends)) {
821 if(state->package && state->package[0]) {
822 as3_globalclass = concat3(state->package, ".", classname);
824 as3_globalclass = strdup(classname);
830 static void endclass()
833 if(!state->cls->has_constructor && !(state->cls->info->flags&CLASS_INTERFACE)) {
835 c = abc_getlocal_0(c);
836 c = abc_constructsuper(c, 0);
837 state->cls->init = code_append(state->cls->init, c);
839 if(!state->method->late_binding) {
840 // class initialization code uses late binding
842 c = abc_getlocal_0(c);
843 c = abc_pushscope(c);
844 state->cls->static_init = code_append(c, state->cls->static_init);
847 if(state->cls->init) {
848 abc_method_t*m = abc_class_getconstructor(state->cls->abc, 0);
849 m->body->code = wrap_function(0, state->cls->init, m->body->code);
851 if(state->cls->static_init) {
852 abc_method_t*m = abc_class_getstaticconstructor(state->cls->abc, 0);
853 m->body->code = wrap_function(0, state->cls->static_init, m->body->code);
860 void check_code_for_break(code_t*c)
863 if(c->opcode == OPCODE___BREAK__) {
864 char*name = string_cstr(c->data[0]);
865 syntaxerror("Unresolved \"break %s\"", name);
867 if(c->opcode == OPCODE___CONTINUE__) {
868 char*name = string_cstr(c->data[0]);
869 syntaxerror("Unresolved \"continue %s\"", name);
876 static void check_constant_against_type(classinfo_t*t, constant_t*c)
878 #define xassert(b) if(!(b)) syntaxerror("Invalid default value %s for type '%s'", constant_tostring(c), t->name)
879 if(TYPE_IS_NUMBER(t)) {
880 xassert(c->type == CONSTANT_FLOAT
881 || c->type == CONSTANT_INT
882 || c->type == CONSTANT_UINT);
883 } else if(TYPE_IS_UINT(t)) {
884 xassert(c->type == CONSTANT_UINT ||
885 (c->type == CONSTANT_INT && c->i>0));
886 } else if(TYPE_IS_INT(t)) {
887 xassert(c->type == CONSTANT_INT);
888 } else if(TYPE_IS_BOOLEAN(t)) {
889 xassert(c->type == CONSTANT_TRUE
890 || c->type == CONSTANT_FALSE);
895 static int flags2access(int flags)
898 if(flags&FLAG_PUBLIC) {
899 if(access&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
900 syntaxerror("invalid combination of access levels");
901 access = ACCESS_PACKAGE;
902 } else if(flags&FLAG_PRIVATE) {
903 if(access&(FLAG_PUBLIC|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
904 syntaxerror("invalid combination of access levels");
905 access = ACCESS_PRIVATE;
906 } else if(flags&FLAG_PROTECTED) {
907 if(access&(FLAG_PUBLIC|FLAG_PRIVATE|FLAG_PACKAGEINTERNAL))
908 syntaxerror("invalid combination of access levels");
909 access = ACCESS_PROTECTED;
911 access = ACCESS_PACKAGEINTERNAL;
917 static memberinfo_t*registerfunction(enum yytokentype getset, int flags, char*name, params_t*params, classinfo_t*return_type, int slot)
919 memberinfo_t*minfo = 0;
922 minfo = memberinfo_register_global(flags2access(flags), state->package, name, MEMBER_METHOD);
923 minfo->return_type = return_type;
924 } else if(getset != KW_GET && getset != KW_SET) {
926 if((minfo = registry_findmember(state->cls->info, name, 0))) {
927 if(minfo->parent == state->cls->info) {
928 syntaxerror("class already contains a member/method called '%s'", name);
929 } else if(!minfo->parent) {
930 syntaxerror("internal error: overriding method %s, which doesn't have parent", name);
932 if(!(minfo->flags&(FLAG_STATIC|FLAG_PRIVATE)))
933 syntaxerror("function %s already exists in superclass. Did you forget the 'override' keyword?");
936 minfo = memberinfo_register(state->cls->info, name, MEMBER_METHOD);
937 minfo->return_type = return_type;
938 // getslot on a member slot only returns "undefined", so no need
939 // to actually store these
940 //state->minfo->slot = state->method->abc->method->trait->slot_id;
942 //class getter/setter
943 int gs = getset==KW_GET?MEMBER_GET:MEMBER_SET;
947 else if(params->list && params->list->param)
948 type = params->list->param->type;
949 // not sure wether to look into superclasses here, too
950 if((minfo=registry_findmember(state->cls->info, name, 0))) {
951 if(minfo->kind & ~(MEMBER_GET|MEMBER_SET))
952 syntaxerror("class already contains a member or method called '%s'", name);
954 syntaxerror("getter/setter for '%s' already defined", name);
955 /* make a setter or getter into a getset */
960 if(type && minfo->type != type)
961 syntaxerror("different type in getter and setter");
963 minfo = memberinfo_register(state->cls->info, name, gs);
966 /* can't assign a slot as getter and setter might have different slots */
967 //minfo->slot = slot;
969 if(flags&FLAG_STATIC) minfo->flags |= FLAG_STATIC;
970 if(flags&FLAG_PUBLIC) minfo->flags |= FLAG_PUBLIC;
971 if(flags&FLAG_PRIVATE) minfo->flags |= FLAG_PRIVATE;
972 if(flags&FLAG_PROTECTED) minfo->flags |= FLAG_PROTECTED;
973 if(flags&FLAG_PACKAGEINTERNAL) minfo->flags |= FLAG_PACKAGEINTERNAL;
974 if(flags&FLAG_OVERRIDE) minfo->flags |= FLAG_OVERRIDE;
978 static void function_initvars(params_t*params, int flags)
980 if(state->method->inner)
981 new_variable("this", 0, 0);
982 else if(!state->method->is_global)
983 new_variable((flags&FLAG_STATIC)?"class":"this", state->cls->info, 0);
985 new_variable("globalscope", 0, 0);
988 for(p=params->list;p;p=p->next) {
989 new_variable(p->param->name, p->param->type, 0);
992 methodstate_list_t*l = state->method->innerfunctions;
994 methodstate_t*m = l->methodstate;
995 m->var_index = new_variable(m->info->name, TYPE_FUNCTION(m->info), 0);
1000 static void innerfunction(char*name, params_t*params, classinfo_t*return_type)
1002 parserassert(state->method && state->method->info);
1004 methodstate_t*parent_method = state->method;
1013 state->new_vars = 1;
1016 state->method = rfx_calloc(sizeof(methodstate_t));
1017 state->method->inner = 1;
1018 state->method->variable_count = 0;
1019 state->method->abc = rfx_calloc(sizeof(abc_method_t));
1021 NEW(memberinfo_t,minfo);
1023 state->method->info = minfo;
1025 list_append(parent_method->innerfunctions, state->method);
1027 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1031 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1032 parserassert(state->method);
1034 state->method->info->return_type = return_type;
1035 function_initvars(params, 0);
1039 static void startfunction(token_t*ns, int flags, enum yytokentype getset, char*name,
1040 params_t*params, classinfo_t*return_type)
1042 if(state->method && state->method->info) {
1043 syntaxerror("not able to start another method scope");
1048 state->method = rfx_calloc(sizeof(methodstate_t));
1049 state->method->has_super = 0;
1050 state->method->variable_count = 0;
1053 state->method->is_constructor = !strcmp(state->cls->info->name,name);
1055 state->method->is_global = 1;
1056 state->method->late_binding = 1; // for global methods, always push local_0 on the scope stack
1058 if(state->method->is_constructor)
1059 name = "__as3_constructor__";
1062 state->method->info = registerfunction(getset, flags, name, params, return_type, 0);
1064 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1068 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1069 parserassert(state->method);
1072 state->cls->has_constructor |= state->method->is_constructor;
1075 state->method->info->return_type = return_type;
1076 function_initvars(params, flags);
1080 static abc_method_t* endfunction(token_t*ns, int flags, enum yytokentype getset, char*name,
1081 params_t*params, classinfo_t*return_type, code_t*body)
1090 multiname_t*type2 = sig2mname(return_type);
1092 if(state->method->inner) {
1093 f = state->method->abc;
1094 abc_method_init(f, global->file, type2, 1);
1095 } else if(state->method->is_constructor) {
1096 f = abc_class_getconstructor(state->cls->abc, type2);
1097 } else if(!state->method->is_global) {
1098 namespace_t mname_ns = flags2namespace(flags, "");
1099 multiname_t mname = {QNAME, &mname_ns, 0, name};
1101 if(flags&FLAG_STATIC)
1102 f = abc_class_staticmethod(state->cls->abc, type2, &mname);
1104 f = abc_class_method(state->cls->abc, type2, &mname);
1105 slot = f->trait->slot_id;
1107 namespace_t mname_ns = flags2namespace(flags, state->package);
1108 multiname_t mname = {QNAME, &mname_ns, 0, name};
1110 f = abc_method_new(global->file, type2, 1);
1111 trait_t*t = trait_new_method(&global->init->traits, multiname_clone(&mname), f);
1112 //abc_code_t*c = global->init->method->body->code;
1114 //flash doesn't seem to allow us to access function slots
1115 //state->method->info->slot = slot;
1117 if(flags&FLAG_OVERRIDE) f->trait->attributes |= TRAIT_ATTR_OVERRIDE;
1118 if(getset == KW_GET) f->trait->kind = TRAIT_GETTER;
1119 if(getset == KW_SET) f->trait->kind = TRAIT_SETTER;
1120 if(params->varargs) f->flags |= METHOD_NEED_REST;
1124 for(p=params->list;p;p=p->next) {
1125 if(params->varargs && !p->next) {
1126 break; //varargs: omit last parameter in function signature
1128 multiname_t*m = sig2mname(p->param->type);
1129 list_append(f->parameters, m);
1130 if(p->param->value) {
1131 check_constant_against_type(p->param->type, p->param->value);
1132 opt=1;list_append(f->optional_parameters, p->param->value);
1134 syntaxerror("non-optional parameter not allowed after optional parameters");
1137 check_code_for_break(body);
1140 f->body->code = body;
1141 f->body->exceptions = state->method->exceptions;
1142 } else { //interface
1144 syntaxerror("interface methods can't have a method body");
1151 char is_subtype_of(classinfo_t*type, classinfo_t*supertype)
1156 void breakjumpsto(code_t*c, char*name, code_t*jump)
1159 if(c->opcode == OPCODE___BREAK__) {
1160 string_t*name2 = c->data[0];
1161 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1162 c->opcode = OPCODE_JUMP;
1169 void continuejumpsto(code_t*c, char*name, code_t*jump)
1172 if(c->opcode == OPCODE___CONTINUE__) {
1173 string_t*name2 = c->data[0];
1174 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1175 c->opcode = OPCODE_JUMP;
1183 #define IS_INT(a) (TYPE_IS_INT((a)) || TYPE_IS_UINT((a)))
1184 #define IS_NUMBER_OR_INT(a) (TYPE_IS_INT((a)) || TYPE_IS_UINT((a)) || TYPE_IS_NUMBER((a)))
1185 #define BOTH_INT(a,b) (IS_INT(a) && IS_INT(b))
1187 classinfo_t*join_types(classinfo_t*type1, classinfo_t*type2, char op)
1189 if(!type1 || !type2)
1190 return registry_getanytype();
1191 if(TYPE_IS_ANY(type1) || TYPE_IS_ANY(type2))
1192 return registry_getanytype();
1195 if(IS_NUMBER_OR_INT(type1) && IS_NUMBER_OR_INT(type2)) {
1204 return registry_getanytype();
1206 code_t*converttype(code_t*c, classinfo_t*from, classinfo_t*to)
1211 return abc_coerce_a(c);
1215 // cast an "any" type to a specific type. subject to
1216 // runtime exceptions
1217 return abc_coerce2(c, &m);
1220 if((TYPE_IS_NUMBER(from) || TYPE_IS_UINT(from) || TYPE_IS_INT(from)) &&
1221 (TYPE_IS_NUMBER(to) || TYPE_IS_UINT(to) || TYPE_IS_INT(to))) {
1222 // allow conversion between number types
1223 return abc_coerce2(c, &m);
1225 //printf("%s.%s\n", from.package, from.name);
1226 //printf("%s.%s\n", to.package, to.name);
1228 classinfo_t*supertype = from;
1230 if(supertype == to) {
1231 // target type is one of from's superclasses
1232 return abc_coerce2(c, &m);
1235 while(supertype->interfaces[t]) {
1236 if(supertype->interfaces[t]==to) {
1237 // target type is one of from's interfaces
1238 return abc_coerce2(c, &m);
1242 supertype = supertype->superclass;
1244 if(TYPE_IS_FUNCTION(from) && TYPE_IS_FUNCTION(to))
1246 if(TYPE_IS_CLASS(from) && TYPE_IS_CLASS(to))
1248 syntaxerror("can't convert type %s to %s", from->name, to->name);
1249 return 0; // make gcc happy
1252 code_t*defaultvalue(code_t*c, classinfo_t*type)
1254 if(TYPE_IS_INT(type)) {
1255 c = abc_pushbyte(c, 0);
1256 } else if(TYPE_IS_UINT(type)) {
1257 c = abc_pushuint(c, 0);
1258 } else if(TYPE_IS_FLOAT(type)) {
1260 } else if(TYPE_IS_BOOLEAN(type)) {
1261 c = abc_pushfalse(c);
1263 //c = abc_pushundefined(c);
1265 c = abc_pushnull(c);
1267 c = abc_coerce2(c, &m);
1272 char is_pushundefined(code_t*c)
1274 return (c && !c->prev && !c->next && c->opcode == OPCODE_PUSHUNDEFINED);
1277 static classinfo_t* find_class(char*name)
1281 c = registry_findclass(state->package, name);
1284 /* try explicit imports */
1285 dictentry_t* e = dict_get_slot(state->imports, name);
1288 if(!strcmp(e->key, name)) {
1289 c = (classinfo_t*)e->data;
1295 /* try package.* imports */
1296 import_list_t*l = state->wildcard_imports;
1298 //printf("does package %s contain a class %s?\n", l->import->package, name);
1299 c = registry_findclass(l->import->package, name);
1304 /* try global package */
1305 c = registry_findclass("", name);
1308 /* try local "filename" package */
1309 c = registry_findclass(current_filename_short, name);
1315 static char is_getlocal(code_t*c)
1317 if(!c || c->prev || c->next)
1319 return(c->opcode == OPCODE_GETLOCAL
1320 || c->opcode == OPCODE_GETLOCAL_0
1321 || c->opcode == OPCODE_GETLOCAL_1
1322 || c->opcode == OPCODE_GETLOCAL_2
1323 || c->opcode == OPCODE_GETLOCAL_3);
1325 static int getlocalnr(code_t*c)
1327 if(c->opcode == OPCODE_GETLOCAL) {return (ptroff_t)c->data[0];}
1328 else if(c->opcode == OPCODE_GETLOCAL_0) {return 0;}
1329 else if(c->opcode == OPCODE_GETLOCAL_1) {return 1;}
1330 else if(c->opcode == OPCODE_GETLOCAL_2) {return 2;}
1331 else if(c->opcode == OPCODE_GETLOCAL_3) {return 3;}
1332 else syntaxerror("Internal error: opcode %02x is not a getlocal call", c->opcode);
1336 static code_t* toreadwrite(code_t*in, code_t*middlepart, char justassign, char readbefore)
1340 [prefix code] [read instruction]
1344 [prefix code] ([dup]) [read instruction] [middlepart] [setvar] [write instruction] [getvar]
1347 if(in && in->opcode == OPCODE_COERCE_A) {
1348 in = code_cutlast(in);
1351 syntaxerror("internal error");
1353 /* chop off read instruction */
1357 prefix = r->prev;r->prev = 0;
1363 char use_temp_var = readbefore;
1365 /* generate the write instruction, and maybe append a dup to the prefix code */
1366 code_t* write = abc_nop(0);
1367 if(r->opcode == OPCODE_GETPROPERTY) {
1368 write->opcode = OPCODE_SETPROPERTY;
1369 multiname_t*m = (multiname_t*)r->data[0];
1370 write->data[0] = multiname_clone(m);
1371 if(m->type == QNAME || m->type == MULTINAME) {
1373 prefix = abc_dup(prefix); // we need the object, too
1376 } else if(m->type == MULTINAMEL) {
1378 /* dupping two values on the stack requires 5 operations and one register-
1379 couldn't adobe just have given us a dup2? */
1380 int temp = gettempvar();
1381 prefix = abc_setlocal(prefix, temp);
1382 prefix = abc_dup(prefix);
1383 prefix = abc_getlocal(prefix, temp);
1384 prefix = abc_swap(prefix);
1385 prefix = abc_getlocal(prefix, temp);
1387 prefix = abc_kill(prefix, temp);
1391 syntaxerror("illegal lvalue: can't assign a value to this expression (not a qname/multiname)");
1393 } else if(r->opcode == OPCODE_GETSLOT) {
1394 write->opcode = OPCODE_SETSLOT;
1395 write->data[0] = r->data[0];
1397 prefix = abc_dup(prefix); // we need the object, too
1400 } else if(r->opcode == OPCODE_GETLOCAL) {
1401 write->opcode = OPCODE_SETLOCAL;
1402 write->data[0] = r->data[0];
1403 } else if(r->opcode == OPCODE_GETLOCAL_0) {
1404 write->opcode = OPCODE_SETLOCAL_0;
1405 } else if(r->opcode == OPCODE_GETLOCAL_1) {
1406 write->opcode = OPCODE_SETLOCAL_1;
1407 } else if(r->opcode == OPCODE_GETLOCAL_2) {
1408 write->opcode = OPCODE_SETLOCAL_2;
1409 } else if(r->opcode == OPCODE_GETLOCAL_3) {
1410 write->opcode = OPCODE_SETLOCAL_3;
1413 syntaxerror("illegal lvalue: can't assign a value to this expression");
1420 /* with getproperty/getslot, we have to be extra careful not
1421 to execute the read code twice, as it might have side-effects
1422 (e.g. if the property is in fact a setter/getter combination)
1424 So read the value, modify it, and write it again,
1425 using prefix only once and making sure (by using a temporary
1426 register) that the return value is what we just wrote */
1427 temp = gettempvar();
1428 c = code_append(c, prefix);
1429 c = code_append(c, r);
1432 c = abc_setlocal(c, temp);
1434 c = code_append(c, middlepart);
1437 c = abc_setlocal(c, temp);
1439 c = code_append(c, write);
1440 c = abc_getlocal(c, temp);
1441 c = abc_kill(c, temp);
1443 /* if we're allowed to execute the read code twice *and*
1444 the middlepart doesn't modify the code, things are easier.
1446 code_t* r2 = code_dup(r);
1447 //c = code_append(c, prefix);
1448 parserassert(!prefix);
1449 c = code_append(c, r);
1450 c = code_append(c, middlepart);
1451 c = code_append(c, write);
1452 c = code_append(c, r2);
1455 /* even smaller version: overwrite the value without reading
1459 c = code_append(c, prefix);
1462 c = code_append(c, middlepart);
1463 c = code_append(c, write);
1464 c = code_append(c, r);
1466 temp = gettempvar();
1468 c = code_append(c, prefix);
1470 c = code_append(c, middlepart);
1472 c = abc_setlocal(c, temp);
1473 c = code_append(c, write);
1474 c = abc_getlocal(c, temp);
1475 c = abc_kill(c, temp);
1481 char is_break_or_jump(code_t*c)
1485 if(c->opcode == OPCODE_JUMP ||
1486 c->opcode == OPCODE___BREAK__ ||
1487 c->opcode == OPCODE___CONTINUE__ ||
1488 c->opcode == OPCODE_THROW ||
1489 c->opcode == OPCODE_RETURNVOID ||
1490 c->opcode == OPCODE_RETURNVALUE) {
1497 #define IS_FINALLY_TARGET(op) \
1498 ((op) == OPCODE___CONTINUE__ || \
1499 (op) == OPCODE___BREAK__ || \
1500 (op) == OPCODE_RETURNVOID || \
1501 (op) == OPCODE_RETURNVALUE || \
1502 (op) == OPCODE___RETHROW__)
1504 static code_t* insert_finally_lookup(code_t*c, code_t*finally, int tempvar)
1506 #define NEED_EXTRA_STACK_ARG
1507 code_t*finally_label = abc_nop(0);
1508 NEW(lookupswitch_t, l);
1514 code_t*prev = i->prev;
1515 if(IS_FINALLY_TARGET(i->opcode)) {
1518 if(i->opcode == OPCODE___RETHROW__ ||
1519 i->opcode == OPCODE_RETURNVALUE) {
1520 if(i->opcode == OPCODE___RETHROW__)
1521 i->opcode = OPCODE_THROW;
1523 p = abc_coerce_a(p);
1524 p = abc_setlocal(p, tempvar);
1526 p = abc_pushbyte(p, count++);
1527 p = abc_jump(p, finally_label);
1528 code_t*target = p = abc_label(p);
1529 #ifdef NEED_EXTRA_STACK_ARG
1533 p = abc_getlocal(p, tempvar);
1536 p->next = i;i->prev = p;
1537 list_append(l->targets, target);
1543 c = abc_pushbyte(c, -1);
1544 c = code_append(c, finally_label);
1545 c = code_append(c, finally);
1547 #ifdef NEED_EXTRA_STACK_ARG
1550 c = abc_lookupswitch(c, l);
1551 c = l->def = abc_label(c);
1552 #ifdef NEED_EXTRA_STACK_ARG
1559 static code_t* insert_finally_simple(code_t*c, code_t*finally, int tempvar)
1563 code_t*prev = i->prev;
1564 if(IS_FINALLY_TARGET(i->opcode)) {
1565 if(i->opcode == OPCODE___RETHROW__)
1566 i->opcode = OPCODE_THROW;
1567 code_t*end = code_dup(finally);
1568 code_t*start = code_start(end);
1569 if(prev) prev->next = start;
1576 return code_append(c, finally);
1579 code_t* insert_finally(code_t*c, code_t*finally, int tempvar)
1585 int num_insertion_points=0;
1587 if(IS_FINALLY_TARGET(i->opcode))
1588 num_insertion_points++;
1595 if(i->branch || i->opcode == OPCODE_LOOKUPSWITCH) {
1600 int simple_version_cost = (1+num_insertion_points)*code_size;
1601 int lookup_version_cost = 4*num_insertion_points + 5;
1603 if(cantdup || simple_version_cost > lookup_version_cost) {
1604 printf("lookup %d > *%d*\n", simple_version_cost, lookup_version_cost);
1605 return insert_finally_lookup(c, finally, tempvar);
1607 printf("simple *%d* < %d\n", simple_version_cost, lookup_version_cost);
1608 return insert_finally_simple(c, finally, tempvar);
1612 #define PASS1 }} if(as3_pass == 1) {{
1613 #define PASS1END }} if(as3_pass == 2) {{
1614 #define PASS2 }} if(as3_pass == 2) {{
1615 #define PASS12 }} {{
1616 #define PASS12END }} if(as3_pass == 2) {{
1620 /* Line 273 of skeleton.m4 */
1621 #line 1622 "parser.tab.c"
1628 typedef YYTYPE_UINT8 yytype_uint8;
1630 typedef unsigned char yytype_uint8;
1634 typedef YYTYPE_INT8 yytype_int8;
1635 #elif (defined __STDC__ || defined __C99__FUNC__ \
1636 || defined __cplusplus || defined _MSC_VER)
1637 typedef signed char yytype_int8;
1639 typedef short int yytype_int8;
1642 #ifdef YYTYPE_UINT16
1643 typedef YYTYPE_UINT16 yytype_uint16;
1645 typedef unsigned short int yytype_uint16;
1649 typedef YYTYPE_INT16 yytype_int16;
1651 typedef short int yytype_int16;
1655 # ifdef __SIZE_TYPE__
1656 # define YYSIZE_T __SIZE_TYPE__
1657 # elif defined size_t
1658 # define YYSIZE_T size_t
1659 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
1660 || defined __cplusplus || defined _MSC_VER)
1661 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1662 # define YYSIZE_T size_t
1664 # define YYSIZE_T unsigned int
1668 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
1673 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1674 # define YY_(msgid) dgettext ("bison-runtime", msgid)
1678 # define YY_(msgid) msgid
1682 /* Suppress unused-variable warnings by "using" E. */
1683 #if ! defined lint || defined __GNUC__
1684 # define YYUSE(e) ((void) (e))
1686 # define YYUSE(e) /* empty */
1689 /* Identity function, used to suppress warnings about constant conditions. */
1691 # define YYID(n) (n)
1693 #if (defined __STDC__ || defined __C99__FUNC__ \
1694 || defined __cplusplus || defined _MSC_VER)
1707 #if ! defined yyoverflow || YYERROR_VERBOSE
1709 /* The parser invokes alloca or malloc; define the necessary symbols. */
1711 # ifdef YYSTACK_USE_ALLOCA
1712 # if YYSTACK_USE_ALLOCA
1714 # define YYSTACK_ALLOC __builtin_alloca
1715 # elif defined __BUILTIN_VA_ARG_INCR
1716 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1718 # define YYSTACK_ALLOC __alloca
1719 # elif defined _MSC_VER
1720 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1721 # define alloca _alloca
1723 # define YYSTACK_ALLOC alloca
1724 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1725 || defined __cplusplus || defined _MSC_VER)
1726 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1728 # define _STDLIB_H 1
1735 # ifdef YYSTACK_ALLOC
1736 /* Pacify GCC's `empty if-body' warning. */
1737 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
1738 # ifndef YYSTACK_ALLOC_MAXIMUM
1739 /* The OS might guarantee only one guard page at the bottom of the stack,
1740 and a page size can be as small as 4096 bytes. So we cannot safely
1741 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1742 to allow for a few compiler-allocated temporary stack slots. */
1743 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1746 # define YYSTACK_ALLOC YYMALLOC
1747 # define YYSTACK_FREE YYFREE
1748 # ifndef YYSTACK_ALLOC_MAXIMUM
1749 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1751 # if (defined __cplusplus && ! defined _STDLIB_H \
1752 && ! ((defined YYMALLOC || defined malloc) \
1753 && (defined YYFREE || defined free)))
1754 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1756 # define _STDLIB_H 1
1760 # define YYMALLOC malloc
1761 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1762 || defined __cplusplus || defined _MSC_VER)
1763 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1767 # define YYFREE free
1768 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1769 || defined __cplusplus || defined _MSC_VER)
1770 void free (void *); /* INFRINGES ON USER NAME SPACE */
1774 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1777 #if (! defined yyoverflow \
1778 && (! defined __cplusplus \
1779 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1781 /* A type that is properly aligned for any stack member. */
1784 yytype_int16 yyss_alloc;
1788 /* The size of the maximum gap between one aligned stack and the next. */
1789 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1791 /* The size of an array large to enough to hold all stacks, each with
1793 # define YYSTACK_BYTES(N) \
1794 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1795 + YYSTACK_GAP_MAXIMUM)
1797 /* Copy COUNT objects from FROM to TO. The source and destination do
1800 # if defined __GNUC__ && 1 < __GNUC__
1801 # define YYCOPY(To, From, Count) \
1802 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1804 # define YYCOPY(To, From, Count) \
1808 for (yyi = 0; yyi < (Count); yyi++) \
1809 (To)[yyi] = (From)[yyi]; \
1815 /* Relocate STACK from its old location to the new one. The
1816 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1817 elements in the stack, and YYPTR gives the new location of the
1818 stack. Advance YYPTR to a properly aligned location for the next
1820 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
1823 YYSIZE_T yynewbytes; \
1824 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
1825 Stack = &yyptr->Stack_alloc; \
1826 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1827 yyptr += yynewbytes / sizeof (*yyptr); \
1833 /* YYFINAL -- State number of the termination state. */
1835 /* YYLAST -- Last index in YYTABLE. */
1838 /* YYNTOKENS -- Number of terminals. */
1839 #define YYNTOKENS 130
1840 /* YYNNTS -- Number of nonterminals. */
1842 /* YYNRULES -- Number of rules. */
1843 #define YYNRULES 286
1844 /* YYNRULES -- Number of states. */
1845 #define YYNSTATES 479
1847 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1848 #define YYUNDEFTOK 2
1849 #define YYMAXUTOK 360
1851 #define YYTRANSLATE(YYX) \
1852 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1854 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1855 static const yytype_uint8 yytranslate[] =
1857 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1858 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1859 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1860 2, 2, 2, 116, 2, 2, 2, 114, 106, 2,
1861 126, 129, 113, 111, 97, 110, 123, 112, 2, 2,
1862 2, 2, 2, 2, 2, 2, 2, 2, 103, 96,
1863 107, 99, 108, 102, 2, 2, 2, 2, 2, 2,
1864 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1865 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1866 2, 120, 2, 121, 105, 2, 2, 2, 2, 2,
1867 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1868 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1869 2, 2, 2, 122, 104, 128, 115, 2, 2, 2,
1870 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1871 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1872 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1873 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1874 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1875 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1876 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1877 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1878 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1879 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1880 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1881 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1882 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1883 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1884 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1885 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1886 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1887 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1888 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1889 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1890 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1891 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1892 95, 98, 100, 101, 109, 117, 118, 119, 124, 125,
1897 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1899 static const yytype_uint16 yyprhs[] =
1901 0, 0, 3, 5, 6, 8, 10, 13, 15, 17,
1902 19, 21, 23, 25, 27, 28, 30, 32, 35, 37,
1903 39, 41, 43, 45, 47, 49, 50, 53, 55, 57,
1904 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
1905 79, 81, 83, 85, 87, 89, 91, 93, 97, 100,
1906 103, 105, 107, 110, 111, 114, 117, 119, 123, 127,
1907 128, 131, 132, 140, 141, 143, 145, 149, 151, 154,
1908 158, 167, 174, 175, 182, 183, 191, 193, 196, 198,
1909 201, 202, 204, 206, 209, 211, 214, 219, 223, 224,
1910 233, 234, 244, 245, 251, 253, 256, 258, 261, 263,
1911 264, 271, 274, 276, 282, 284, 286, 290, 292, 293,
1912 300, 301, 307, 310, 315, 316, 318, 320, 323, 325,
1913 327, 329, 331, 333, 335, 337, 339, 341, 342, 345,
1914 346, 349, 350, 353, 354, 364, 365, 374, 375, 377,
1915 379, 382, 384, 386, 388, 390, 391, 393, 395, 398,
1916 400, 403, 412, 414, 416, 422, 423, 426, 428, 430,
1917 432, 434, 436, 438, 440, 442, 443, 445, 448, 453,
1918 457, 459, 464, 467, 469, 471, 472, 473, 486, 488,
1919 489, 490, 501, 503, 507, 509, 511, 513, 517, 519,
1920 521, 523, 526, 527, 528, 532, 533, 535, 537, 541,
1921 545, 550, 555, 558, 560, 563, 565, 567, 571, 573,
1922 575, 577, 579, 581, 583, 585, 587, 589, 591, 593,
1923 595, 597, 599, 601, 603, 605, 607, 611, 615, 619,
1924 623, 627, 631, 635, 639, 643, 647, 650, 653, 657,
1925 661, 665, 669, 673, 677, 681, 685, 689, 693, 697,
1926 701, 705, 709, 713, 718, 721, 723, 727, 730, 735,
1927 739, 740, 742, 746, 752, 756, 760, 764, 768, 772,
1928 776, 780, 784, 788, 792, 796, 802, 805, 808, 811,
1929 814, 818, 822, 824, 828, 834, 840
1932 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1933 static const yytype_int16 yyrhs[] =
1935 131, 0, -1, 132, -1, -1, 133, -1, 134, -1,
1936 133, 134, -1, 180, -1, 192, -1, 190, -1, 208,
1937 -1, 201, -1, 143, -1, 96, -1, -1, 136, -1,
1938 137, -1, 136, 137, -1, 192, -1, 190, -1, 208,
1939 -1, 201, -1, 143, -1, 96, -1, 139, -1, -1,
1940 139, 141, -1, 141, -1, 183, -1, 154, -1, 155,
1941 -1, 156, -1, 158, -1, 166, -1, 149, -1, 177,
1942 -1, 174, -1, 228, -1, 96, -1, 140, -1, 145,
1943 -1, 160, -1, 161, -1, 225, -1, 176, -1, 234,
1944 -1, 235, -1, 122, 139, 128, -1, 122, 128, -1,
1945 141, 96, -1, 141, -1, 140, -1, 99, 226, -1,
1946 -1, 45, 146, -1, 31, 146, -1, 147, -1, 146,
1947 97, 147, -1, 3, 218, 144, -1, -1, 64, 142,
1948 -1, -1, 63, 126, 150, 227, 129, 142, 148, -1,
1949 -1, 145, -1, 228, -1, 45, 3, 218, -1, 3,
1950 -1, 12, 126, -1, 12, 49, 126, -1, 153, 151,
1951 96, 227, 96, 228, 129, 142, -1, 153, 152, 67,
1952 227, 129, 142, -1, -1, 13, 126, 157, 227, 129,
1953 142, -1, -1, 14, 159, 142, 13, 126, 227, 129,
1954 -1, 65, -1, 65, 3, -1, 29, -1, 29, 3,
1955 -1, -1, 163, -1, 165, -1, 163, 165, -1, 164,
1956 -1, 163, 164, -1, 33, 229, 103, 138, -1, 61,
1957 103, 138, -1, -1, 15, 126, 167, 229, 129, 122,
1958 162, 128, -1, -1, 32, 126, 3, 218, 129, 169,
1959 122, 138, 128, -1, -1, 27, 122, 171, 138, 128,
1960 -1, 168, -1, 172, 168, -1, 172, -1, 172, 170,
1961 -1, 170, -1, -1, 51, 122, 175, 138, 128, 173,
1962 -1, 36, 227, -1, 36, -1, 38, 126, 227, 129,
1963 142, -1, 3, -1, 18, -1, 179, 123, 178, -1,
1964 178, -1, -1, 18, 179, 122, 181, 135, 128, -1,
1965 -1, 18, 122, 182, 135, 128, -1, 40, 215, -1,
1966 40, 179, 123, 113, -1, -1, 185, -1, 186, -1,
1967 185, 186, -1, 20, -1, 21, -1, 19, -1, 37,
1968 -1, 46, -1, 48, -1, 47, -1, 25, -1, 23,
1969 -1, -1, 53, 215, -1, -1, 53, 216, -1, -1,
1970 16, 216, -1, -1, 184, 30, 3, 187, 189, 122,
1971 191, 194, 128, -1, -1, 184, 43, 3, 188, 122,
1972 193, 197, 128, -1, -1, 195, -1, 196, -1, 195,
1973 196, -1, 96, -1, 201, -1, 208, -1, 140, -1,
1974 -1, 198, -1, 199, -1, 198, 199, -1, 96, -1,
1975 45, 3, -1, 184, 26, 207, 3, 126, 204, 129,
1976 218, -1, 45, -1, 31, -1, 184, 200, 3, 218,
1977 144, -1, -1, 99, 203, -1, 9, -1, 7, -1,
1978 8, -1, 11, -1, 4, -1, 55, -1, 54, -1,
1979 44, -1, -1, 205, -1, 90, 206, -1, 205, 97,
1980 90, 206, -1, 205, 97, 206, -1, 206, -1, 3,
1981 103, 217, 202, -1, 3, 202, -1, 50, -1, 34,
1982 -1, -1, -1, 184, 26, 207, 3, 126, 204, 129,
1983 218, 122, 209, 138, 128, -1, 3, -1, -1, -1,
1984 26, 210, 126, 204, 129, 218, 122, 212, 138, 128,
1985 -1, 3, -1, 179, 123, 3, -1, 214, -1, 213,
1986 -1, 215, -1, 216, 97, 215, -1, 215, -1, 113,
1987 -1, 35, -1, 103, 217, -1, -1, -1, 126, 220,
1988 129, -1, -1, 221, -1, 226, -1, 221, 97, 226,
1989 -1, 24, 213, 219, -1, 229, 126, 220, 129, -1,
1990 52, 126, 220, 129, -1, 62, 229, -1, 41, -1,
1991 41, 227, -1, 229, -1, 229, -1, 227, 97, 229,
1992 -1, 227, -1, 211, -1, 230, -1, 233, -1, 222,
1993 -1, 224, -1, 223, -1, 5, -1, 9, -1, 10,
1994 -1, 7, -1, 8, -1, 11, -1, 4, -1, 28,
1995 -1, 55, -1, 54, -1, 44, -1, 229, 107, 229,
1996 -1, 229, 108, 229, -1, 229, 73, 229, -1, 229,
1997 74, 229, -1, 229, 69, 229, -1, 229, 70, 229,
1998 -1, 229, 72, 229, -1, 229, 71, 229, -1, 229,
1999 84, 229, -1, 229, 85, 229, -1, 116, 229, -1,
2000 115, 229, -1, 229, 106, 229, -1, 229, 105, 229,
2001 -1, 229, 104, 229, -1, 229, 93, 229, -1, 229,
2002 92, 229, -1, 229, 91, 229, -1, 229, 112, 229,
2003 -1, 229, 114, 229, -1, 229, 111, 229, -1, 229,
2004 110, 229, -1, 229, 113, 229, -1, 229, 67, 229,
2005 -1, 229, 68, 229, -1, 229, 39, 229, -1, 229,
2006 66, 229, -1, 42, 126, 229, 129, -1, 35, 229,
2007 -1, 35, -1, 126, 227, 129, -1, 110, 229, -1,
2008 229, 120, 229, 121, -1, 120, 220, 121, -1, -1,
2009 232, -1, 226, 103, 226, -1, 232, 97, 226, 103,
2010 226, -1, 122, 231, 128, -1, 229, 78, 229, -1,
2011 229, 77, 229, -1, 229, 82, 229, -1, 229, 81,
2012 229, -1, 229, 83, 229, -1, 229, 76, 229, -1,
2013 229, 75, 229, -1, 229, 79, 229, -1, 229, 80,
2014 229, -1, 229, 99, 229, -1, 229, 102, 229, 103,
2015 229, -1, 229, 88, -1, 229, 87, -1, 88, 229,
2016 -1, 87, 229, -1, 52, 123, 3, -1, 229, 123,
2017 3, -1, 3, -1, 184, 17, 3, -1, 184, 17,
2018 3, 99, 3, -1, 184, 17, 3, 99, 4, -1,
2022 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
2023 static const yytype_uint16 yyrline[] =
2025 0, 1596, 1596, 1598, 1598, 1599, 1600, 1602, 1603, 1604,
2026 1605, 1606, 1607, 1608, 1610, 1610, 1611, 1612, 1614, 1615,
2027 1616, 1617, 1618, 1619, 1621, 1622, 1624, 1625, 1628, 1629,
2028 1630, 1631, 1632, 1633, 1634, 1635, 1636, 1637, 1640, 1641,
2029 1642, 1643, 1644, 1645, 1646, 1648, 1649, 1651, 1652, 1653,
2030 1654, 1658, 1665, 1666, 1670, 1671, 1673, 1674, 1676, 1717,
2031 1718, 1721, 1721, 1740, 1741, 1742, 1745, 1748, 1752, 1753,
2032 1755, 1775, 1818, 1818, 1837, 1837, 1852, 1855, 1858, 1861,
2033 1865, 1866, 1867, 1868, 1869, 1870, 1872, 1883, 1886, 1886,
2034 1915, 1915, 1935, 1935, 1952, 1953, 1954, 1955, 1963, 1972,
2035 1972, 2017, 2021, 2032, 2041, 2042, 2044, 2045, 2047, 2047,
2036 2049, 2049, 2052, 2060, 2070, 2071, 2072, 2073, 2075, 2076,
2037 2077, 2078, 2079, 2080, 2081, 2082, 2083, 2085, 2086, 2088,
2038 2089, 2091, 2092, 2096, 2094, 2102, 2100, 2108, 2109, 2110,
2039 2111, 2112, 2113, 2114, 2116, 2122, 2123, 2124, 2125, 2126,
2040 2127, 2130, 2142, 2142, 2144, 2203, 2204, 2206, 2207, 2208,
2041 2209, 2210, 2212, 2213, 2214, 2219, 2223, 2229, 2235, 2243,
2042 2248, 2254, 2262, 2270, 2271, 2272, 2275, 2274, 2311, 2312,
2043 2314, 2313, 2334, 2342, 2350, 2351, 2353, 2354, 2356, 2357,
2044 2358, 2367, 2368, 2372, 2373, 2375, 2376, 2377, 2380, 2395,
2045 2419, 2467, 2488, 2509, 2512, 2519, 2520, 2521, 2527, 2533,
2046 2535, 2537, 2539, 2541, 2543, 2545, 2562, 2567, 2570, 2573,
2047 2576, 2579, 2582, 2585, 2588, 2591, 2595, 2598, 2601, 2604,
2048 2607, 2610, 2613, 2616, 2620, 2631, 2649, 2654, 2659, 2664,
2049 2669, 2674, 2678, 2682, 2687, 2691, 2695, 2704, 2713, 2723,
2050 2728, 2740, 2746, 2751, 2757, 2763, 2767, 2769, 2780, 2789,
2051 2796, 2797, 2799, 2805, 2814, 2821, 2833, 2839, 2845, 2851,
2052 2857, 2863, 2869, 2882, 2893, 2900, 2913, 2940, 2954, 2968,
2053 2982, 2997, 3031, 3128, 3129, 3130, 3132
2057 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
2058 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2059 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2060 static const char *const yytname[] =
2062 "$end", "error", "$undefined", "T_IDENTIFIER", "T_STRING", "T_REGEXP",
2063 "T_EMPTY", "T_INT", "T_UINT", "T_BYTE", "T_SHORT", "T_FLOAT", "\"for\"",
2064 "\"while\"", "\"do\"", "\"switch\"", "\"implements\"", "\"namespace\"",
2065 "\"package\"", "\"protected\"", "\"public\"", "\"private\"", "\"use\"",
2066 "\"internal\"", "\"new\"", "\"native\"", "\"function\"", "\"finally\"",
2067 "\"undefined\"", "\"continue\"", "\"class\"", "\"const\"", "\"catch\"",
2068 "\"case\"", "\"set\"", "\"void\"", "\"throw\"", "\"static\"", "\"with\"",
2069 "\"instanceof\"", "\"import\"", "\"return\"", "\"typeof\"",
2070 "\"interface\"", "\"null\"", "\"var\"", "\"dynamic\"", "\"override\"",
2071 "\"final\"", "\"each\"", "\"get\"", "\"try\"", "\"super\"",
2072 "\"extends\"", "\"false\"", "\"true\"", "\"Boolean\"", "\"uint\"",
2073 "\"int\"", "\"Number\"", "\"String\"", "\"default\"", "\"delete\"",
2074 "\"if\"", "\"else\"", "\"break\"", "\"is\"", "\"in\"", "\"as\"",
2075 "\"==\"", "\"===\"", "\"!=\"", "\"!==\"", "\"<=\"", "\">=\"", "\"|=\"",
2076 "\"/=\"", "\"%=\"", "\"*=\"", "\"+=\"", "\"-=\"", "\">>=\"", "\"<<=\"",
2077 "\">>>=\"", "\"||\"", "\"&&\"", "\"::\"", "\"--\"", "\"++\"", "\"..\"",
2078 "\"...\"", "\"<<\"", "\">>>\"", "\">>\"", "prec_none", "below_semicolon",
2079 "';'", "','", "below_assignment", "'='", "\"&=\"", "\"^=\"", "'?'",
2080 "':'", "'|'", "'^'", "'&'", "'<'", "'>'", "below_minus", "'-'", "'+'",
2081 "'/'", "'*'", "'%'", "'~'", "'!'", "minusminus_prefix",
2082 "plusplus_prefix", "below_curly", "'['", "']'", "'{'", "'.'",
2083 "above_identifier", "below_else", "'('", "above_function", "'}'", "')'",
2084 "$accept", "PROGRAM", "MAYBE_PROGRAM_CODE_LIST", "PROGRAM_CODE_LIST",
2085 "PROGRAM_CODE", "MAYBE_INPACKAGE_CODE_LIST", "INPACKAGE_CODE_LIST",
2086 "INPACKAGE_CODE", "MAYBECODE", "CODE", "CODE_STATEMENT", "CODEPIECE",
2087 "CODEBLOCK", "PACKAGE_INITCODE", "MAYBEEXPRESSION",
2088 "VARIABLE_DECLARATION", "VARIABLE_LIST", "ONE_VARIABLE", "MAYBEELSE",
2089 "IF", "$@1", "FOR_INIT", "FOR_IN_INIT", "FOR_START", "FOR", "FOR_IN",
2090 "WHILE", "$@2", "DO_WHILE", "$@3", "BREAK", "CONTINUE",
2091 "MAYBE_CASE_LIST", "CASE_LIST", "CASE", "DEFAULT", "SWITCH", "$@4",
2092 "CATCH", "$@5", "FINALLY", "$@6", "CATCH_LIST", "CATCH_FINALLY_LIST",
2093 "TRY", "$@7", "THROW", "WITH", "X_IDENTIFIER", "PACKAGE",
2094 "PACKAGE_DECLARATION", "$@8", "$@9", "IMPORT", "MAYBE_MODIFIERS",
2095 "MODIFIER_LIST", "MODIFIER", "EXTENDS", "EXTENDS_LIST",
2096 "IMPLEMENTS_LIST", "CLASS_DECLARATION", "$@10", "INTERFACE_DECLARATION",
2097 "$@11", "MAYBE_CLASS_BODY", "CLASS_BODY", "CLASS_BODY_ITEM",
2098 "MAYBE_INTERFACE_BODY", "INTERFACE_BODY", "IDECLARATION", "VARCONST",
2099 "SLOT_DECLARATION", "MAYBESTATICCONSTANT", "STATICCONSTANT",
2100 "MAYBE_PARAM_LIST", "PARAM_LIST", "PARAM", "GETSET",
2101 "FUNCTION_DECLARATION", "$@12", "MAYBE_IDENTIFIER", "INNERFUNCTION",
2102 "$@13", "CLASS", "PACKAGEANDCLASS", "QNAME", "QNAME_LIST", "TYPE",
2103 "MAYBETYPE", "MAYBE_PARAM_VALUES", "MAYBE_EXPRESSION_LIST",
2104 "EXPRESSION_LIST", "NEW", "FUNCTIONCALL", "DELETE", "RETURN",
2105 "NONCOMMAEXPRESSION", "EXPRESSION", "VOIDEXPRESSION", "E", "CONSTANT",
2106 "MAYBE_EXPRPAIR_LIST", "EXPRPAIR_LIST", "VAR_READ",
2107 "NAMESPACE_DECLARATION", "USE_NAMESPACE", 0
2112 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
2114 static const yytype_uint16 yytoknum[] =
2116 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
2117 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
2118 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
2119 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
2120 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
2121 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
2122 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
2123 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
2124 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
2125 345, 346, 347, 348, 349, 350, 59, 44, 351, 61,
2126 352, 353, 63, 58, 124, 94, 38, 60, 62, 354,
2127 45, 43, 47, 42, 37, 126, 33, 355, 356, 357,
2128 91, 93, 123, 46, 358, 359, 40, 360, 125, 41
2132 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2133 static const yytype_uint8 yyr1[] =
2135 0, 130, 131, 132, 132, 133, 133, 134, 134, 134,
2136 134, 134, 134, 134, 135, 135, 136, 136, 137, 137,
2137 137, 137, 137, 137, 138, 138, 139, 139, 140, 140,
2138 140, 140, 140, 140, 140, 140, 140, 140, 141, 141,
2139 141, 141, 141, 141, 141, 141, 141, 142, 142, 142,
2140 142, 143, 144, 144, 145, 145, 146, 146, 147, 148,
2141 148, 150, 149, 151, 151, 151, 152, 152, 153, 153,
2142 154, 155, 157, 156, 159, 158, 160, 160, 161, 161,
2143 162, 162, 162, 162, 163, 163, 164, 165, 167, 166,
2144 169, 168, 171, 170, 172, 172, 173, 173, 173, 175,
2145 174, 176, 176, 177, 178, 178, 179, 179, 181, 180,
2146 182, 180, 183, 183, 184, 184, 185, 185, 186, 186,
2147 186, 186, 186, 186, 186, 186, 186, 187, 187, 188,
2148 188, 189, 189, 191, 190, 193, 192, 194, 194, 195,
2149 195, 196, 196, 196, 196, 197, 197, 198, 198, 199,
2150 199, 199, 200, 200, 201, 202, 202, 203, 203, 203,
2151 203, 203, 203, 203, 203, 204, 204, 204, 204, 205,
2152 205, 206, 206, 207, 207, 207, 209, 208, 210, 210,
2153 212, 211, 213, 214, 215, 215, 216, 216, 217, 217,
2154 217, 218, 218, 219, 219, 220, 220, 221, 221, 222,
2155 223, 223, 224, 225, 225, 226, 227, 227, 228, 229,
2156 229, 229, 229, 229, 229, 229, 230, 230, 230, 230,
2157 230, 230, 230, 230, 230, 230, 229, 229, 229, 229,
2158 229, 229, 229, 229, 229, 229, 229, 229, 229, 229,
2159 229, 229, 229, 229, 229, 229, 229, 229, 229, 229,
2160 229, 229, 229, 229, 229, 229, 229, 229, 229, 229,
2161 231, 231, 232, 232, 229, 229, 229, 229, 229, 229,
2162 229, 229, 229, 229, 229, 229, 229, 229, 229, 229,
2163 229, 229, 233, 234, 234, 234, 235
2166 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2167 static const yytype_uint8 yyr2[] =
2169 0, 2, 1, 0, 1, 1, 2, 1, 1, 1,
2170 1, 1, 1, 1, 0, 1, 1, 2, 1, 1,
2171 1, 1, 1, 1, 1, 0, 2, 1, 1, 1,
2172 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2173 1, 1, 1, 1, 1, 1, 1, 3, 2, 2,
2174 1, 1, 2, 0, 2, 2, 1, 3, 3, 0,
2175 2, 0, 7, 0, 1, 1, 3, 1, 2, 3,
2176 8, 6, 0, 6, 0, 7, 1, 2, 1, 2,
2177 0, 1, 1, 2, 1, 2, 4, 3, 0, 8,
2178 0, 9, 0, 5, 1, 2, 1, 2, 1, 0,
2179 6, 2, 1, 5, 1, 1, 3, 1, 0, 6,
2180 0, 5, 2, 4, 0, 1, 1, 2, 1, 1,
2181 1, 1, 1, 1, 1, 1, 1, 0, 2, 0,
2182 2, 0, 2, 0, 9, 0, 8, 0, 1, 1,
2183 2, 1, 1, 1, 1, 0, 1, 1, 2, 1,
2184 2, 8, 1, 1, 5, 0, 2, 1, 1, 1,
2185 1, 1, 1, 1, 1, 0, 1, 2, 4, 3,
2186 1, 4, 2, 1, 1, 0, 0, 12, 1, 0,
2187 0, 10, 1, 3, 1, 1, 1, 3, 1, 1,
2188 1, 2, 0, 0, 3, 0, 1, 1, 3, 3,
2189 4, 4, 2, 1, 2, 1, 1, 3, 1, 1,
2190 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2191 1, 1, 1, 1, 1, 1, 3, 3, 3, 3,
2192 3, 3, 3, 3, 3, 3, 2, 2, 3, 3,
2193 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2194 3, 3, 3, 4, 2, 1, 3, 2, 4, 3,
2195 0, 1, 3, 5, 3, 3, 3, 3, 3, 3,
2196 3, 3, 3, 3, 3, 5, 2, 2, 2, 2,
2200 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2201 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2202 means the default is an error. */
2203 static const yytype_uint16 yydefact[] =
2205 114, 282, 221, 215, 218, 219, 216, 217, 220, 0,
2206 0, 74, 0, 0, 120, 118, 119, 126, 0, 125,
2207 179, 222, 255, 121, 0, 0, 0, 225, 122, 124,
2208 123, 0, 0, 224, 223, 0, 0, 0, 0, 13,
2209 0, 0, 0, 195, 260, 0, 0, 2, 114, 5,
2210 51, 12, 34, 63, 29, 30, 31, 32, 33, 36,
2211 35, 7, 28, 0, 115, 116, 9, 8, 11, 10,
2212 209, 212, 214, 213, 208, 37, 206, 210, 211, 0,
2213 68, 72, 114, 88, 104, 105, 110, 107, 0, 182,
2214 193, 178, 0, 254, 0, 182, 0, 185, 184, 112,
2215 0, 99, 0, 195, 202, 61, 279, 278, 257, 237,
2216 236, 0, 196, 197, 205, 0, 0, 261, 0, 1,
2217 6, 282, 0, 0, 64, 0, 0, 65, 175, 0,
2218 153, 0, 152, 0, 117, 0, 0, 0, 0, 0,
2219 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2220 0, 0, 0, 0, 0, 0, 0, 277, 276, 0,
2221 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2222 0, 0, 0, 0, 0, 0, 195, 69, 0, 0,
2223 78, 102, 203, 0, 76, 38, 114, 39, 50, 0,
2224 40, 41, 42, 44, 0, 43, 45, 46, 0, 114,
2225 108, 0, 195, 199, 165, 0, 0, 0, 25, 280,
2226 0, 0, 259, 0, 0, 264, 0, 256, 192, 55,
2227 56, 192, 54, 0, 0, 174, 173, 0, 127, 129,
2228 192, 207, 251, 252, 249, 250, 230, 231, 233, 232,
2229 228, 229, 271, 270, 266, 265, 272, 273, 268, 267,
2230 269, 234, 235, 243, 242, 241, 274, 0, 240, 239,
2231 238, 226, 227, 247, 246, 244, 248, 245, 0, 281,
2232 0, 0, 0, 79, 101, 204, 77, 48, 114, 27,
2233 206, 49, 0, 0, 0, 23, 0, 114, 16, 22,
2234 19, 18, 21, 20, 114, 106, 0, 155, 0, 0,
2235 166, 170, 114, 183, 113, 253, 0, 24, 201, 0,
2236 198, 262, 0, 0, 53, 0, 53, 0, 0, 0,
2237 0, 131, 0, 0, 53, 0, 258, 200, 114, 286,
2238 47, 26, 0, 283, 0, 111, 17, 0, 194, 0,
2239 0, 172, 167, 192, 0, 103, 0, 114, 0, 190,
2240 189, 0, 188, 191, 0, 58, 57, 0, 114, 165,
2241 128, 0, 0, 186, 130, 135, 154, 275, 73, 0,
2242 0, 80, 109, 161, 158, 159, 157, 160, 164, 163,
2243 162, 156, 155, 0, 0, 169, 0, 0, 94, 98,
2244 96, 100, 59, 263, 0, 52, 0, 71, 0, 132,
2245 133, 0, 114, 75, 284, 285, 0, 0, 0, 81,
2246 84, 82, 171, 180, 168, 92, 0, 95, 97, 114,
2247 62, 114, 192, 114, 187, 0, 149, 0, 0, 114,
2248 147, 0, 25, 89, 85, 83, 25, 25, 192, 60,
2249 70, 0, 141, 144, 0, 0, 114, 139, 142, 143,
2250 150, 175, 136, 148, 25, 87, 0, 0, 0, 176,
2251 134, 140, 0, 86, 181, 93, 90, 25, 0, 0,
2252 0, 165, 25, 177, 0, 0, 192, 91, 151
2255 /* YYDEFGOTO[NTERM-NUM]. */
2256 static const yytype_int16 yydefgoto[] =
2258 -1, 46, 47, 48, 49, 286, 287, 288, 306, 307,
2259 187, 279, 189, 289, 355, 190, 222, 220, 420, 52,
2260 211, 125, 126, 53, 54, 55, 56, 178, 57, 82,
2261 191, 192, 408, 409, 410, 411, 58, 198, 388, 469,
2262 389, 437, 390, 391, 59, 208, 193, 60, 87, 351,
2263 61, 294, 199, 62, 194, 64, 65, 321, 323, 362,
2264 290, 423, 291, 402, 445, 446, 447, 428, 429, 430,
2265 133, 292, 341, 381, 299, 300, 301, 227, 293, 467,
2266 92, 70, 436, 97, 98, 352, 364, 353, 314, 203,
2267 111, 112, 71, 72, 73, 195, 113, 74, 75, 76,
2268 77, 116, 117, 78, 196, 197
2271 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2273 #define YYPACT_NINF -306
2274 static const yytype_int16 yypact[] =
2276 349, -306, -306, -306, -306, -306, -306, -306, -306, -40,
2277 -85, -306, -37, 35, -306, -306, -306, -306, 30, -306,
2278 68, -306, 52, -306, -24, 18, -16, -306, -306, -306,
2279 -306, -22, -35, -306, -306, 1538, -14, 1538, 1538, -306,
2280 1538, 1538, 1538, 1538, 1538, 1538, 167, -306, 473, -306,
2281 -306, -306, -306, 211, -306, -306, -306, -306, -306, -306,
2282 -306, -306, -306, 217, 640, -306, -306, -306, -306, -306,
2283 -306, -306, -306, -306, 76, -306, 1971, -306, -306, 60,
2284 -306, -306, 1469, -306, -306, -306, -306, -306, -28, -306,
2285 67, -306, 71, 141, 1538, 69, 81, -306, -306, -306,
2286 1538, -306, 186, 1538, 141, -306, 141, 141, 163, 141,
2287 141, 87, 115, -306, 1971, 120, 96, 128, -86, -306,
2288 -306, 165, 227, 230, -306, 138, 169, -306, -5, 238,
2289 -306, 241, -306, 246, -306, 1538, 1538, 1538, 1538, 1538,
2290 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538,
2291 1538, 1538, 1538, 1538, 1538, 1538, 1538, -306, -306, 1538,
2292 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538,
2293 1538, 1538, 1538, 1538, 1538, 254, 1538, -306, 1538, 242,
2294 255, 1538, 1538, 227, 265, -306, 593, -306, 173, 257,
2295 -306, -306, -306, -306, 261, -306, -306, -306, 1538, 845,
2296 -306, 72, 1538, -306, 9, -82, 49, 1599, 1349, -306,
2297 143, 1538, -306, 1538, 1538, -306, 1538, -306, 171, 182,
2298 -306, 171, 182, 1538, 1538, -306, -306, 277, 228, 231,
2299 171, 1971, 962, 836, 836, 836, 2337, 2337, 2337, 2337,
2300 962, 962, 1971, 1971, 1971, 1971, 1971, 1971, 1971, 1971,
2301 1971, 2032, 2093, 340, 340, 340, 1971, 1727, 2154, 2215,
2302 2276, 962, 962, 163, 163, 141, 141, 141, 1788, -306,
2303 156, -55, 287, -306, 76, 76, -306, -306, 719, -306,
2304 1849, -306, 170, 288, 1663, -306, 175, 971, -306, -306,
2305 -306, -306, -306, -306, 845, -306, 164, -69, 294, 172,
2306 207, -306, 1469, 69, -306, -306, 177, 1349, -306, 74,
2307 -306, -306, 203, 63, 209, 227, 112, 73, 84, 183,
2308 18, 296, 18, 188, 209, 1538, -306, -306, 1469, -306,
2309 -306, -306, 1538, 214, 192, -306, -306, 189, -306, 61,
2310 63, -306, -306, 171, 11, -306, 8, 1469, 1538, -306,
2311 -306, 193, -306, -306, 1538, -306, -306, 1538, 1469, 9,
2312 -306, 18, 196, -306, 222, -306, -306, 1971, -306, 88,
2313 179, 130, -306, -306, -306, -306, -306, -306, -306, -306,
2314 -306, -306, 221, 201, 294, -306, 202, 199, -306, -306,
2315 8, -306, 268, -306, 90, -306, 200, -306, 205, 222,
2316 -306, 18, 394, -306, -306, -306, 1538, 232, 210, 130,
2317 -306, -306, -306, -306, -306, -306, 336, -306, -306, 1469,
2318 -306, 1469, 171, 1097, -306, 337, -306, 316, 216, 529,
2319 -306, 1910, 1349, -306, -306, -306, 1349, 1349, 171, -306,
2320 -306, 224, -306, -306, 66, 219, 1223, -306, -306, -306,
2321 -306, -5, -306, -306, 1349, -306, 220, 223, 226, -306,
2322 -306, -306, 347, -306, -306, -306, -306, 1349, 239, 244,
2323 243, 9, 1349, -306, 247, 250, 171, -306, -306
2326 /* YYPGOTO[NTERM-NUM]. */
2327 static const yytype_int16 yypgoto[] =
2329 -306, -306, -306, -306, 327, 85, -306, 93, -227, 197,
2330 1, -76, -244, 16, 58, 332, 270, 75, -306, -306,
2331 -306, -306, -306, -306, -306, -306, -306, -306, -306, -306,
2332 -306, -306, -306, -306, -15, -11, -306, -306, 15, -306,
2333 17, -306, -306, -306, -306, -306, -306, -306, -193, 19,
2334 -306, -306, -306, -306, 0, -306, 335, -306, -306, -306,
2335 31, -306, 39, -306, -306, -306, -38, -306, -306, -23,
2336 -306, 2, 27, -306, -305, -306, -271, -41, 3, -306,
2337 -306, -306, -306, 398, -306, -20, 57, 80, -184, -306,
2338 -93, -306, -306, -306, -306, -306, -26, -17, -46, -18,
2339 -306, -306, -306, -306, -306, -306
2342 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2343 positive, shift that token. If negative, reduce the rule which
2344 number is the opposite. If zero, do what YYDEFACT says.
2345 If YYTABLE_NINF, syntax error. */
2346 #define YYTABLE_NINF -206
2347 static const yytype_int16 yytable[] =
2349 63, 50, 68, 69, 93, 99, 188, 127, 295, 79,
2350 210, 135, 297, 295, 297, 135, 51, 104, 115, 106,
2351 107, 95, 108, 109, 110, 114, 114, 342, 118, 225,
2352 339, 66, 88, 89, 340, 386, 85, 316, 84, 67,
2353 387, 81, 135, 217, 96, 226, 324, 302, 63, 50,
2354 68, 69, 303, 85, 398, 1, 2, 3, 345, 4,
2355 5, 6, 7, 8, 51, 373, 95, 85, 374, 375,
2356 376, 91, 377, 385, 328, 84, 18, 205, 20, 66,
2357 21, 85, 207, 270, 368, 114, 80, 67, 102, 83,
2358 85, 103, 128, 303, 200, 201, 27, 130, 349, 298,
2359 101, 384, 94, 392, 32, 378, 33, 34, 85, 296,
2360 100, 132, 105, 414, 397, 379, 380, 231, 232, 233,
2361 234, 235, 236, 237, 238, 239, 240, 241, 242, 243,
2362 244, 245, 246, 247, 248, 249, 250, 251, 252, 37,
2363 38, 253, 254, 255, 256, 257, 258, 259, 260, 261,
2364 262, 263, 264, 265, 266, 267, 268, 86, 114, 383,
2365 115, 271, 304, 406, 274, 275, 474, 119, 280, 357,
2366 135, 135, 43, 135, 44, 439, 350, 440, 45, -66,
2367 284, 135, 404, 405, 114, 135, 177, 310, 311, 209,
2368 312, 407, -104, 202, 309, 114, 114, 204, 114, 63,
2369 50, 295, 331, 347, 206, 455, 317, 318, 212, 456,
2370 457, 354, 213, 358, 121, 2, 3, 403, 4, 5,
2371 6, 7, 8, 214, 215, 216, 188, 463, 157, 158,
2372 218, 331, -67, 221, 223, 18, 224, 20, 441, 21,
2373 470, 228, 122, 128, 229, 475, 22, 129, 130, 230,
2374 157, 158, 188, 26, 458, 27, 123, 269, 273, 272,
2375 131, 174, 132, 32, 175, 33, 34, 176, 276, 281,
2376 282, 188, 308, 35, 313, 171, 172, 173, 283, 315,
2377 319, 320, 188, 174, 322, 327, 175, 63, 50, 176,
2378 329, 333, 478, 338, 63, 50, 332, 297, 37, 38,
2379 360, 343, 363, 335, 344, 346, 348, 367, 354, 359,
2380 365, 396, 361, 370, 371, 369, 394, 372, 400, 401,
2381 339, 40, 393, 413, 415, 416, 41, 42, 395, 421,
2382 114, 43, 419, 44, 422, 432, 114, 45, 433, 438,
2383 450, 363, 451, 188, 452, 188, 459, 460, 464, -3,
2384 468, 465, 1, 2, 3, 466, 4, 5, 6, 7,
2385 8, 9, 10, 11, 12, 471, 472, 13, 14, 15,
2386 16, 473, 17, 18, 19, 120, 476, 21, 477, 337,
2387 336, 424, 366, 278, 22, 124, 23, 24, 431, 25,
2388 356, 26, 219, 27, 434, 28, 29, 30, 435, 134,
2389 31, 32, 427, 33, 34, 417, 453, 418, 461, 412,
2390 462, 35, 36, 14, 15, 16, 90, 17, 399, 19,
2391 382, 0, 0, 444, 443, 448, 449, 157, 158, 427,
2392 0, 23, 0, 0, 0, 0, 37, 38, 0, 425,
2393 28, 29, 30, 0, 0, 39, 444, 443, 448, 449,
2394 169, 170, 171, 172, 173, 0, 0, 0, 0, 40,
2395 174, 0, 0, 175, 41, 42, 176, 0, 0, 43,
2396 0, 44, 0, -4, 0, 45, 1, 2, 3, 0,
2397 4, 5, 6, 7, 8, 9, 10, 11, 12, 0,
2398 426, 13, 14, 15, 16, 0, 17, 18, 19, 0,
2399 0, 21, 0, 0, 0, 0, 0, 0, 22, 0,
2400 23, 24, 0, 25, 0, 26, 0, 27, 0, 28,
2401 29, 30, -145, 0, 31, 32, 0, 33, 34, 0,
2402 0, 0, 0, 0, 0, 35, 36, 0, 0, 0,
2403 0, 0, 0, 0, 0, 0, 0, 0, 14, 15,
2404 16, 0, 17, 0, 19, 0, 0, 0, 0, 0,
2405 37, 38, 0, 0, 0, 0, 23, 0, 0, 39,
2406 0, 0, 0, 0, 425, 28, 29, 30, 0, 0,
2407 0, 0, 0, 40, 0, 0, 0, 0, 41, 42,
2408 0, 0, 0, 43, 0, 44, 1, 2, 3, 45,
2409 4, 5, 6, 7, 8, 9, 10, 11, 12, 0,
2410 0, 0, 14, 15, 16, 179, 17, 18, 19, 20,
2411 0, 21, 180, 0, 122, 426, 0, 0, 22, 181,
2412 23, 24, 0, 25, 182, 26, 0, 27, 183, 28,
2413 29, 30, 0, 0, 31, 32, 0, 33, 34, 0,
2414 0, 0, 0, 0, 0, 35, 36, -146, 184, 14,
2415 15, 16, 0, 17, 0, 19, 0, 0, 0, 0,
2416 0, 0, 0, 0, 0, 0, 0, 23, 0, 0,
2417 37, 38, 0, 0, 0, 0, 28, 29, 30, 185,
2418 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2419 0, 0, 0, 40, 0, 0, 0, 0, 41, 42,
2420 0, 0, 0, 43, 0, 44, 0, 0, 0, 45,
2421 0, 277, 1, 2, 3, 0, 4, 5, 6, 7,
2422 8, 9, 10, 11, 12, 0, 0, 0, 14, 15,
2423 16, 179, 17, 18, 19, 20, 0, 21, 180, 0,
2424 122, 0, 0, 0, 22, 181, 23, 24, 0, 25,
2425 182, 26, 0, 27, 183, 28, 29, 30, 0, 0,
2426 31, 32, 0, 33, 34, 0, 0, 0, 0, 0,
2427 0, 35, 36, 0, 184, 0, 0, 0, 0, 0,
2428 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2429 0, 0, 0, 0, 0, 0, 37, 38, 0, 0,
2430 0, 0, 0, 0, 0, 185, 0, 0, 0, 0,
2431 0, 0, 0, 0, 0, 0, 0, 0, 0, 40,
2432 0, 0, 0, 0, 41, 42, 0, 0, 0, 43,
2433 0, 44, 0, 0, 0, 45, 0, 330, 1, 2,
2434 3, 0, 4, 5, 6, 7, 8, 9, 10, 11,
2435 12, 0, 0, 0, 14, 15, 16, 0, 17, 18,
2436 19, 0, 0, 21, 0, 136, 0, 0, 0, 0,
2437 22, 0, 23, 24, 0, 25, 0, 26, 0, 27,
2438 0, 28, 29, 30, 0, 0, 31, 32, 0, 33,
2439 34, 0, -206, -206, -206, 0, 0, 35, 36, 144,
2440 145, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2441 0, 0, 0, 157, 158, 0, 0, 159, 160, 161,
2442 0, 0, 37, 38, 0, 0, 0, 0, 0, 0,
2443 0, 285, 0, 167, 168, 0, 169, 170, 171, 172,
2444 173, 0, 0, 0, 0, 40, 174, 0, 0, 175,
2445 41, 42, 176, 0, 0, 43, 0, 44, 0, 0,
2446 0, 45, 0, -14, 1, 2, 3, 0, 4, 5,
2447 6, 7, 8, 9, 10, 11, 12, 0, 0, 0,
2448 14, 15, 16, 0, 17, 18, 19, 0, 0, 21,
2449 0, -206, 0, 0, 0, 0, 22, 0, 23, 24,
2450 0, 25, 0, 26, 0, 27, 0, 28, 29, 30,
2451 0, 0, 31, 32, 0, 33, 34, 0, 0, 0,
2452 0, 0, 0, 35, 36, -206, -206, 0, 0, 0,
2453 0, 0, 0, 0, 0, 0, 0, 0, 0, 157,
2454 158, 0, 0, 159, 160, 161, 0, 0, 37, 38,
2455 0, 0, 0, 0, 0, 0, 0, 285, 0, -206,
2456 -206, 0, 169, 170, 171, 172, 173, 0, 0, 0,
2457 0, 40, 174, 0, 0, 175, 41, 42, 176, 0,
2458 0, 43, 0, 44, 0, 0, 0, 45, 0, -15,
2459 1, 2, 3, 0, 4, 5, 6, 7, 8, 9,
2460 10, 11, 12, 0, 0, 0, 14, 15, 16, 0,
2461 17, 18, 19, 0, 0, 21, 0, 0, 0, 0,
2462 0, 0, 22, 0, 23, 24, 0, 25, 0, 26,
2463 0, 27, 0, 28, 29, 30, 0, 0, 31, 32,
2464 0, 33, 34, 0, 0, 0, 0, 0, 0, 35,
2465 36, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2466 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2467 0, 0, 0, 0, 37, 38, 0, 0, 0, 0,
2468 0, 0, 0, 442, 0, 0, 0, 0, 0, 0,
2469 0, 0, 0, 0, 0, 0, 0, 40, 0, 0,
2470 0, 0, 41, 42, 0, 0, 0, 43, 0, 44,
2471 0, 0, 0, 45, 0, -137, 1, 2, 3, 0,
2472 4, 5, 6, 7, 8, 9, 10, 11, 12, 0,
2473 0, 0, 14, 15, 16, 0, 17, 18, 19, 0,
2474 0, 21, 0, 0, 0, 0, 0, 0, 22, 0,
2475 23, 24, 0, 25, 0, 26, 0, 27, 0, 28,
2476 29, 30, 0, 0, 31, 32, 0, 33, 34, 0,
2477 0, 0, 0, 0, 0, 35, 36, 0, 0, 0,
2478 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2479 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2480 37, 38, 0, 0, 0, 0, 0, 0, 0, 442,
2481 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2482 0, 0, 0, 40, 0, 0, 0, 0, 41, 42,
2483 0, 0, 0, 43, 0, 44, 0, 0, 0, 45,
2484 0, -138, 1, 2, 3, 0, 4, 5, 6, 7,
2485 8, 9, 10, 11, 12, 0, -114, 0, 14, 15,
2486 16, 179, 17, 18, 19, 20, 0, 21, 180, 0,
2487 122, 0, 0, 0, 22, 181, 23, 24, 0, 25,
2488 182, 26, 0, 27, 183, 28, 29, 30, 0, 0,
2489 31, 32, 0, 33, 34, 0, 0, 0, 0, 0,
2490 0, 35, 36, 0, 184, 0, 0, 0, 0, 0,
2491 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2492 0, 0, 0, 0, 0, 0, 37, 38, 0, 0,
2493 0, 0, 0, 0, 0, 185, 0, 0, 0, 0,
2494 0, 0, 0, 0, 0, 0, 0, 0, 0, 40,
2495 0, 0, 0, 0, 41, 42, 0, 0, 0, 43,
2496 0, 44, 1, 2, 3, 45, 4, 5, 6, 7,
2497 8, 9, 10, 11, 12, 0, 0, 0, 14, 15,
2498 16, 179, 17, 18, 19, 20, 0, 21, 180, 0,
2499 122, 0, 0, 0, 22, 181, 23, 24, 0, 25,
2500 182, 26, 0, 27, 183, 28, 29, 30, 0, 0,
2501 31, 32, 0, 33, 34, 0, 0, 0, 0, 0,
2502 0, 35, 36, 0, 184, 0, 0, 0, 0, 0,
2503 0, 1, 2, 3, 0, 4, 5, 6, 7, 8,
2504 0, 0, 0, 0, 0, 0, 37, 38, 0, 0,
2505 0, 0, 18, 0, 20, 185, 21, 0, 0, 0,
2506 0, 0, 0, 22, 0, 0, 0, 0, 0, 40,
2507 26, 0, 27, 0, 41, 42, 0, 0, 0, 43,
2508 32, 186, 33, 34, 0, 45, 0, 0, 0, 0,
2509 35, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2510 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2511 0, 0, 0, 0, 0, 37, 38, 0, 0, 0,
2512 0, 0, 0, 0, 0, 0, 0, 0, 136, 0,
2513 0, 0, 0, 0, 0, 0, 0, 0, 40, 0,
2514 0, 0, 0, 41, 42, 0, 0, 0, 43, 0,
2515 44, 0, 0, 0, 45, 137, 138, 139, 140, 141,
2516 142, 143, 144, 145, 146, 147, 148, 149, 150, 151,
2517 152, 153, 154, 155, 156, 0, 157, 158, 0, 0,
2518 159, 160, 161, 0, 0, 0, 0, 0, 162, 0,
2519 0, 163, 136, 164, 165, 166, 167, 168, 0, 169,
2520 170, 171, 172, 173, 0, 0, 0, 0, 0, 174,
2521 0, 0, 175, 0, 0, 176, 0, 0, 305, 137,
2522 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
2523 148, 149, 150, 151, 152, 153, 154, 155, 156, 0,
2524 157, 158, 0, 0, 159, 160, 161, 0, 0, 0,
2525 0, 0, 162, 0, 0, 163, 136, 164, 165, 166,
2526 167, 168, 0, 169, 170, 171, 172, 173, 0, 0,
2527 0, 0, 0, 174, 0, 0, 175, 0, 0, 176,
2528 0, 0, 334, 137, 138, 139, 140, 141, 142, 143,
2529 144, 145, 146, 147, 148, 149, 150, 151, 152, 153,
2530 154, 155, 156, 0, 157, 158, 0, 0, 159, 160,
2531 161, 0, 0, 0, 0, 0, 162, 136, 0, 163,
2532 325, 164, 165, 166, 167, 168, 0, 169, 170, 171,
2533 172, 173, 0, 0, 0, 0, 0, 174, 0, 0,
2534 175, 0, 0, 176, 137, 138, 139, 140, 141, 142,
2535 143, 144, 145, 146, 147, 148, 149, 150, 151, 152,
2536 153, 154, 155, 156, 0, 157, 158, 0, 0, 159,
2537 160, 161, 0, 0, 0, 0, 0, 162, 136, 0,
2538 163, 0, 164, 165, 166, 167, 168, 0, 169, 170,
2539 171, 172, 173, 0, 0, 0, 0, 0, 174, 326,
2540 0, 175, 0, 0, 176, 137, 138, 139, 140, 141,
2541 142, 143, 144, 145, 146, 147, 148, 149, 150, 151,
2542 152, 153, 154, 155, 156, 0, 157, 158, 0, 0,
2543 159, 160, 161, 0, 0, 0, 0, 0, 162, 136,
2544 0, 163, -205, 164, 165, 166, 167, 168, 0, 169,
2545 170, 171, 172, 173, 0, 0, 0, 0, 0, 174,
2546 0, 0, 175, 0, 0, 176, 137, 138, 139, 140,
2547 141, 142, 143, 144, 145, 146, 147, 148, 149, 150,
2548 151, 152, 153, 154, 155, 156, 0, 157, 158, 0,
2549 0, 159, 160, 161, 0, 0, 0, 0, 0, 162,
2550 136, 0, 163, 454, 164, 165, 166, 167, 168, 0,
2551 169, 170, 171, 172, 173, 0, 0, 0, 0, 0,
2552 174, 0, 0, 175, 0, 0, 176, 137, 138, 139,
2553 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
2554 150, 151, 152, 153, 154, 155, 156, 0, 157, 158,
2555 0, 0, 159, 160, 161, 0, 0, 0, 0, 0,
2556 162, 136, 0, 163, 0, 164, 165, 166, 167, 168,
2557 0, 169, 170, 171, 172, 173, 0, 0, 0, 0,
2558 0, 174, 0, 0, 175, 0, 0, 176, 137, 138,
2559 139, 140, 141, 142, 143, 144, 145, 0, 0, 0,
2560 0, 0, 0, 0, 0, 0, 0, 156, 0, 157,
2561 158, 0, 0, 159, 160, 161, 0, 0, 0, 0,
2562 0, 0, 136, 0, 0, 0, 164, 165, 166, 167,
2563 168, 0, 169, 170, 171, 172, 173, 0, 0, 0,
2564 0, 0, 174, 0, 0, 175, 0, 0, 176, 137,
2565 138, 139, 140, 141, 142, 143, 144, 145, 0, 0,
2566 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2567 157, 158, 0, 0, 159, 160, 161, 0, 0, 0,
2568 0, 0, 0, 136, 0, 0, 0, 164, 165, 166,
2569 167, 168, 0, 169, 170, 171, 172, 173, 0, 0,
2570 0, 0, 0, 174, 0, 0, 175, 0, 0, 176,
2571 137, 138, 139, 140, 141, 142, 143, 144, 145, 0,
2572 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2573 0, 157, 158, 0, 0, 159, 160, 161, 0, 0,
2574 0, 0, 0, 0, 136, 0, 0, 0, 0, 165,
2575 166, 167, 168, 0, 169, 170, 171, 172, 173, 0,
2576 0, 0, 0, 0, 174, 0, 0, 175, 0, 0,
2577 176, 137, 138, 139, 140, 141, 142, 143, 144, 145,
2578 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2579 0, 0, 157, 158, 0, 0, 159, 160, 161, 0,
2580 0, 0, 0, 0, 0, 136, 0, 0, 0, 0,
2581 0, 166, 167, 168, 0, 169, 170, 171, 172, 173,
2582 0, 0, 0, 0, 0, 174, 0, 0, 175, 0,
2583 0, 176, 137, 138, 139, 140, 141, 142, 143, 144,
2584 145, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2585 0, 0, 0, 157, 158, 0, 0, 159, 160, 161,
2586 0, 0, 0, 0, 0, 0, 136, 0, 0, 0,
2587 0, 0, -206, 167, 168, 0, 169, 170, 171, 172,
2588 173, 0, 0, 0, 0, 0, 174, 0, 0, 175,
2589 0, 0, 176, 137, 138, 139, -206, -206, -206, -206,
2590 144, 145, 0, 0, 0, 0, 0, 0, 0, 0,
2591 0, 0, 0, 0, 157, 158, 0, 0, 159, 160,
2592 161, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2593 0, 0, 0, 0, 167, 168, 0, 169, 170, 171,
2594 172, 173, 0, 0, 0, 0, 0, 174, 0, 0,
2598 static const yytype_int16 yycheck[] =
2600 0, 0, 0, 0, 22, 25, 82, 53, 201, 49,
2601 103, 97, 3, 206, 3, 97, 0, 35, 44, 37,
2602 38, 3, 40, 41, 42, 43, 44, 298, 45, 34,
2603 99, 0, 13, 3, 103, 27, 18, 221, 3, 0,
2604 32, 126, 97, 129, 25, 50, 230, 129, 48, 48,
2605 48, 48, 3, 18, 359, 3, 4, 5, 302, 7,
2606 8, 9, 10, 11, 48, 4, 3, 18, 7, 8,
2607 9, 3, 11, 344, 129, 3, 24, 94, 26, 48,
2608 28, 18, 100, 176, 328, 103, 126, 48, 123, 126,
2609 18, 126, 26, 3, 122, 123, 44, 31, 35, 90,
2610 122, 90, 126, 347, 52, 44, 54, 55, 18, 202,
2611 126, 45, 126, 384, 358, 54, 55, 135, 136, 137,
2612 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
2613 148, 149, 150, 151, 152, 153, 154, 155, 156, 87,
2614 88, 159, 160, 161, 162, 163, 164, 165, 166, 167,
2615 168, 169, 170, 171, 172, 173, 174, 122, 176, 343,
2616 186, 178, 113, 33, 181, 182, 471, 0, 186, 96,
2617 97, 97, 120, 97, 122, 419, 113, 421, 126, 67,
2618 198, 97, 3, 4, 202, 97, 126, 213, 214, 3,
2619 216, 61, 123, 126, 211, 213, 214, 126, 216, 199,
2620 199, 394, 278, 129, 123, 432, 223, 224, 121, 436,
2621 437, 99, 97, 129, 3, 4, 5, 129, 7, 8,
2622 9, 10, 11, 103, 128, 97, 302, 454, 87, 88,
2623 3, 307, 67, 3, 96, 24, 67, 26, 422, 28,
2624 467, 3, 31, 26, 3, 472, 35, 30, 31, 3,
2625 87, 88, 328, 42, 438, 44, 45, 3, 3, 17,
2626 43, 120, 45, 52, 123, 54, 55, 126, 3, 96,
2627 13, 347, 129, 62, 103, 112, 113, 114, 17, 97,
2628 3, 53, 358, 120, 53, 129, 123, 287, 287, 126,
2629 3, 3, 476, 129, 294, 294, 126, 3, 87, 88,
2630 320, 129, 322, 128, 97, 128, 103, 325, 99, 126,
2631 122, 357, 16, 99, 122, 332, 123, 128, 122, 97,
2632 99, 110, 348, 122, 122, 126, 115, 116, 354, 129,
2633 348, 120, 64, 122, 129, 103, 354, 126, 128, 3,
2634 3, 361, 26, 419, 128, 421, 122, 128, 128, 0,
2635 3, 128, 3, 4, 5, 129, 7, 8, 9, 10,
2636 11, 12, 13, 14, 15, 126, 122, 18, 19, 20,
2637 21, 128, 23, 24, 25, 48, 129, 28, 128, 294,
2638 287, 401, 324, 186, 35, 53, 37, 38, 406, 40,
2639 315, 42, 122, 44, 409, 46, 47, 48, 409, 64,
2640 51, 52, 402, 54, 55, 390, 429, 390, 446, 382,
2641 451, 62, 63, 19, 20, 21, 18, 23, 361, 25,
2642 340, -1, -1, 423, 423, 423, 423, 87, 88, 429,
2643 -1, 37, -1, -1, -1, -1, 87, 88, -1, 45,
2644 46, 47, 48, -1, -1, 96, 446, 446, 446, 446,
2645 110, 111, 112, 113, 114, -1, -1, -1, -1, 110,
2646 120, -1, -1, 123, 115, 116, 126, -1, -1, 120,
2647 -1, 122, -1, 0, -1, 126, 3, 4, 5, -1,
2648 7, 8, 9, 10, 11, 12, 13, 14, 15, -1,
2649 96, 18, 19, 20, 21, -1, 23, 24, 25, -1,
2650 -1, 28, -1, -1, -1, -1, -1, -1, 35, -1,
2651 37, 38, -1, 40, -1, 42, -1, 44, -1, 46,
2652 47, 48, 128, -1, 51, 52, -1, 54, 55, -1,
2653 -1, -1, -1, -1, -1, 62, 63, -1, -1, -1,
2654 -1, -1, -1, -1, -1, -1, -1, -1, 19, 20,
2655 21, -1, 23, -1, 25, -1, -1, -1, -1, -1,
2656 87, 88, -1, -1, -1, -1, 37, -1, -1, 96,
2657 -1, -1, -1, -1, 45, 46, 47, 48, -1, -1,
2658 -1, -1, -1, 110, -1, -1, -1, -1, 115, 116,
2659 -1, -1, -1, 120, -1, 122, 3, 4, 5, 126,
2660 7, 8, 9, 10, 11, 12, 13, 14, 15, -1,
2661 -1, -1, 19, 20, 21, 22, 23, 24, 25, 26,
2662 -1, 28, 29, -1, 31, 96, -1, -1, 35, 36,
2663 37, 38, -1, 40, 41, 42, -1, 44, 45, 46,
2664 47, 48, -1, -1, 51, 52, -1, 54, 55, -1,
2665 -1, -1, -1, -1, -1, 62, 63, 128, 65, 19,
2666 20, 21, -1, 23, -1, 25, -1, -1, -1, -1,
2667 -1, -1, -1, -1, -1, -1, -1, 37, -1, -1,
2668 87, 88, -1, -1, -1, -1, 46, 47, 48, 96,
2669 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2670 -1, -1, -1, 110, -1, -1, -1, -1, 115, 116,
2671 -1, -1, -1, 120, -1, 122, -1, -1, -1, 126,
2672 -1, 128, 3, 4, 5, -1, 7, 8, 9, 10,
2673 11, 12, 13, 14, 15, -1, -1, -1, 19, 20,
2674 21, 22, 23, 24, 25, 26, -1, 28, 29, -1,
2675 31, -1, -1, -1, 35, 36, 37, 38, -1, 40,
2676 41, 42, -1, 44, 45, 46, 47, 48, -1, -1,
2677 51, 52, -1, 54, 55, -1, -1, -1, -1, -1,
2678 -1, 62, 63, -1, 65, -1, -1, -1, -1, -1,
2679 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2680 -1, -1, -1, -1, -1, -1, 87, 88, -1, -1,
2681 -1, -1, -1, -1, -1, 96, -1, -1, -1, -1,
2682 -1, -1, -1, -1, -1, -1, -1, -1, -1, 110,
2683 -1, -1, -1, -1, 115, 116, -1, -1, -1, 120,
2684 -1, 122, -1, -1, -1, 126, -1, 128, 3, 4,
2685 5, -1, 7, 8, 9, 10, 11, 12, 13, 14,
2686 15, -1, -1, -1, 19, 20, 21, -1, 23, 24,
2687 25, -1, -1, 28, -1, 39, -1, -1, -1, -1,
2688 35, -1, 37, 38, -1, 40, -1, 42, -1, 44,
2689 -1, 46, 47, 48, -1, -1, 51, 52, -1, 54,
2690 55, -1, 66, 67, 68, -1, -1, 62, 63, 73,
2691 74, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2692 -1, -1, -1, 87, 88, -1, -1, 91, 92, 93,
2693 -1, -1, 87, 88, -1, -1, -1, -1, -1, -1,
2694 -1, 96, -1, 107, 108, -1, 110, 111, 112, 113,
2695 114, -1, -1, -1, -1, 110, 120, -1, -1, 123,
2696 115, 116, 126, -1, -1, 120, -1, 122, -1, -1,
2697 -1, 126, -1, 128, 3, 4, 5, -1, 7, 8,
2698 9, 10, 11, 12, 13, 14, 15, -1, -1, -1,
2699 19, 20, 21, -1, 23, 24, 25, -1, -1, 28,
2700 -1, 39, -1, -1, -1, -1, 35, -1, 37, 38,
2701 -1, 40, -1, 42, -1, 44, -1, 46, 47, 48,
2702 -1, -1, 51, 52, -1, 54, 55, -1, -1, -1,
2703 -1, -1, -1, 62, 63, 73, 74, -1, -1, -1,
2704 -1, -1, -1, -1, -1, -1, -1, -1, -1, 87,
2705 88, -1, -1, 91, 92, 93, -1, -1, 87, 88,
2706 -1, -1, -1, -1, -1, -1, -1, 96, -1, 107,
2707 108, -1, 110, 111, 112, 113, 114, -1, -1, -1,
2708 -1, 110, 120, -1, -1, 123, 115, 116, 126, -1,
2709 -1, 120, -1, 122, -1, -1, -1, 126, -1, 128,
2710 3, 4, 5, -1, 7, 8, 9, 10, 11, 12,
2711 13, 14, 15, -1, -1, -1, 19, 20, 21, -1,
2712 23, 24, 25, -1, -1, 28, -1, -1, -1, -1,
2713 -1, -1, 35, -1, 37, 38, -1, 40, -1, 42,
2714 -1, 44, -1, 46, 47, 48, -1, -1, 51, 52,
2715 -1, 54, 55, -1, -1, -1, -1, -1, -1, 62,
2716 63, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2717 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2718 -1, -1, -1, -1, 87, 88, -1, -1, -1, -1,
2719 -1, -1, -1, 96, -1, -1, -1, -1, -1, -1,
2720 -1, -1, -1, -1, -1, -1, -1, 110, -1, -1,
2721 -1, -1, 115, 116, -1, -1, -1, 120, -1, 122,
2722 -1, -1, -1, 126, -1, 128, 3, 4, 5, -1,
2723 7, 8, 9, 10, 11, 12, 13, 14, 15, -1,
2724 -1, -1, 19, 20, 21, -1, 23, 24, 25, -1,
2725 -1, 28, -1, -1, -1, -1, -1, -1, 35, -1,
2726 37, 38, -1, 40, -1, 42, -1, 44, -1, 46,
2727 47, 48, -1, -1, 51, 52, -1, 54, 55, -1,
2728 -1, -1, -1, -1, -1, 62, 63, -1, -1, -1,
2729 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2730 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2731 87, 88, -1, -1, -1, -1, -1, -1, -1, 96,
2732 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2733 -1, -1, -1, 110, -1, -1, -1, -1, 115, 116,
2734 -1, -1, -1, 120, -1, 122, -1, -1, -1, 126,
2735 -1, 128, 3, 4, 5, -1, 7, 8, 9, 10,
2736 11, 12, 13, 14, 15, -1, 17, -1, 19, 20,
2737 21, 22, 23, 24, 25, 26, -1, 28, 29, -1,
2738 31, -1, -1, -1, 35, 36, 37, 38, -1, 40,
2739 41, 42, -1, 44, 45, 46, 47, 48, -1, -1,
2740 51, 52, -1, 54, 55, -1, -1, -1, -1, -1,
2741 -1, 62, 63, -1, 65, -1, -1, -1, -1, -1,
2742 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2743 -1, -1, -1, -1, -1, -1, 87, 88, -1, -1,
2744 -1, -1, -1, -1, -1, 96, -1, -1, -1, -1,
2745 -1, -1, -1, -1, -1, -1, -1, -1, -1, 110,
2746 -1, -1, -1, -1, 115, 116, -1, -1, -1, 120,
2747 -1, 122, 3, 4, 5, 126, 7, 8, 9, 10,
2748 11, 12, 13, 14, 15, -1, -1, -1, 19, 20,
2749 21, 22, 23, 24, 25, 26, -1, 28, 29, -1,
2750 31, -1, -1, -1, 35, 36, 37, 38, -1, 40,
2751 41, 42, -1, 44, 45, 46, 47, 48, -1, -1,
2752 51, 52, -1, 54, 55, -1, -1, -1, -1, -1,
2753 -1, 62, 63, -1, 65, -1, -1, -1, -1, -1,
2754 -1, 3, 4, 5, -1, 7, 8, 9, 10, 11,
2755 -1, -1, -1, -1, -1, -1, 87, 88, -1, -1,
2756 -1, -1, 24, -1, 26, 96, 28, -1, -1, -1,
2757 -1, -1, -1, 35, -1, -1, -1, -1, -1, 110,
2758 42, -1, 44, -1, 115, 116, -1, -1, -1, 120,
2759 52, 122, 54, 55, -1, 126, -1, -1, -1, -1,
2760 62, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2761 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2762 -1, -1, -1, -1, -1, 87, 88, -1, -1, -1,
2763 -1, -1, -1, -1, -1, -1, -1, -1, 39, -1,
2764 -1, -1, -1, -1, -1, -1, -1, -1, 110, -1,
2765 -1, -1, -1, 115, 116, -1, -1, -1, 120, -1,
2766 122, -1, -1, -1, 126, 66, 67, 68, 69, 70,
2767 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
2768 81, 82, 83, 84, 85, -1, 87, 88, -1, -1,
2769 91, 92, 93, -1, -1, -1, -1, -1, 99, -1,
2770 -1, 102, 39, 104, 105, 106, 107, 108, -1, 110,
2771 111, 112, 113, 114, -1, -1, -1, -1, -1, 120,
2772 -1, -1, 123, -1, -1, 126, -1, -1, 129, 66,
2773 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
2774 77, 78, 79, 80, 81, 82, 83, 84, 85, -1,
2775 87, 88, -1, -1, 91, 92, 93, -1, -1, -1,
2776 -1, -1, 99, -1, -1, 102, 39, 104, 105, 106,
2777 107, 108, -1, 110, 111, 112, 113, 114, -1, -1,
2778 -1, -1, -1, 120, -1, -1, 123, -1, -1, 126,
2779 -1, -1, 129, 66, 67, 68, 69, 70, 71, 72,
2780 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
2781 83, 84, 85, -1, 87, 88, -1, -1, 91, 92,
2782 93, -1, -1, -1, -1, -1, 99, 39, -1, 102,
2783 103, 104, 105, 106, 107, 108, -1, 110, 111, 112,
2784 113, 114, -1, -1, -1, -1, -1, 120, -1, -1,
2785 123, -1, -1, 126, 66, 67, 68, 69, 70, 71,
2786 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
2787 82, 83, 84, 85, -1, 87, 88, -1, -1, 91,
2788 92, 93, -1, -1, -1, -1, -1, 99, 39, -1,
2789 102, -1, 104, 105, 106, 107, 108, -1, 110, 111,
2790 112, 113, 114, -1, -1, -1, -1, -1, 120, 121,
2791 -1, 123, -1, -1, 126, 66, 67, 68, 69, 70,
2792 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
2793 81, 82, 83, 84, 85, -1, 87, 88, -1, -1,
2794 91, 92, 93, -1, -1, -1, -1, -1, 99, 39,
2795 -1, 102, 103, 104, 105, 106, 107, 108, -1, 110,
2796 111, 112, 113, 114, -1, -1, -1, -1, -1, 120,
2797 -1, -1, 123, -1, -1, 126, 66, 67, 68, 69,
2798 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
2799 80, 81, 82, 83, 84, 85, -1, 87, 88, -1,
2800 -1, 91, 92, 93, -1, -1, -1, -1, -1, 99,
2801 39, -1, 102, 103, 104, 105, 106, 107, 108, -1,
2802 110, 111, 112, 113, 114, -1, -1, -1, -1, -1,
2803 120, -1, -1, 123, -1, -1, 126, 66, 67, 68,
2804 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
2805 79, 80, 81, 82, 83, 84, 85, -1, 87, 88,
2806 -1, -1, 91, 92, 93, -1, -1, -1, -1, -1,
2807 99, 39, -1, 102, -1, 104, 105, 106, 107, 108,
2808 -1, 110, 111, 112, 113, 114, -1, -1, -1, -1,
2809 -1, 120, -1, -1, 123, -1, -1, 126, 66, 67,
2810 68, 69, 70, 71, 72, 73, 74, -1, -1, -1,
2811 -1, -1, -1, -1, -1, -1, -1, 85, -1, 87,
2812 88, -1, -1, 91, 92, 93, -1, -1, -1, -1,
2813 -1, -1, 39, -1, -1, -1, 104, 105, 106, 107,
2814 108, -1, 110, 111, 112, 113, 114, -1, -1, -1,
2815 -1, -1, 120, -1, -1, 123, -1, -1, 126, 66,
2816 67, 68, 69, 70, 71, 72, 73, 74, -1, -1,
2817 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2818 87, 88, -1, -1, 91, 92, 93, -1, -1, -1,
2819 -1, -1, -1, 39, -1, -1, -1, 104, 105, 106,
2820 107, 108, -1, 110, 111, 112, 113, 114, -1, -1,
2821 -1, -1, -1, 120, -1, -1, 123, -1, -1, 126,
2822 66, 67, 68, 69, 70, 71, 72, 73, 74, -1,
2823 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2824 -1, 87, 88, -1, -1, 91, 92, 93, -1, -1,
2825 -1, -1, -1, -1, 39, -1, -1, -1, -1, 105,
2826 106, 107, 108, -1, 110, 111, 112, 113, 114, -1,
2827 -1, -1, -1, -1, 120, -1, -1, 123, -1, -1,
2828 126, 66, 67, 68, 69, 70, 71, 72, 73, 74,
2829 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2830 -1, -1, 87, 88, -1, -1, 91, 92, 93, -1,
2831 -1, -1, -1, -1, -1, 39, -1, -1, -1, -1,
2832 -1, 106, 107, 108, -1, 110, 111, 112, 113, 114,
2833 -1, -1, -1, -1, -1, 120, -1, -1, 123, -1,
2834 -1, 126, 66, 67, 68, 69, 70, 71, 72, 73,
2835 74, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2836 -1, -1, -1, 87, 88, -1, -1, 91, 92, 93,
2837 -1, -1, -1, -1, -1, -1, 39, -1, -1, -1,
2838 -1, -1, 106, 107, 108, -1, 110, 111, 112, 113,
2839 114, -1, -1, -1, -1, -1, 120, -1, -1, 123,
2840 -1, -1, 126, 66, 67, 68, 69, 70, 71, 72,
2841 73, 74, -1, -1, -1, -1, -1, -1, -1, -1,
2842 -1, -1, -1, -1, 87, 88, -1, -1, 91, 92,
2843 93, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2844 -1, -1, -1, -1, 107, 108, -1, 110, 111, 112,
2845 113, 114, -1, -1, -1, -1, -1, 120, -1, -1,
2849 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2850 symbol of state STATE-NUM. */
2851 static const yytype_uint8 yystos[] =
2853 0, 3, 4, 5, 7, 8, 9, 10, 11, 12,
2854 13, 14, 15, 18, 19, 20, 21, 23, 24, 25,
2855 26, 28, 35, 37, 38, 40, 42, 44, 46, 47,
2856 48, 51, 52, 54, 55, 62, 63, 87, 88, 96,
2857 110, 115, 116, 120, 122, 126, 131, 132, 133, 134,
2858 140, 143, 149, 153, 154, 155, 156, 158, 166, 174,
2859 177, 180, 183, 184, 185, 186, 190, 192, 201, 208,
2860 211, 222, 223, 224, 227, 228, 229, 230, 233, 49,
2861 126, 126, 159, 126, 3, 18, 122, 178, 179, 3,
2862 213, 3, 210, 229, 126, 3, 179, 213, 214, 215,
2863 126, 122, 123, 126, 229, 126, 229, 229, 229, 229,
2864 229, 220, 221, 226, 229, 226, 231, 232, 227, 0,
2865 134, 3, 31, 45, 145, 151, 152, 228, 26, 30,
2866 31, 43, 45, 200, 186, 97, 39, 66, 67, 68,
2867 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
2868 79, 80, 81, 82, 83, 84, 85, 87, 88, 91,
2869 92, 93, 99, 102, 104, 105, 106, 107, 108, 110,
2870 111, 112, 113, 114, 120, 123, 126, 126, 157, 22,
2871 29, 36, 41, 45, 65, 96, 122, 140, 141, 142,
2872 145, 160, 161, 176, 184, 225, 234, 235, 167, 182,
2873 122, 123, 126, 219, 126, 227, 123, 229, 175, 3,
2874 220, 150, 121, 97, 103, 128, 97, 129, 3, 146,
2875 147, 3, 146, 96, 67, 34, 50, 207, 3, 3,
2876 3, 229, 229, 229, 229, 229, 229, 229, 229, 229,
2877 229, 229, 229, 229, 229, 229, 229, 229, 229, 229,
2878 229, 229, 229, 229, 229, 229, 229, 229, 229, 229,
2879 229, 229, 229, 229, 229, 229, 229, 229, 229, 3,
2880 220, 227, 17, 3, 227, 227, 3, 128, 139, 141,
2881 229, 96, 13, 17, 229, 96, 135, 136, 137, 143,
2882 190, 192, 201, 208, 181, 178, 220, 3, 90, 204,
2883 205, 206, 129, 3, 113, 129, 138, 139, 129, 227,
2884 226, 226, 226, 103, 218, 97, 218, 227, 227, 3,
2885 53, 187, 53, 188, 218, 103, 121, 129, 129, 3,
2886 128, 141, 126, 3, 129, 128, 137, 135, 129, 99,
2887 103, 202, 206, 129, 97, 142, 128, 129, 103, 35,
2888 113, 179, 215, 217, 99, 144, 147, 96, 129, 126,
2889 215, 16, 189, 215, 216, 122, 144, 229, 142, 227,
2890 99, 122, 128, 4, 7, 8, 9, 11, 44, 54,
2891 55, 203, 217, 218, 90, 206, 27, 32, 168, 170,
2892 172, 173, 142, 226, 123, 226, 228, 142, 204, 216,
2893 122, 97, 193, 129, 3, 4, 33, 61, 162, 163,
2894 164, 165, 202, 122, 206, 122, 126, 168, 170, 64,
2895 148, 129, 129, 191, 215, 45, 96, 184, 197, 198,
2896 199, 229, 103, 128, 164, 165, 212, 171, 3, 142,
2897 142, 218, 96, 140, 184, 194, 195, 196, 201, 208,
2898 3, 26, 128, 199, 103, 138, 138, 138, 218, 122,
2899 128, 196, 207, 138, 128, 128, 129, 209, 3, 169,
2900 138, 126, 122, 128, 204, 138, 129, 128, 218
2903 #define yyerrok (yyerrstatus = 0)
2904 #define yyclearin (yychar = YYEMPTY)
2905 #define YYEMPTY (-2)
2908 #define YYACCEPT goto yyacceptlab
2909 #define YYABORT goto yyabortlab
2910 #define YYERROR goto yyerrorlab
2913 /* Like YYERROR except do call yyerror. This remains here temporarily
2914 to ease the transition to the new meaning of YYERROR, for GCC.
2915 Once GCC version 2 has supplanted version 1, this can go. */
2917 #define YYFAIL goto yyerrlab
2919 #define YYRECOVERING() (!!yyerrstatus)
2921 #define YYBACKUP(Token, Value) \
2923 if (yychar == YYEMPTY && yylen == 1) \
2927 yytoken = YYTRANSLATE (yychar); \
2933 yyerror (YY_("syntax error: cannot back up")); \
2940 #define YYERRCODE 256
2943 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2944 If N is 0, then set CURRENT to the empty location which ends
2945 the previous symbol: RHS[0] (always defined). */
2947 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2948 #ifndef YYLLOC_DEFAULT
2949 # define YYLLOC_DEFAULT(Current, Rhs, N) \
2953 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
2954 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
2955 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
2956 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
2960 (Current).first_line = (Current).last_line = \
2961 YYRHSLOC (Rhs, 0).last_line; \
2962 (Current).first_column = (Current).last_column = \
2963 YYRHSLOC (Rhs, 0).last_column; \
2969 /* YY_LOCATION_PRINT -- Print the location on the stream.
2970 This macro was not mandated originally: define only if we know
2971 we won't break user code: when these are the locations we know. */
2973 #ifndef YY_LOCATION_PRINT
2974 # if YYLTYPE_IS_TRIVIAL
2975 # define YY_LOCATION_PRINT(File, Loc) \
2976 fprintf (File, "%d.%d-%d.%d", \
2977 (Loc).first_line, (Loc).first_column, \
2978 (Loc).last_line, (Loc).last_column)
2980 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2985 /* YYLEX -- calling `yylex' with the right arguments. */
2988 # define YYLEX yylex (YYLEX_PARAM)
2990 # define YYLEX yylex ()
2993 /* Enable debugging if requested. */
2997 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2998 # define YYFPRINTF fprintf
3001 # define YYDPRINTF(Args) \
3007 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
3011 YYFPRINTF (stderr, "%s ", Title); \
3012 yy_symbol_print (stderr, \
3014 YYFPRINTF (stderr, "\n"); \
3019 /*--------------------------------.
3020 | Print this symbol on YYOUTPUT. |
3021 `--------------------------------*/
3024 #if (defined __STDC__ || defined __C99__FUNC__ \
3025 || defined __cplusplus || defined _MSC_VER)
3027 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3030 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
3033 YYSTYPE const * const yyvaluep;
3039 if (yytype < YYNTOKENS)
3040 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
3052 /*--------------------------------.
3053 | Print this symbol on YYOUTPUT. |
3054 `--------------------------------*/
3056 #if (defined __STDC__ || defined __C99__FUNC__ \
3057 || defined __cplusplus || defined _MSC_VER)
3059 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3062 yy_symbol_print (yyoutput, yytype, yyvaluep)
3065 YYSTYPE const * const yyvaluep;
3068 if (yytype < YYNTOKENS)
3069 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
3071 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
3073 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
3074 YYFPRINTF (yyoutput, ")");
3077 /*------------------------------------------------------------------.
3078 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3080 `------------------------------------------------------------------*/
3082 #if (defined __STDC__ || defined __C99__FUNC__ \
3083 || defined __cplusplus || defined _MSC_VER)
3085 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
3088 yy_stack_print (yybottom, yytop)
3089 yytype_int16 *yybottom;
3090 yytype_int16 *yytop;
3093 YYFPRINTF (stderr, "Stack now");
3094 for (; yybottom <= yytop; yybottom++)
3096 int yybot = *yybottom;
3097 YYFPRINTF (stderr, " %d", yybot);
3099 YYFPRINTF (stderr, "\n");
3102 # define YY_STACK_PRINT(Bottom, Top) \
3105 yy_stack_print ((Bottom), (Top)); \
3109 /*------------------------------------------------.
3110 | Report that the YYRULE is going to be reduced. |
3111 `------------------------------------------------*/
3113 #if (defined __STDC__ || defined __C99__FUNC__ \
3114 || defined __cplusplus || defined _MSC_VER)
3116 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3119 yy_reduce_print (yyvsp, yyrule)
3124 int yynrhs = yyr2[yyrule];
3126 unsigned long int yylno = yyrline[yyrule];
3127 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3129 /* The symbols being reduced. */
3130 for (yyi = 0; yyi < yynrhs; yyi++)
3132 YYFPRINTF (stderr, " $%d = ", yyi + 1);
3133 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3134 &(yyvsp[(yyi + 1) - (yynrhs)])
3136 YYFPRINTF (stderr, "\n");
3140 # define YY_REDUCE_PRINT(Rule) \
3143 yy_reduce_print (yyvsp, Rule); \
3146 /* Nonzero means print parse trace. It is left uninitialized so that
3147 multiple parsers can coexist. */
3149 #else /* !YYDEBUG */
3150 # define YYDPRINTF(Args)
3151 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3152 # define YY_STACK_PRINT(Bottom, Top)
3153 # define YY_REDUCE_PRINT(Rule)
3154 #endif /* !YYDEBUG */
3157 /* YYINITDEPTH -- initial size of the parser's stacks. */
3159 # define YYINITDEPTH 200
3162 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3163 if the built-in stack extension method is used).
3165 Do not make this value too large; the results are undefined if
3166 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3167 evaluated with infinite-precision integer arithmetic. */
3170 # define YYMAXDEPTH 10000
3178 # if defined __GLIBC__ && defined _STRING_H
3179 # define yystrlen strlen
3181 /* Return the length of YYSTR. */
3182 #if (defined __STDC__ || defined __C99__FUNC__ \
3183 || defined __cplusplus || defined _MSC_VER)
3185 yystrlen (const char *yystr)
3193 for (yylen = 0; yystr[yylen]; yylen++)
3201 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3202 # define yystpcpy stpcpy
3204 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3206 #if (defined __STDC__ || defined __C99__FUNC__ \
3207 || defined __cplusplus || defined _MSC_VER)
3209 yystpcpy (char *yydest, const char *yysrc)
3212 yystpcpy (yydest, yysrc)
3218 const char *yys = yysrc;
3220 while ((*yyd++ = *yys++) != '\0')
3229 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3230 quotes and backslashes, so that it's suitable for yyerror. The
3231 heuristic is that double-quoting is unnecessary unless the string
3232 contains an apostrophe, a comma, or backslash (other than
3233 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3234 null, do not copy; instead, return the length of what the result
3237 yytnamerr (char *yyres, const char *yystr)
3242 char const *yyp = yystr;
3249 goto do_not_strip_quotes;
3253 goto do_not_strip_quotes;
3266 do_not_strip_quotes: ;
3270 return yystrlen (yystr);
3272 return yystpcpy (yyres, yystr) - yyres;
3276 /* Copy into YYRESULT an error message about the unexpected token
3277 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3278 including the terminating null byte. If YYRESULT is null, do not
3279 copy anything; just return the number of bytes that would be
3280 copied. As a special case, return 0 if an ordinary "syntax error"
3281 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3282 size calculation. */
3284 yysyntax_error (char *yyresult, int yystate, int yychar)
3286 int yyn = yypact[yystate];
3288 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3292 int yytype = YYTRANSLATE (yychar);
3293 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3294 YYSIZE_T yysize = yysize0;
3296 int yysize_overflow = 0;
3297 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3298 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3302 /* This is so xgettext sees the translatable formats that are
3303 constructed on the fly. */
3304 YY_("syntax error, unexpected %s");
3305 YY_("syntax error, unexpected %s, expecting %s");
3306 YY_("syntax error, unexpected %s, expecting %s or %s");
3307 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3308 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3312 static char const yyunexpected[] = "syntax error, unexpected %s";
3313 static char const yyexpecting[] = ", expecting %s";
3314 static char const yyor[] = " or %s";
3315 char yyformat[sizeof yyunexpected
3316 + sizeof yyexpecting - 1
3317 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3318 * (sizeof yyor - 1))];
3319 char const *yyprefix = yyexpecting;
3321 /* Start YYX at -YYN if negative to avoid negative indexes in
3323 int yyxbegin = yyn < 0 ? -yyn : 0;
3325 /* Stay within bounds of both yycheck and yytname. */
3326 int yychecklim = YYLAST - yyn + 1;
3327 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3330 yyarg[0] = yytname[yytype];
3331 yyfmt = yystpcpy (yyformat, yyunexpected);
3333 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3334 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3336 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3340 yyformat[sizeof yyunexpected - 1] = '\0';
3343 yyarg[yycount++] = yytname[yyx];
3344 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3345 yysize_overflow |= (yysize1 < yysize);
3347 yyfmt = yystpcpy (yyfmt, yyprefix);
3351 yyf = YY_(yyformat);
3352 yysize1 = yysize + yystrlen (yyf);
3353 yysize_overflow |= (yysize1 < yysize);
3356 if (yysize_overflow)
3357 return YYSIZE_MAXIMUM;
3361 /* Avoid sprintf, as that infringes on the user's name space.
3362 Don't have undefined behavior even if the translation
3363 produced a string with the wrong number of "%s"s. */
3364 char *yyp = yyresult;
3366 while ((*yyp = *yyf) != '\0')
3368 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3370 yyp += yytnamerr (yyp, yyarg[yyi++]);
3383 #endif /* YYERROR_VERBOSE */
3386 /*-----------------------------------------------.
3387 | Release the memory associated to this symbol. |
3388 `-----------------------------------------------*/
3391 #if (defined __STDC__ || defined __C99__FUNC__ \
3392 || defined __cplusplus || defined _MSC_VER)
3394 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
3397 yydestruct (yymsg, yytype, yyvaluep)
3407 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
3417 /* Prevent warnings from -Wmissing-prototypes. */
3418 #ifdef YYPARSE_PARAM
3419 #if defined __STDC__ || defined __cplusplus
3420 int yyparse (void *YYPARSE_PARAM);
3424 #else /* ! YYPARSE_PARAM */
3425 #if defined __STDC__ || defined __cplusplus
3430 #endif /* ! YYPARSE_PARAM */
3433 /* The lookahead symbol. */
3436 /* The semantic value of the lookahead symbol. */
3439 /* Number of syntax errors so far. */
3444 /*-------------------------.
3445 | yyparse or yypush_parse. |
3446 `-------------------------*/
3448 #ifdef YYPARSE_PARAM
3449 #if (defined __STDC__ || defined __C99__FUNC__ \
3450 || defined __cplusplus || defined _MSC_VER)
3452 yyparse (void *YYPARSE_PARAM)
3455 yyparse (YYPARSE_PARAM)
3456 void *YYPARSE_PARAM;
3458 #else /* ! YYPARSE_PARAM */
3459 #if (defined __STDC__ || defined __C99__FUNC__ \
3460 || defined __cplusplus || defined _MSC_VER)
3473 /* Number of tokens to shift before error messages enabled. */
3476 /* The stacks and their tools:
3477 `yyss': related to states.
3478 `yyvs': related to semantic values.
3480 Refer to the stacks thru separate pointers, to allow yyoverflow
3481 to reallocate them elsewhere. */
3483 /* The state stack. */
3484 yytype_int16 yyssa[YYINITDEPTH];
3486 yytype_int16 *yyssp;
3488 /* The semantic value stack. */
3489 YYSTYPE yyvsa[YYINITDEPTH];
3493 YYSIZE_T yystacksize;
3497 /* Lookahead token as an internal (translated) token number. */
3499 /* The variables used to return semantic value and location from the
3504 /* Buffer for error messages, and its allocated size. */
3506 char *yymsg = yymsgbuf;
3507 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
3510 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
3512 /* The number of symbols on the RHS of the reduced rule.
3513 Keep to zero when no symbol should be popped. */
3519 yystacksize = YYINITDEPTH;
3521 YYDPRINTF ((stderr, "Starting parse\n"));
3526 yychar = YYEMPTY; /* Cause a token to be read. */
3528 /* Initialize stack pointers.
3529 Waste one element of value and location stack
3530 so that they stay on the same level as the state stack.
3531 The wasted elements are never initialized. */
3537 /*------------------------------------------------------------.
3538 | yynewstate -- Push a new state, which is found in yystate. |
3539 `------------------------------------------------------------*/
3541 /* In all cases, when you get here, the value and location stacks
3542 have just been pushed. So pushing a state here evens the stacks. */
3548 if (yyss + yystacksize - 1 <= yyssp)
3550 /* Get the current used size of the three stacks, in elements. */
3551 YYSIZE_T yysize = yyssp - yyss + 1;
3555 /* Give user a chance to reallocate the stack. Use copies of
3556 these so that the &'s don't force the real ones into
3558 YYSTYPE *yyvs1 = yyvs;
3559 yytype_int16 *yyss1 = yyss;
3561 /* Each stack pointer address is followed by the size of the
3562 data in use in that stack, in bytes. This used to be a
3563 conditional around just the two extra args, but that might
3564 be undefined if yyoverflow is a macro. */
3565 yyoverflow (YY_("memory exhausted"),
3566 &yyss1, yysize * sizeof (*yyssp),
3567 &yyvs1, yysize * sizeof (*yyvsp),
3573 #else /* no yyoverflow */
3574 # ifndef YYSTACK_RELOCATE
3575 goto yyexhaustedlab;
3577 /* Extend the stack our own way. */
3578 if (YYMAXDEPTH <= yystacksize)
3579 goto yyexhaustedlab;
3581 if (YYMAXDEPTH < yystacksize)
3582 yystacksize = YYMAXDEPTH;
3585 yytype_int16 *yyss1 = yyss;
3586 union yyalloc *yyptr =
3587 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
3589 goto yyexhaustedlab;
3590 YYSTACK_RELOCATE (yyss_alloc, yyss);
3591 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
3592 # undef YYSTACK_RELOCATE
3594 YYSTACK_FREE (yyss1);
3597 #endif /* no yyoverflow */
3599 yyssp = yyss + yysize - 1;
3600 yyvsp = yyvs + yysize - 1;
3602 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
3603 (unsigned long int) yystacksize));
3605 if (yyss + yystacksize - 1 <= yyssp)
3609 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3611 if (yystate == YYFINAL)
3621 /* Do appropriate processing given the current state. Read a
3622 lookahead token if we need one and don't already have one. */
3624 /* First try to decide what to do without reference to lookahead token. */
3625 yyn = yypact[yystate];
3626 if (yyn == YYPACT_NINF)
3629 /* Not known => get a lookahead token if don't already have one. */
3631 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
3632 if (yychar == YYEMPTY)
3634 YYDPRINTF ((stderr, "Reading a token: "));
3638 if (yychar <= YYEOF)
3640 yychar = yytoken = YYEOF;
3641 YYDPRINTF ((stderr, "Now at end of input.\n"));
3645 yytoken = YYTRANSLATE (yychar);
3646 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3649 /* If the proper action on seeing token YYTOKEN is to reduce or to
3650 detect an error, take that action. */
3652 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3657 if (yyn == 0 || yyn == YYTABLE_NINF)
3663 /* Count tokens shifted since error; after three, turn off error
3668 /* Shift the lookahead token. */
3669 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3671 /* Discard the shifted token. */
3680 /*-----------------------------------------------------------.
3681 | yydefault -- do the default action for the current state. |
3682 `-----------------------------------------------------------*/
3684 yyn = yydefact[yystate];
3690 /*-----------------------------.
3691 | yyreduce -- Do a reduction. |
3692 `-----------------------------*/
3694 /* yyn is the number of a rule to reduce with. */
3697 /* If YYLEN is nonzero, implement the default value of the action:
3700 Otherwise, the following line sets YYVAL to garbage.
3701 This behavior is undocumented and Bison
3702 users should not rely upon it. Assigning to YYVAL
3703 unconditionally makes the parser a bit smaller, and it avoids a
3704 GCC warning that YYVAL may be used uninitialized. */
3705 yyval = yyvsp[1-yylen];
3708 YY_REDUCE_PRINT (yyn);
3715 /* Line 1464 of skeleton.m4 */
3716 #line 1621 "parser.y"
3717 {(yyval.code)=(yyvsp[(1) - (1)].code);}
3726 /* Line 1464 of skeleton.m4 */
3727 #line 1622 "parser.y"
3728 {(yyval.code)=code_new();}
3737 /* Line 1464 of skeleton.m4 */
3738 #line 1624 "parser.y"
3739 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
3748 /* Line 1464 of skeleton.m4 */
3749 #line 1625 "parser.y"
3750 {(yyval.code)=(yyvsp[(1) - (1)].code);}
3759 /* Line 1464 of skeleton.m4 */
3760 #line 1640 "parser.y"
3770 /* Line 1464 of skeleton.m4 */
3771 #line 1648 "parser.y"
3772 {/*TODO*/(yyval.code)=0;}
3781 /* Line 1464 of skeleton.m4 */
3782 #line 1649 "parser.y"
3783 {/*TODO*/(yyval.code)=0;}
3792 /* Line 1464 of skeleton.m4 */
3793 #line 1651 "parser.y"
3794 {(yyval.code)=(yyvsp[(2) - (3)].code);}
3803 /* Line 1464 of skeleton.m4 */
3804 #line 1652 "parser.y"
3814 /* Line 1464 of skeleton.m4 */
3815 #line 1653 "parser.y"
3816 {(yyval.code)=(yyvsp[(1) - (2)].code);}
3825 /* Line 1464 of skeleton.m4 */
3826 #line 1654 "parser.y"
3827 {(yyval.code)=(yyvsp[(1) - (1)].code);}
3836 /* Line 1464 of skeleton.m4 */
3837 #line 1658 "parser.y"
3839 code_t**cc = &global->init->method->body->code;
3840 *cc = code_append(*cc, (yyvsp[(1) - (1)].code));
3850 /* Line 1464 of skeleton.m4 */
3851 #line 1665 "parser.y"
3852 {(yyval.value)=(yyvsp[(2) - (2)].value);}
3861 /* Line 1464 of skeleton.m4 */
3862 #line 1666 "parser.y"
3863 {(yyval.value).c=abc_pushundefined(0);
3864 (yyval.value).t=TYPE_ANY;
3874 /* Line 1464 of skeleton.m4 */
3875 #line 1670 "parser.y"
3876 {(yyval.code)=(yyvsp[(2) - (2)].code);}
3885 /* Line 1464 of skeleton.m4 */
3886 #line 1671 "parser.y"
3887 {(yyval.code)=(yyvsp[(2) - (2)].code);}
3896 /* Line 1464 of skeleton.m4 */
3897 #line 1673 "parser.y"
3898 {(yyval.code) = (yyvsp[(1) - (1)].code);}
3907 /* Line 1464 of skeleton.m4 */
3908 #line 1674 "parser.y"
3909 {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));}
3918 /* Line 1464 of skeleton.m4 */
3919 #line 1677 "parser.y"
3921 if(variable_exists((yyvsp[(1) - (3)].id)))
3922 syntaxerror("Variable %s already defined", (yyvsp[(1) - (3)].id));
3924 if(!is_subtype_of((yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo))) {
3925 syntaxerror("Can't convert %s to %s", (yyvsp[(3) - (3)].value).t->name,
3926 (yyvsp[(2) - (3)].classinfo)->name);
3929 int index = new_variable((yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].classinfo), 1);
3931 if((yyvsp[(2) - (3)].classinfo)) {
3932 if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) {
3933 (yyval.code) = (yyvsp[(3) - (3)].value).c;
3934 (yyval.code) = converttype((yyval.code), (yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo));
3935 (yyval.code) = abc_setlocal((yyval.code), index);
3937 (yyval.code) = defaultvalue(0, (yyvsp[(2) - (3)].classinfo));
3938 (yyval.code) = abc_setlocal((yyval.code), index);
3941 if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) {
3942 (yyval.code) = (yyvsp[(3) - (3)].value).c;
3943 (yyval.code) = abc_coerce_a((yyval.code));
3944 (yyval.code) = abc_setlocal((yyval.code), index);
3946 (yyval.code) = code_new();
3950 /* that's the default for a local register, anyway
3952 state->method->initcode = abc_pushundefined(state->method->initcode);
3953 state->method->initcode = abc_setlocal(state->method->initcode, index);
3955 //printf("variable %s -> %d (%s)\n", $2->text, index, $4.t?$4.t->name:"");
3965 /* Line 1464 of skeleton.m4 */
3966 #line 1717 "parser.y"
3967 {(yyval.code) = code_new();}
3976 /* Line 1464 of skeleton.m4 */
3977 #line 1718 "parser.y"
3978 {(yyval.code)=(yyvsp[(2) - (2)].code);}
3987 /* Line 1464 of skeleton.m4 */
3988 #line 1721 "parser.y"
3998 /* Line 1464 of skeleton.m4 */
3999 #line 1721 "parser.y"
4002 (yyval.code) = code_new();
4003 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (7)].value).c);
4004 code_t*myjmp,*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4006 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].code));
4007 if((yyvsp[(7) - (7)].code)) {
4008 myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4010 myif->branch = (yyval.code) = abc_nop((yyval.code));
4011 if((yyvsp[(7) - (7)].code)) {
4012 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (7)].code));
4013 myjmp->branch = (yyval.code) = abc_nop((yyval.code));
4015 (yyval.code) = var_block((yyval.code));
4026 /* Line 1464 of skeleton.m4 */
4027 #line 1740 "parser.y"
4028 {(yyval.code)=code_new();}
4037 /* Line 1464 of skeleton.m4 */
4038 #line 1745 "parser.y"
4040 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1);
4050 /* Line 1464 of skeleton.m4 */
4051 #line 1748 "parser.y"
4053 (yyval.id)=(yyvsp[(1) - (1)].id);
4063 /* Line 1464 of skeleton.m4 */
4064 #line 1752 "parser.y"
4065 {new_state();(yyval.for_start).name=(yyvsp[(1) - (2)].id);(yyval.for_start).each=0;}
4074 /* Line 1464 of skeleton.m4 */
4075 #line 1753 "parser.y"
4076 {new_state();(yyval.for_start).name=(yyvsp[(1) - (3)].id);(yyval.for_start).each=1;}
4085 /* Line 1464 of skeleton.m4 */
4086 #line 1755 "parser.y"
4088 if((yyvsp[(1) - (8)].for_start).each) syntaxerror("invalid syntax: ; not allowed in for each statement");
4089 (yyval.code) = code_new();
4090 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (8)].code));
4091 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4092 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (8)].value).c);
4093 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4094 (yyval.code) = code_append((yyval.code), (yyvsp[(8) - (8)].code));
4095 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4096 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (8)].code));
4097 (yyval.code) = abc_jump((yyval.code), loopstart);
4098 code_t*out = (yyval.code) = abc_nop((yyval.code));
4099 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, out);
4100 continuejumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, cont);
4103 (yyval.code) = var_block((yyval.code));
4114 /* Line 1464 of skeleton.m4 */
4115 #line 1775 "parser.y"
4117 variable_t*var = find_variable((yyvsp[(2) - (6)].id));
4118 char*tmp1name = concat2((yyvsp[(2) - (6)].id), "__tmp1__");
4119 int it = new_variable(tmp1name, TYPE_INT, 0);
4120 char*tmp2name = concat2((yyvsp[(2) - (6)].id), "__array__");
4121 int array = new_variable(tmp1name, 0, 0);
4123 (yyval.code) = code_new();
4124 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
4125 (yyval.code) = abc_coerce_a((yyval.code));
4126 (yyval.code) = abc_setlocal((yyval.code), array);
4127 (yyval.code) = abc_pushbyte((yyval.code), 0);
4128 (yyval.code) = abc_setlocal((yyval.code), it);
4130 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4132 (yyval.code) = abc_hasnext2((yyval.code), array, it);
4133 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4134 (yyval.code) = abc_getlocal((yyval.code), array);
4135 (yyval.code) = abc_getlocal((yyval.code), it);
4136 if(!(yyvsp[(1) - (6)].for_start).each)
4137 (yyval.code) = abc_nextname((yyval.code));
4139 (yyval.code) = abc_nextvalue((yyval.code));
4140 (yyval.code) = converttype((yyval.code), 0, var->type);
4141 (yyval.code) = abc_setlocal((yyval.code), var->index);
4143 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
4144 (yyval.code) = abc_jump((yyval.code), loopstart);
4146 code_t*out = (yyval.code) = abc_nop((yyval.code));
4147 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, out);
4148 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, loopstart);
4152 (yyval.code) = var_block((yyval.code));
4166 /* Line 1464 of skeleton.m4 */
4167 #line 1818 "parser.y"
4177 /* Line 1464 of skeleton.m4 */
4178 #line 1818 "parser.y"
4181 (yyval.code) = code_new();
4183 code_t*myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4184 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4185 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
4186 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4187 myjmp->branch = cont;
4188 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
4189 (yyval.code) = abc_iftrue((yyval.code), loopstart);
4190 code_t*out = (yyval.code) = abc_nop((yyval.code));
4191 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].id), out);
4192 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].id), cont);
4194 (yyval.code) = var_block((yyval.code));
4205 /* Line 1464 of skeleton.m4 */
4206 #line 1837 "parser.y"
4216 /* Line 1464 of skeleton.m4 */
4217 #line 1837 "parser.y"
4219 (yyval.code) = code_new();
4220 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4221 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (7)].code));
4222 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4223 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].value).c);
4224 (yyval.code) = abc_iftrue((yyval.code), loopstart);
4225 code_t*out = (yyval.code) = abc_nop((yyval.code));
4226 breakjumpsto((yyval.code), (yyvsp[(1) - (7)].id), out);
4227 continuejumpsto((yyval.code), (yyvsp[(1) - (7)].id), cont);
4229 (yyval.code) = var_block((yyval.code));
4240 /* Line 1464 of skeleton.m4 */
4241 #line 1852 "parser.y"
4243 (yyval.code) = abc___break__(0, "");
4253 /* Line 1464 of skeleton.m4 */
4254 #line 1855 "parser.y"
4256 (yyval.code) = abc___break__(0, (yyvsp[(2) - (2)].id));
4266 /* Line 1464 of skeleton.m4 */
4267 #line 1858 "parser.y"
4269 (yyval.code) = abc___continue__(0, "");
4279 /* Line 1464 of skeleton.m4 */
4280 #line 1861 "parser.y"
4282 (yyval.code) = abc___continue__(0, (yyvsp[(2) - (2)].id));
4292 /* Line 1464 of skeleton.m4 */
4293 #line 1865 "parser.y"
4303 /* Line 1464 of skeleton.m4 */
4304 #line 1866 "parser.y"
4305 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4314 /* Line 1464 of skeleton.m4 */
4315 #line 1867 "parser.y"
4316 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4325 /* Line 1464 of skeleton.m4 */
4326 #line 1868 "parser.y"
4327 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
4336 /* Line 1464 of skeleton.m4 */
4337 #line 1869 "parser.y"
4338 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4347 /* Line 1464 of skeleton.m4 */
4348 #line 1870 "parser.y"
4349 {(yyval.code)=code_append((yyval.code),(yyvsp[(2) - (2)].code));}
4358 /* Line 1464 of skeleton.m4 */
4359 #line 1872 "parser.y"
4361 (yyval.code) = abc_dup(0);
4362 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (4)].value).c);
4363 code_t*j = (yyval.code) = abc_ifne((yyval.code), 0);
4364 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (4)].code));
4365 if((yyval.code)->opcode != OPCODE___BREAK__) {
4366 (yyval.code) = abc___fallthrough__((yyval.code), "");
4368 code_t*e = (yyval.code) = abc_nop((yyval.code));
4379 /* Line 1464 of skeleton.m4 */
4380 #line 1883 "parser.y"
4382 (yyval.code) = (yyvsp[(3) - (3)].code);
4392 /* Line 1464 of skeleton.m4 */
4393 #line 1886 "parser.y"
4403 /* Line 1464 of skeleton.m4 */
4404 #line 1886 "parser.y"
4406 (yyval.code)=(yyvsp[(4) - (8)].value).c;
4407 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (8)].code));
4408 code_t*out = (yyval.code) = abc_pop((yyval.code));
4409 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].id), out);
4411 code_t*c = (yyval.code),*lastblock=0;
4413 if(c->opcode == OPCODE_IFNE) {
4414 if(!c->next) syntaxerror("internal error in fallthrough handling");
4416 } else if(c->opcode == OPCODE___FALLTHROUGH__) {
4418 c->opcode = OPCODE_JUMP;
4419 c->branch = lastblock;
4421 /* fall through end of switch */
4422 c->opcode = OPCODE_NOP;
4428 (yyval.code) = var_block((yyval.code));
4439 /* Line 1464 of skeleton.m4 */
4440 #line 1915 "parser.y"
4441 {new_state();state->exception_name=(yyvsp[(3) - (5)].id);new_variable((yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].classinfo), 0);}
4450 /* Line 1464 of skeleton.m4 */
4451 #line 1916 "parser.y"
4453 namespace_t name_ns = {ACCESS_PACKAGE, ""};
4454 multiname_t name = {QNAME, &name_ns, 0, (yyvsp[(3) - (9)].id)};
4456 NEW(abc_exception_t, e)
4457 e->exc_type = sig2mname((yyvsp[(4) - (9)].classinfo));
4458 e->var_name = multiname_clone(&name);
4459 (yyval.exception) = e;
4462 int i = find_variable_safe((yyvsp[(3) - (9)].id))->index;
4463 e->target = c = abc_nop(0);
4464 c = abc_setlocal(c, i);
4465 c = code_append(c, (yyvsp[(8) - (9)].code));
4479 /* Line 1464 of skeleton.m4 */
4480 #line 1935 "parser.y"
4481 {new_state();state->exception_name=0;}
4490 /* Line 1464 of skeleton.m4 */
4491 #line 1935 "parser.y"
4493 (yyvsp[(4) - (5)].code) = var_block((yyvsp[(4) - (5)].code));
4494 if(!(yyvsp[(4) - (5)].code)) {
4495 (yyval.exception)=0;
4498 NEW(abc_exception_t, e)
4499 e->exc_type = 0; //all exceptions
4500 e->var_name = 0; //no name
4503 e->to = code_append(e->to, (yyvsp[(4) - (5)].code));
4505 (yyval.exception) = e;
4516 /* Line 1464 of skeleton.m4 */
4517 #line 1952 "parser.y"
4518 {(yyval.catch_list).l=list_new();(yyval.catch_list).finally=0;list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));}
4527 /* Line 1464 of skeleton.m4 */
4528 #line 1953 "parser.y"
4529 {(yyval.catch_list)=(yyvsp[(1) - (2)].catch_list);list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));}
4538 /* Line 1464 of skeleton.m4 */
4539 #line 1954 "parser.y"
4540 {(yyval.catch_list)=(yyvsp[(1) - (1)].catch_list);}
4549 /* Line 1464 of skeleton.m4 */
4550 #line 1955 "parser.y"
4552 (yyval.catch_list) = (yyvsp[(1) - (2)].catch_list);
4553 (yyval.catch_list).finally = 0;
4554 if((yyvsp[(2) - (2)].exception)) {
4555 list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));
4556 (yyval.catch_list).finally = (yyvsp[(2) - (2)].exception)->to;(yyvsp[(2) - (2)].exception)->to=0;
4567 /* Line 1464 of skeleton.m4 */
4568 #line 1963 "parser.y"
4570 (yyval.catch_list).l=list_new();
4571 (yyval.catch_list).finally = 0;
4572 if((yyvsp[(1) - (1)].exception)) {
4573 list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));
4574 (yyval.catch_list).finally = (yyvsp[(1) - (1)].exception)->to;(yyvsp[(1) - (1)].exception)->to=0;
4585 /* Line 1464 of skeleton.m4 */
4586 #line 1972 "parser.y"
4596 /* Line 1464 of skeleton.m4 */
4597 #line 1972 "parser.y"
4599 code_t*out = abc_nop(0);
4601 code_t*start = abc_nop(0);
4602 (yyval.code) = code_append(start, (yyvsp[(4) - (6)].code));
4603 if(!is_break_or_jump((yyvsp[(4) - (6)].code))) {
4604 (yyval.code) = abc_jump((yyval.code), out);
4606 code_t*end = (yyval.code) = abc_nop((yyval.code));
4609 if((yyvsp[(6) - (6)].catch_list).finally)
4610 tmp = new_variable("__finally__", 0, 0);
4612 abc_exception_list_t*l = (yyvsp[(6) - (6)].catch_list).l;
4615 abc_exception_t*e = l->abc_exception;
4617 (yyval.code) = code_append((yyval.code), e->target);
4618 (yyval.code) = abc_jump((yyval.code), out);
4620 parserassert((ptroff_t)(yyvsp[(6) - (6)].catch_list).finally);
4622 e->target = (yyval.code) = abc_nop((yyval.code));
4623 (yyval.code) = abc___rethrow__((yyval.code));
4631 (yyval.code) = code_append((yyval.code), out);
4633 (yyval.code) = insert_finally((yyval.code), (yyvsp[(6) - (6)].catch_list).finally, tmp);
4635 list_concat(state->method->exceptions, (yyvsp[(6) - (6)].catch_list).l);
4637 (yyval.code) = var_block((yyval.code));
4648 /* Line 1464 of skeleton.m4 */
4649 #line 2017 "parser.y"
4651 (yyval.code)=(yyvsp[(2) - (2)].value).c;
4652 (yyval.code)=abc_throw((yyval.code));
4662 /* Line 1464 of skeleton.m4 */
4663 #line 2021 "parser.y"
4665 if(!state->exception_name)
4666 syntaxerror("re-throw only possible within a catch block");
4667 variable_t*v = find_variable(state->exception_name);
4668 (yyval.code)=code_new();
4669 (yyval.code)=abc_getlocal((yyval.code), v->index);
4670 (yyval.code)=abc_throw((yyval.code));
4680 /* Line 1464 of skeleton.m4 */
4681 #line 2032 "parser.y"
4683 (yyval.code) = (yyvsp[(3) - (5)].value).c;
4684 (yyval.code) = abc_pushscope((yyval.code));
4685 (yyval.code) = code_append((yyval.code), (yyvsp[(5) - (5)].code));
4686 (yyval.code) = abc_popscope((yyval.code));
4696 /* Line 1464 of skeleton.m4 */
4697 #line 2042 "parser.y"
4698 {PASS12 (yyval.id)="package";}
4707 /* Line 1464 of skeleton.m4 */
4708 #line 2044 "parser.y"
4709 {PASS12 (yyval.id) = concat3((yyvsp[(1) - (3)].id),".",(yyvsp[(3) - (3)].id));free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;}
4718 /* Line 1464 of skeleton.m4 */
4719 #line 2045 "parser.y"
4720 {PASS12 (yyval.id)=strdup((yyvsp[(1) - (1)].id));}
4729 /* Line 1464 of skeleton.m4 */
4730 #line 2047 "parser.y"
4731 {PASS12 startpackage((yyvsp[(2) - (3)].id));free((yyvsp[(2) - (3)].id));(yyvsp[(2) - (3)].id)=0;}
4740 /* Line 1464 of skeleton.m4 */
4741 #line 2048 "parser.y"
4742 {PASS12 endpackage();(yyval.code)=0;}
4751 /* Line 1464 of skeleton.m4 */
4752 #line 2049 "parser.y"
4753 {PASS12 startpackage("");}
4762 /* Line 1464 of skeleton.m4 */
4763 #line 2050 "parser.y"
4764 {PASS12 endpackage();(yyval.code)=0;}
4773 /* Line 1464 of skeleton.m4 */
4774 #line 2052 "parser.y"
4776 classinfo_t*c = (yyvsp[(2) - (2)].classinfo);
4778 syntaxerror("Couldn't import class\n");
4779 state_has_imports();
4780 dict_put(state->imports, c->name, c);
4791 /* Line 1464 of skeleton.m4 */
4792 #line 2060 "parser.y"
4795 i->package = (yyvsp[(2) - (4)].id);
4796 state_has_imports();
4797 list_append(state->wildcard_imports, i);
4808 /* Line 1464 of skeleton.m4 */
4809 #line 2070 "parser.y"
4810 {PASS12 (yyval.flags)=0;}
4819 /* Line 1464 of skeleton.m4 */
4820 #line 2071 "parser.y"
4821 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
4830 /* Line 1464 of skeleton.m4 */
4831 #line 2072 "parser.y"
4832 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].token);}
4841 /* Line 1464 of skeleton.m4 */
4842 #line 2073 "parser.y"
4843 {PASS12 (yyval.flags)=(yyvsp[(1) - (2)].flags)|(yyvsp[(2) - (2)].token);}
4852 /* Line 1464 of skeleton.m4 */
4853 #line 2075 "parser.y"
4854 {PASS12 (yyval.token)=FLAG_PUBLIC;}
4863 /* Line 1464 of skeleton.m4 */
4864 #line 2076 "parser.y"
4865 {PASS12 (yyval.token)=FLAG_PRIVATE;}
4874 /* Line 1464 of skeleton.m4 */
4875 #line 2077 "parser.y"
4876 {PASS12 (yyval.token)=FLAG_PROTECTED;}
4885 /* Line 1464 of skeleton.m4 */
4886 #line 2078 "parser.y"
4887 {PASS12 (yyval.token)=FLAG_STATIC;}
4896 /* Line 1464 of skeleton.m4 */
4897 #line 2079 "parser.y"
4898 {PASS12 (yyval.token)=FLAG_DYNAMIC;}
4907 /* Line 1464 of skeleton.m4 */
4908 #line 2080 "parser.y"
4909 {PASS12 (yyval.token)=FLAG_FINAL;}
4918 /* Line 1464 of skeleton.m4 */
4919 #line 2081 "parser.y"
4920 {PASS12 (yyval.token)=FLAG_OVERRIDE;}
4929 /* Line 1464 of skeleton.m4 */
4930 #line 2082 "parser.y"
4931 {PASS12 (yyval.token)=FLAG_NATIVE;}
4940 /* Line 1464 of skeleton.m4 */
4941 #line 2083 "parser.y"
4942 {PASS12 (yyval.token)=FLAG_PACKAGEINTERNAL;}
4951 /* Line 1464 of skeleton.m4 */
4952 #line 2085 "parser.y"
4953 {(yyval.classinfo)=registry_getobjectclass();}
4962 /* Line 1464 of skeleton.m4 */
4963 #line 2086 "parser.y"
4964 {(yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
4973 /* Line 1464 of skeleton.m4 */
4974 #line 2088 "parser.y"
4975 {PASS12 (yyval.classinfo_list)=list_new();}
4984 /* Line 1464 of skeleton.m4 */
4985 #line 2089 "parser.y"
4986 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
4995 /* Line 1464 of skeleton.m4 */
4996 #line 2091 "parser.y"
4997 {PASS12 (yyval.classinfo_list)=list_new();}
5006 /* Line 1464 of skeleton.m4 */
5007 #line 2092 "parser.y"
5008 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5017 /* Line 1464 of skeleton.m4 */
5018 #line 2096 "parser.y"
5019 {PASS12 startclass((yyvsp[(1) - (6)].flags),(yyvsp[(3) - (6)].id),(yyvsp[(4) - (6)].classinfo),(yyvsp[(5) - (6)].classinfo_list), 0);}
5028 /* Line 1464 of skeleton.m4 */
5029 #line 2098 "parser.y"
5030 {PASS12 endclass();(yyval.code)=0;}
5039 /* Line 1464 of skeleton.m4 */
5040 #line 2102 "parser.y"
5041 {PASS12 startclass((yyvsp[(1) - (5)].flags),(yyvsp[(3) - (5)].id),0,(yyvsp[(4) - (5)].classinfo_list),1);}
5050 /* Line 1464 of skeleton.m4 */
5051 #line 2104 "parser.y"
5052 {PASS12 endclass();(yyval.code)=0;}
5061 /* Line 1464 of skeleton.m4 */
5062 #line 2116 "parser.y"
5064 code_t*c = state->cls->static_init;
5065 c = code_append(c, (yyvsp[(1) - (1)].code));
5066 state->cls->static_init = c;
5076 /* Line 1464 of skeleton.m4 */
5077 #line 2127 "parser.y"
5079 syntaxerror("variable declarations not allowed in interfaces");
5089 /* Line 1464 of skeleton.m4 */
5090 #line 2130 "parser.y"
5093 (yyvsp[(1) - (8)].flags) |= FLAG_PUBLIC;
5094 if((yyvsp[(1) - (8)].flags)&(FLAG_PRIVATE|FLAG_PACKAGEINTERNAL|FLAG_PROTECTED)) {
5095 syntaxerror("invalid method modifiers: interface methods always need to be public");
5097 startfunction(0,(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo));
5098 endfunction(0,(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo), 0);
5108 /* Line 1464 of skeleton.m4 */
5109 #line 2144 "parser.y"
5111 int flags = (yyvsp[(1) - (5)].flags);
5112 memberinfo_t* info = state->cls?
5113 memberinfo_register(state->cls->info, (yyvsp[(3) - (5)].id), MEMBER_SLOT):
5114 memberinfo_register_global(flags2access((yyvsp[(1) - (5)].flags)), state->package, (yyvsp[(3) - (5)].id), MEMBER_SLOT);
5116 info->type = (yyvsp[(4) - (5)].classinfo);
5117 info->flags = flags;
5120 namespace_t mname_ns = {flags2access(flags), ""};
5121 multiname_t mname = {QNAME, &mname_ns, 0, (yyvsp[(3) - (5)].id)};
5123 trait_list_t**traits;
5127 mname_ns.name = state->package;
5128 traits = &global->init->traits;
5129 code = &global->init->method->body->code;
5130 } else if(flags&FLAG_STATIC) {
5132 traits = &state->cls->abc->static_traits;
5133 code = &state->cls->static_init;
5135 // instance variable
5136 traits = &state->cls->abc->traits;
5137 code = &state->cls->init;
5141 if((yyvsp[(4) - (5)].classinfo)) {
5142 MULTINAME(m, (yyvsp[(4) - (5)].classinfo));
5143 t = trait_new_member(traits, multiname_clone(&m), multiname_clone(&mname), 0);
5145 t = trait_new_member(traits, 0, multiname_clone(&mname), 0);
5147 info->slot = t->slot_id;
5149 /* initalization code (if needed) */
5151 if((yyvsp[(5) - (5)].value).c && !is_pushundefined((yyvsp[(5) - (5)].value).c)) {
5152 c = abc_getlocal_0(c);
5153 c = code_append(c, (yyvsp[(5) - (5)].value).c);
5154 c = converttype(c, (yyvsp[(5) - (5)].value).t, (yyvsp[(4) - (5)].classinfo));
5155 c = abc_setslot(c, t->slot_id);
5158 *code = code_append(*code, c);
5160 if((yyvsp[(2) - (5)].token)==KW_CONST) {
5161 t->kind= TRAIT_CONST;
5174 /* Line 1464 of skeleton.m4 */
5175 #line 2203 "parser.y"
5176 {(yyval.constant)=0;}
5185 /* Line 1464 of skeleton.m4 */
5186 #line 2204 "parser.y"
5187 {(yyval.constant)=(yyvsp[(2) - (2)].constant);}
5196 /* Line 1464 of skeleton.m4 */
5197 #line 2206 "parser.y"
5198 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_uint));}
5207 /* Line 1464 of skeleton.m4 */
5208 #line 2207 "parser.y"
5209 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_int));}
5218 /* Line 1464 of skeleton.m4 */
5219 #line 2208 "parser.y"
5220 {(yyval.constant) = constant_new_uint((yyvsp[(1) - (1)].number_uint));}
5229 /* Line 1464 of skeleton.m4 */
5230 #line 2209 "parser.y"
5231 {(yyval.constant) = constant_new_float((yyvsp[(1) - (1)].number_float));}
5240 /* Line 1464 of skeleton.m4 */
5241 #line 2210 "parser.y"
5242 {(yyval.constant) = constant_new_string2((yyvsp[(1) - (1)].str).str,(yyvsp[(1) - (1)].str).len);}
5251 /* Line 1464 of skeleton.m4 */
5252 #line 2212 "parser.y"
5253 {(yyval.constant) = constant_new_true((yyvsp[(1) - (1)].token));}
5262 /* Line 1464 of skeleton.m4 */
5263 #line 2213 "parser.y"
5264 {(yyval.constant) = constant_new_false((yyvsp[(1) - (1)].token));}
5273 /* Line 1464 of skeleton.m4 */
5274 #line 2214 "parser.y"
5275 {(yyval.constant) = constant_new_null((yyvsp[(1) - (1)].token));}
5284 /* Line 1464 of skeleton.m4 */
5285 #line 2219 "parser.y"
5288 memset(&(yyval.params),0,sizeof((yyval.params)));
5298 /* Line 1464 of skeleton.m4 */
5299 #line 2223 "parser.y"
5302 (yyval.params)=(yyvsp[(1) - (1)].params);
5312 /* Line 1464 of skeleton.m4 */
5313 #line 2229 "parser.y"
5316 memset(&(yyval.params),0,sizeof((yyval.params)));
5317 (yyval.params).varargs=1;
5318 list_append((yyval.params).list, (yyvsp[(2) - (2)].param));
5328 /* Line 1464 of skeleton.m4 */
5329 #line 2235 "parser.y"
5332 (yyval.params) =(yyvsp[(1) - (4)].params);
5333 (yyval.params).varargs=1;
5334 list_append((yyval.params).list, (yyvsp[(4) - (4)].param));
5344 /* Line 1464 of skeleton.m4 */
5345 #line 2243 "parser.y"
5348 (yyval.params) = (yyvsp[(1) - (3)].params);
5349 list_append((yyval.params).list, (yyvsp[(3) - (3)].param));
5359 /* Line 1464 of skeleton.m4 */
5360 #line 2248 "parser.y"
5363 memset(&(yyval.params),0,sizeof((yyval.params)));
5364 list_append((yyval.params).list, (yyvsp[(1) - (1)].param));
5374 /* Line 1464 of skeleton.m4 */
5375 #line 2254 "parser.y"
5377 PASS1 (yyval.param)=0;
5379 (yyval.param) = malloc(sizeof(param_t));
5380 (yyval.param)->name=(yyvsp[(1) - (4)].id);
5381 (yyval.param)->type = (yyvsp[(3) - (4)].classinfo);
5382 (yyval.param)->value = (yyvsp[(4) - (4)].constant);
5392 /* Line 1464 of skeleton.m4 */
5393 #line 2262 "parser.y"
5395 PASS1 (yyval.param)=0;
5397 (yyval.param) = malloc(sizeof(param_t));
5398 (yyval.param)->name=(yyvsp[(1) - (2)].id);
5399 (yyval.param)->type = TYPE_ANY;
5400 (yyval.param)->value = (yyvsp[(2) - (2)].constant);
5410 /* Line 1464 of skeleton.m4 */
5411 #line 2270 "parser.y"
5412 {(yyval.token)=(yyvsp[(1) - (1)].token);}
5421 /* Line 1464 of skeleton.m4 */
5422 #line 2271 "parser.y"
5423 {(yyval.token)=(yyvsp[(1) - (1)].token);}
5432 /* Line 1464 of skeleton.m4 */
5433 #line 2272 "parser.y"
5443 /* Line 1464 of skeleton.m4 */
5444 #line 2275 "parser.y"
5445 {PASS12 startfunction(0,(yyvsp[(1) - (9)].flags),(yyvsp[(3) - (9)].token),(yyvsp[(4) - (9)].id),&(yyvsp[(6) - (9)].params),(yyvsp[(8) - (9)].classinfo));}
5454 /* Line 1464 of skeleton.m4 */
5455 #line 2276 "parser.y"
5459 if(!state->method->info) syntaxerror("internal error");
5461 if(state->method->late_binding) {
5462 c = abc_getlocal_0(c);
5463 c = abc_pushscope(c);
5465 /*if(state->method->innerfunctions) {
5466 c = abc_newactivation(c);
5467 c = abc_pushscope(c);
5469 if(state->method->is_constructor && !state->method->has_super) {
5470 // call default constructor
5471 c = abc_getlocal_0(c);
5472 c = abc_constructsuper(c, 0);
5474 methodstate_list_t*l = state->method->innerfunctions;
5476 parserassert(l->methodstate->abc);
5477 c = abc_newfunction(c, l->methodstate->abc);
5478 c = abc_setlocal(c, l->methodstate->var_index);
5479 free(l->methodstate);l->methodstate=0;
5482 list_free(state->method->innerfunctions);
5483 state->method->innerfunctions = 0;
5485 c = wrap_function(c, 0, (yyvsp[(11) - (12)].code));
5487 endfunction(0,(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),(yyvsp[(8) - (12)].classinfo),c);
5498 /* Line 1464 of skeleton.m4 */
5499 #line 2312 "parser.y"
5500 {PASS12 (yyval.id)=0;}
5509 /* Line 1464 of skeleton.m4 */
5510 #line 2314 "parser.y"
5511 {PASS12 innerfunction((yyvsp[(2) - (7)].id),&(yyvsp[(4) - (7)].params),(yyvsp[(6) - (7)].classinfo));}
5520 /* Line 1464 of skeleton.m4 */
5521 #line 2315 "parser.y"
5525 memberinfo_t*f = state->method->info;
5526 if(!f) syntaxerror("internal error");
5529 c = wrap_function(c, 0, (yyvsp[(9) - (10)].code));
5531 int index = state->method->var_index;
5532 endfunction(0,0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),(yyvsp[(6) - (10)].classinfo),c);
5534 (yyval.value).c = abc_getlocal(0, index);
5535 (yyval.value).t = TYPE_FUNCTION(f);
5545 /* Line 1464 of skeleton.m4 */
5546 #line 2334 "parser.y"
5548 PASS1 (yyval.classinfo)=0;
5550 /* try current package */
5551 (yyval.classinfo) = find_class((yyvsp[(1) - (1)].id));
5552 if(!(yyval.classinfo)) syntaxerror("Could not find class %s\n", (yyvsp[(1) - (1)].id));
5562 /* Line 1464 of skeleton.m4 */
5563 #line 2342 "parser.y"
5565 PASS1 (yyval.classinfo)=0;
5567 (yyval.classinfo) = registry_findclass((yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
5568 if(!(yyval.classinfo)) syntaxerror("Couldn't find class %s.%s\n", (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
5569 free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;
5579 /* Line 1464 of skeleton.m4 */
5580 #line 2353 "parser.y"
5581 {PASS12 (yyval.classinfo_list)=list_new();list_append((yyval.classinfo_list), (yyvsp[(1) - (1)].classinfo));}
5590 /* Line 1464 of skeleton.m4 */
5591 #line 2354 "parser.y"
5592 {PASS12 (yyval.classinfo_list)=(yyvsp[(1) - (3)].classinfo_list);list_append((yyval.classinfo_list),(yyvsp[(3) - (3)].classinfo));}
5601 /* Line 1464 of skeleton.m4 */
5602 #line 2356 "parser.y"
5603 {(yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);}
5612 /* Line 1464 of skeleton.m4 */
5613 #line 2357 "parser.y"
5614 {(yyval.classinfo)=registry_getanytype();}
5623 /* Line 1464 of skeleton.m4 */
5624 #line 2358 "parser.y"
5625 {(yyval.classinfo)=registry_getanytype();}
5634 /* Line 1464 of skeleton.m4 */
5635 #line 2367 "parser.y"
5636 {(yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
5645 /* Line 1464 of skeleton.m4 */
5646 #line 2368 "parser.y"
5647 {(yyval.classinfo)=0;}
5656 /* Line 1464 of skeleton.m4 */
5657 #line 2372 "parser.y"
5658 {(yyval.value_list).cc=0;(yyval.value_list).len=0;}
5667 /* Line 1464 of skeleton.m4 */
5668 #line 2373 "parser.y"
5669 {(yyval.value_list)=(yyvsp[(2) - (3)].value_list);}
5678 /* Line 1464 of skeleton.m4 */
5679 #line 2375 "parser.y"
5680 {(yyval.value_list).cc=0;(yyval.value_list).len=0;}
5689 /* Line 1464 of skeleton.m4 */
5690 #line 2377 "parser.y"
5691 {(yyval.value_list).len=1;
5692 (yyval.value_list).cc = (yyvsp[(1) - (1)].value).c;
5702 /* Line 1464 of skeleton.m4 */
5703 #line 2380 "parser.y"
5705 (yyval.value_list).len= (yyvsp[(1) - (3)].value_list).len+1;
5706 (yyval.value_list).cc = code_append((yyvsp[(1) - (3)].value_list).cc, (yyvsp[(3) - (3)].value).c);
5716 /* Line 1464 of skeleton.m4 */
5717 #line 2395 "parser.y"
5719 MULTINAME(m, (yyvsp[(2) - (3)].classinfo));
5720 (yyval.value).c = code_new();
5722 if((yyvsp[(2) - (3)].classinfo)->slot) {
5723 (yyval.value).c = abc_getglobalscope((yyval.value).c);
5724 (yyval.value).c = abc_getslot((yyval.value).c, (yyvsp[(2) - (3)].classinfo)->slot);
5726 (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
5729 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (3)].value_list).cc);
5731 if((yyvsp[(2) - (3)].classinfo)->slot)
5732 (yyval.value).c = abc_construct((yyval.value).c, (yyvsp[(3) - (3)].value_list).len);
5734 (yyval.value).c = abc_constructprop2((yyval.value).c, &m, (yyvsp[(3) - (3)].value_list).len);
5735 (yyval.value).t = (yyvsp[(2) - (3)].classinfo);
5745 /* Line 1464 of skeleton.m4 */
5746 #line 2419 "parser.y"
5749 (yyval.value).c = (yyvsp[(1) - (4)].value).c;
5750 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
5751 (yyval.value).c = code_cutlast((yyval.value).c);
5753 code_t*paramcode = (yyvsp[(3) - (4)].value_list).cc;
5755 (yyval.value).t = TYPE_ANY;
5756 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
5757 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
5758 (yyval.value).c = code_cutlast((yyval.value).c);
5759 (yyval.value).c = code_append((yyval.value).c, paramcode);
5760 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).len);
5761 multiname_destroy(name);
5762 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
5763 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
5764 trait_t*t = abc_class_find_slotid(state->cls->abc,slot);//FIXME
5765 if(t->kind!=TRAIT_METHOD) {
5766 //ok: flash allows to assign closures to members.
5768 multiname_t*name = t->name;
5769 (yyval.value).c = code_cutlast((yyval.value).c);
5770 (yyval.value).c = code_append((yyval.value).c, paramcode);
5771 //$$.c = abc_callmethod($$.c, t->method, len); //#1051 illegal early access binding
5772 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).len);
5773 } else if((yyval.value).c->opcode == OPCODE_GETSUPER) {
5774 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
5775 (yyval.value).c = code_cutlast((yyval.value).c);
5776 (yyval.value).c = code_append((yyval.value).c, paramcode);
5777 (yyval.value).c = abc_callsuper2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).len);
5778 multiname_destroy(name);
5780 (yyval.value).c = abc_getglobalscope((yyval.value).c);
5781 (yyval.value).c = code_append((yyval.value).c, paramcode);
5782 (yyval.value).c = abc_call((yyval.value).c, (yyvsp[(3) - (4)].value_list).len);
5787 if(TYPE_IS_FUNCTION((yyvsp[(1) - (4)].value).t) && (yyvsp[(1) - (4)].value).t->function) {
5788 (yyval.value).t = (yyvsp[(1) - (4)].value).t->function->return_type;
5790 (yyval.value).c = abc_coerce_a((yyval.value).c);
5791 (yyval.value).t = TYPE_ANY;
5802 /* Line 1464 of skeleton.m4 */
5803 #line 2467 "parser.y"
5805 if(!state->cls) syntaxerror("super() not allowed outside of a class");
5806 if(!state->method) syntaxerror("super() not allowed outside of a function");
5807 if(!state->method->is_constructor) syntaxerror("super() not allowed outside of a constructor");
5809 (yyval.value).c = code_new();
5810 (yyval.value).c = abc_getlocal_0((yyval.value).c);
5812 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value_list).cc);
5814 this is dependent on the control path, check this somewhere else
5815 if(state->method->has_super)
5816 syntaxerror("constructor may call super() only once");
5818 state->method->has_super = 1;
5820 (yyval.value).c = abc_constructsuper((yyval.value).c, (yyvsp[(3) - (4)].value_list).len);
5821 (yyval.value).c = abc_pushundefined((yyval.value).c);
5822 (yyval.value).t = TYPE_ANY;
5832 /* Line 1464 of skeleton.m4 */
5833 #line 2488 "parser.y"
5835 (yyval.value).c = (yyvsp[(2) - (2)].value).c;
5836 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
5837 (yyval.value).c = code_cutlast((yyval.value).c);
5839 multiname_t*name = 0;
5840 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
5841 (yyval.value).c->opcode = OPCODE_DELETEPROPERTY;
5842 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
5843 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
5844 multiname_t*name = abc_class_find_slotid(state->cls->abc,slot)->name;
5845 (yyval.value).c = code_cutlast((yyval.value).c);
5846 (yyval.value).c = abc_deleteproperty2((yyval.value).c, name);
5848 (yyval.value).c = abc_getlocal_0((yyval.value).c);
5849 MULTINAME_LATE(m, (yyvsp[(2) - (2)].value).t?(yyvsp[(2) - (2)].value).t->access:ACCESS_PACKAGE, "");
5850 (yyval.value).c = abc_deleteproperty2((yyval.value).c, &m);
5852 (yyval.value).t = TYPE_BOOLEAN;
5862 /* Line 1464 of skeleton.m4 */
5863 #line 2509 "parser.y"
5865 (yyval.code) = abc_returnvoid(0);
5875 /* Line 1464 of skeleton.m4 */
5876 #line 2512 "parser.y"
5878 (yyval.code) = (yyvsp[(2) - (2)].value).c;
5879 (yyval.code) = abc_returnvalue((yyval.code));
5889 /* Line 1464 of skeleton.m4 */
5890 #line 2519 "parser.y"
5891 {(yyval.value)=(yyvsp[(1) - (1)].value);}
5900 /* Line 1464 of skeleton.m4 */
5901 #line 2520 "parser.y"
5902 {(yyval.value) = (yyvsp[(1) - (1)].value);}
5911 /* Line 1464 of skeleton.m4 */
5912 #line 2521 "parser.y"
5914 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
5915 (yyval.value).c = cut_last_push((yyval.value).c);
5916 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
5917 (yyval.value).t = (yyvsp[(3) - (3)].value).t;
5927 /* Line 1464 of skeleton.m4 */
5928 #line 2527 "parser.y"
5930 (yyval.code)=cut_last_push((yyvsp[(1) - (1)].value).c);
5940 /* Line 1464 of skeleton.m4 */
5941 #line 2533 "parser.y"
5942 {(yyval.value) = (yyvsp[(1) - (1)].value);}
5951 /* Line 1464 of skeleton.m4 */
5952 #line 2537 "parser.y"
5953 {(yyval.value) = (yyvsp[(1) - (1)].value);}
5962 /* Line 1464 of skeleton.m4 */
5963 #line 2539 "parser.y"
5964 {(yyval.value) = (yyvsp[(1) - (1)].value);}
5973 /* Line 1464 of skeleton.m4 */
5974 #line 2541 "parser.y"
5975 {(yyval.value) = (yyvsp[(1) - (1)].value);}
5984 /* Line 1464 of skeleton.m4 */
5985 #line 2545 "parser.y"
5987 (yyval.value).c = 0;
5988 namespace_t ns = {ACCESS_PACKAGE, ""};
5989 multiname_t m = {QNAME, &ns, 0, "RegExp"};
5990 if(!(yyvsp[(1) - (1)].regexp).options) {
5991 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
5992 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern);
5993 (yyval.value).c = abc_construct((yyval.value).c, 1);
5995 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
5996 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern);
5997 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).options);
5998 (yyval.value).c = abc_construct((yyval.value).c, 2);
6000 (yyval.value).t = TYPE_REGEXP;
6010 /* Line 1464 of skeleton.m4 */
6011 #line 2562 "parser.y"
6012 {(yyval.value).c = abc_pushbyte(0, (yyvsp[(1) - (1)].number_uint));
6013 //MULTINAME(m, registry_getintclass());
6014 //$$.c = abc_coerce2($$.c, &m); // FIXME
6015 (yyval.value).t = TYPE_INT;
6025 /* Line 1464 of skeleton.m4 */
6026 #line 2567 "parser.y"
6027 {(yyval.value).c = abc_pushshort(0, (yyvsp[(1) - (1)].number_uint));
6028 (yyval.value).t = TYPE_INT;
6038 /* Line 1464 of skeleton.m4 */
6039 #line 2570 "parser.y"
6040 {(yyval.value).c = abc_pushint(0, (yyvsp[(1) - (1)].number_int));
6041 (yyval.value).t = TYPE_INT;
6051 /* Line 1464 of skeleton.m4 */
6052 #line 2573 "parser.y"
6053 {(yyval.value).c = abc_pushuint(0, (yyvsp[(1) - (1)].number_uint));
6054 (yyval.value).t = TYPE_UINT;
6064 /* Line 1464 of skeleton.m4 */
6065 #line 2576 "parser.y"
6066 {(yyval.value).c = abc_pushdouble(0, (yyvsp[(1) - (1)].number_float));
6067 (yyval.value).t = TYPE_FLOAT;
6077 /* Line 1464 of skeleton.m4 */
6078 #line 2579 "parser.y"
6079 {(yyval.value).c = abc_pushstring2(0, &(yyvsp[(1) - (1)].str));
6080 (yyval.value).t = TYPE_STRING;
6090 /* Line 1464 of skeleton.m4 */
6091 #line 2582 "parser.y"
6092 {(yyval.value).c = abc_pushundefined(0);
6093 (yyval.value).t = TYPE_ANY;
6103 /* Line 1464 of skeleton.m4 */
6104 #line 2585 "parser.y"
6105 {(yyval.value).c = abc_pushtrue(0);
6106 (yyval.value).t = TYPE_BOOLEAN;
6116 /* Line 1464 of skeleton.m4 */
6117 #line 2588 "parser.y"
6118 {(yyval.value).c = abc_pushfalse(0);
6119 (yyval.value).t = TYPE_BOOLEAN;
6129 /* Line 1464 of skeleton.m4 */
6130 #line 2591 "parser.y"
6131 {(yyval.value).c = abc_pushnull(0);
6132 (yyval.value).t = TYPE_NULL;
6142 /* Line 1464 of skeleton.m4 */
6143 #line 2595 "parser.y"
6144 {(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);
6145 (yyval.value).t = TYPE_BOOLEAN;
6155 /* Line 1464 of skeleton.m4 */
6156 #line 2598 "parser.y"
6157 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterthan((yyval.value).c);
6158 (yyval.value).t = TYPE_BOOLEAN;
6168 /* Line 1464 of skeleton.m4 */
6169 #line 2601 "parser.y"
6170 {(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);
6171 (yyval.value).t = TYPE_BOOLEAN;
6181 /* Line 1464 of skeleton.m4 */
6182 #line 2604 "parser.y"
6183 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterequals((yyval.value).c);
6184 (yyval.value).t = TYPE_BOOLEAN;
6194 /* Line 1464 of skeleton.m4 */
6195 #line 2607 "parser.y"
6196 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_equals((yyval.value).c);
6197 (yyval.value).t = TYPE_BOOLEAN;
6207 /* Line 1464 of skeleton.m4 */
6208 #line 2610 "parser.y"
6209 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_strictequals((yyval.value).c);
6210 (yyval.value).t = TYPE_BOOLEAN;
6220 /* Line 1464 of skeleton.m4 */
6221 #line 2613 "parser.y"
6222 {(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);
6223 (yyval.value).t = TYPE_BOOLEAN;
6233 /* Line 1464 of skeleton.m4 */
6234 #line 2616 "parser.y"
6235 {(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);
6236 (yyval.value).t = TYPE_BOOLEAN;
6246 /* Line 1464 of skeleton.m4 */
6247 #line 2620 "parser.y"
6248 {(yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'O');
6249 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
6250 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t);
6251 (yyval.value).c = abc_dup((yyval.value).c);
6252 code_t*jmp = (yyval.value).c = abc_iftrue((yyval.value).c, 0);
6253 (yyval.value).c = cut_last_push((yyval.value).c);
6254 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
6255 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t);
6256 code_t*label = (yyval.value).c = abc_label((yyval.value).c);
6257 jmp->branch = label;
6267 /* Line 1464 of skeleton.m4 */
6268 #line 2631 "parser.y"
6270 (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'A');
6271 /*printf("%08x:\n",$1.t);
6272 code_dump($1.c, 0, 0, "", stdout);
6273 printf("%08x:\n",$3.t);
6274 code_dump($3.c, 0, 0, "", stdout);
6275 printf("joining %08x and %08x to %08x\n", $1.t, $3.t, $$.t);*/
6276 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
6277 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t);
6278 (yyval.value).c = abc_dup((yyval.value).c);
6279 code_t*jmp = (yyval.value).c = abc_iffalse((yyval.value).c, 0);
6280 (yyval.value).c = cut_last_push((yyval.value).c);
6281 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
6282 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t);
6283 code_t*label = (yyval.value).c = abc_label((yyval.value).c);
6284 jmp->branch = label;
6294 /* Line 1464 of skeleton.m4 */
6295 #line 2649 "parser.y"
6296 {(yyval.value).c=(yyvsp[(2) - (2)].value).c;
6297 (yyval.value).c = abc_not((yyval.value).c);
6298 (yyval.value).t = TYPE_BOOLEAN;
6308 /* Line 1464 of skeleton.m4 */
6309 #line 2654 "parser.y"
6310 {(yyval.value).c=(yyvsp[(2) - (2)].value).c;
6311 (yyval.value).c = abc_bitnot((yyval.value).c);
6312 (yyval.value).t = TYPE_INT;
6322 /* Line 1464 of skeleton.m4 */
6323 #line 2659 "parser.y"
6324 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6325 (yyval.value).c = abc_bitand((yyval.value).c);
6326 (yyval.value).t = TYPE_INT;
6336 /* Line 1464 of skeleton.m4 */
6337 #line 2664 "parser.y"
6338 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6339 (yyval.value).c = abc_bitxor((yyval.value).c);
6340 (yyval.value).t = TYPE_INT;
6350 /* Line 1464 of skeleton.m4 */
6351 #line 2669 "parser.y"
6352 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6353 (yyval.value).c = abc_bitor((yyval.value).c);
6354 (yyval.value).t = TYPE_INT;
6364 /* Line 1464 of skeleton.m4 */
6365 #line 2674 "parser.y"
6366 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6367 (yyval.value).c = abc_rshift((yyval.value).c);
6368 (yyval.value).t = TYPE_INT;
6378 /* Line 1464 of skeleton.m4 */
6379 #line 2678 "parser.y"
6380 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6381 (yyval.value).c = abc_urshift((yyval.value).c);
6382 (yyval.value).t = TYPE_INT;
6392 /* Line 1464 of skeleton.m4 */
6393 #line 2682 "parser.y"
6394 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6395 (yyval.value).c = abc_lshift((yyval.value).c);
6396 (yyval.value).t = TYPE_INT;
6406 /* Line 1464 of skeleton.m4 */
6407 #line 2687 "parser.y"
6408 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6409 (yyval.value).c = abc_divide((yyval.value).c);
6410 (yyval.value).t = TYPE_NUMBER;
6420 /* Line 1464 of skeleton.m4 */
6421 #line 2691 "parser.y"
6422 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6423 (yyval.value).c = abc_modulo((yyval.value).c);
6424 (yyval.value).t = TYPE_NUMBER;
6434 /* Line 1464 of skeleton.m4 */
6435 #line 2695 "parser.y"
6436 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6437 if(BOTH_INT((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t)) {
6438 (yyval.value).c = abc_add_i((yyval.value).c);
6439 (yyval.value).t = TYPE_INT;
6441 (yyval.value).c = abc_add((yyval.value).c);
6442 (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t,'+');
6453 /* Line 1464 of skeleton.m4 */
6454 #line 2704 "parser.y"
6455 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6456 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
6457 (yyval.value).c = abc_subtract_i((yyval.value).c);
6458 (yyval.value).t = TYPE_INT;
6460 (yyval.value).c = abc_subtract((yyval.value).c);
6461 (yyval.value).t = TYPE_NUMBER;
6472 /* Line 1464 of skeleton.m4 */
6473 #line 2713 "parser.y"
6474 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6475 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
6476 (yyval.value).c = abc_multiply_i((yyval.value).c);
6477 (yyval.value).t = TYPE_INT;
6479 (yyval.value).c = abc_multiply((yyval.value).c);
6480 (yyval.value).t = TYPE_NUMBER;
6491 /* Line 1464 of skeleton.m4 */
6492 #line 2723 "parser.y"
6493 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6494 (yyval.value).c = abc_in((yyval.value).c);
6495 (yyval.value).t = TYPE_BOOLEAN;
6505 /* Line 1464 of skeleton.m4 */
6506 #line 2728 "parser.y"
6507 {char use_astype=0; // flash player's astype works differently than astypelate
6508 if(use_astype && TYPE_IS_CLASS((yyvsp[(3) - (3)].value).t)) {
6509 MULTINAME(m,(yyvsp[(3) - (3)].value).t->cls);
6510 (yyval.value).c = abc_astype2((yyvsp[(1) - (3)].value).c, &m);
6511 (yyval.value).t = (yyvsp[(3) - (3)].value).t->cls;
6513 (yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
6514 (yyval.value).c = abc_astypelate((yyval.value).c);
6515 (yyval.value).t = TYPE_ANY;
6526 /* Line 1464 of skeleton.m4 */
6527 #line 2741 "parser.y"
6528 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
6529 (yyval.value).c = abc_instanceof((yyval.value).c);
6530 (yyval.value).t = TYPE_BOOLEAN;
6540 /* Line 1464 of skeleton.m4 */
6541 #line 2746 "parser.y"
6542 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
6543 (yyval.value).c = abc_istypelate((yyval.value).c);
6544 (yyval.value).t = TYPE_BOOLEAN;
6554 /* Line 1464 of skeleton.m4 */
6555 #line 2751 "parser.y"
6557 (yyval.value).c = (yyvsp[(3) - (4)].value).c;
6558 (yyval.value).c = abc_typeof((yyval.value).c);
6559 (yyval.value).t = TYPE_STRING;
6569 /* Line 1464 of skeleton.m4 */
6570 #line 2757 "parser.y"
6572 (yyval.value).c = cut_last_push((yyvsp[(2) - (2)].value).c);
6573 (yyval.value).c = abc_pushundefined((yyval.value).c);
6574 (yyval.value).t = TYPE_ANY;
6584 /* Line 1464 of skeleton.m4 */
6585 #line 2763 "parser.y"
6586 { (yyval.value).c = abc_pushundefined(0);
6587 (yyval.value).t = TYPE_ANY;
6597 /* Line 1464 of skeleton.m4 */
6598 #line 2767 "parser.y"
6599 {(yyval.value)=(yyvsp[(2) - (3)].value);}
6608 /* Line 1464 of skeleton.m4 */
6609 #line 2769 "parser.y"
6611 (yyval.value)=(yyvsp[(2) - (2)].value);
6612 if(IS_INT((yyvsp[(2) - (2)].value).t)) {
6613 (yyval.value).c=abc_negate_i((yyval.value).c);
6614 (yyval.value).t = TYPE_INT;
6616 (yyval.value).c=abc_negate((yyval.value).c);
6617 (yyval.value).t = TYPE_NUMBER;
6628 /* Line 1464 of skeleton.m4 */
6629 #line 2780 "parser.y"
6631 (yyval.value).c = (yyvsp[(1) - (4)].value).c;
6632 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value).c);
6634 MULTINAME_LATE(m, (yyvsp[(1) - (4)].value).t?(yyvsp[(1) - (4)].value).t->access:ACCESS_PACKAGE, "");
6635 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
6636 (yyval.value).t = 0; // array elements have unknown type
6646 /* Line 1464 of skeleton.m4 */
6647 #line 2789 "parser.y"
6649 (yyval.value).c = code_new();
6650 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc);
6651 (yyval.value).c = abc_newarray((yyval.value).c, (yyvsp[(2) - (3)].value_list).len);
6652 (yyval.value).t = registry_getarrayclass();
6662 /* Line 1464 of skeleton.m4 */
6663 #line 2796 "parser.y"
6664 {(yyval.value_list).cc=0;(yyval.value_list).len=0;}
6673 /* Line 1464 of skeleton.m4 */
6674 #line 2797 "parser.y"
6675 {(yyval.value_list)=(yyvsp[(1) - (1)].value_list);}
6684 /* Line 1464 of skeleton.m4 */
6685 #line 2799 "parser.y"
6687 (yyval.value_list).cc = 0;
6688 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(1) - (3)].value).c);
6689 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (3)].value).c);
6690 (yyval.value_list).len = 2;
6700 /* Line 1464 of skeleton.m4 */
6701 #line 2805 "parser.y"
6703 (yyval.value_list).cc = (yyvsp[(1) - (5)].value_list).cc;
6704 (yyval.value_list).len = (yyvsp[(1) - (5)].value_list).len+2;
6705 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (5)].value).c);
6706 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(5) - (5)].value).c);
6716 /* Line 1464 of skeleton.m4 */
6717 #line 2814 "parser.y"
6719 (yyval.value).c = code_new();
6720 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc);
6721 (yyval.value).c = abc_newobject((yyval.value).c, (yyvsp[(2) - (3)].value_list).len/2);
6722 (yyval.value).t = registry_getobjectclass();
6732 /* Line 1464 of skeleton.m4 */
6733 #line 2821 "parser.y"
6735 code_t*c = (yyvsp[(3) - (3)].value).c;
6736 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
6737 c=abc_multiply_i(c);
6741 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '*'), (yyvsp[(1) - (3)].value).t);
6742 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
6743 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
6753 /* Line 1464 of skeleton.m4 */
6754 #line 2833 "parser.y"
6756 code_t*c = abc_modulo((yyvsp[(3) - (3)].value).c);
6757 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '%'), (yyvsp[(1) - (3)].value).t);
6758 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
6759 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
6769 /* Line 1464 of skeleton.m4 */
6770 #line 2839 "parser.y"
6772 code_t*c = abc_lshift((yyvsp[(3) - (3)].value).c);
6773 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '<'), (yyvsp[(1) - (3)].value).t);
6774 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
6775 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
6785 /* Line 1464 of skeleton.m4 */
6786 #line 2845 "parser.y"
6788 code_t*c = abc_rshift((yyvsp[(3) - (3)].value).c);
6789 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '>'), (yyvsp[(1) - (3)].value).t);
6790 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
6791 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
6801 /* Line 1464 of skeleton.m4 */
6802 #line 2851 "parser.y"
6804 code_t*c = abc_urshift((yyvsp[(3) - (3)].value).c);
6805 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'U'), (yyvsp[(1) - (3)].value).t);
6806 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
6807 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
6817 /* Line 1464 of skeleton.m4 */
6818 #line 2857 "parser.y"
6820 code_t*c = abc_divide((yyvsp[(3) - (3)].value).c);
6821 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '/'), (yyvsp[(1) - (3)].value).t);
6822 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
6823 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
6833 /* Line 1464 of skeleton.m4 */
6834 #line 2863 "parser.y"
6836 code_t*c = abc_bitor((yyvsp[(3) - (3)].value).c);
6837 c=converttype(c, TYPE_INT, (yyvsp[(1) - (3)].value).t);
6838 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
6839 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
6849 /* Line 1464 of skeleton.m4 */
6850 #line 2869 "parser.y"
6852 code_t*c = (yyvsp[(3) - (3)].value).c;
6854 if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) {
6858 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '+'), (yyvsp[(1) - (3)].value).t);
6861 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
6862 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
6872 /* Line 1464 of skeleton.m4 */
6873 #line 2882 "parser.y"
6874 { code_t*c = (yyvsp[(3) - (3)].value).c;
6875 if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) {
6876 c=abc_subtract_i(c);
6879 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '-'), (yyvsp[(1) - (3)].value).t);
6882 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
6883 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
6893 /* Line 1464 of skeleton.m4 */
6894 #line 2893 "parser.y"
6896 c = code_append(c, (yyvsp[(3) - (3)].value).c);
6897 c = converttype(c, (yyvsp[(3) - (3)].value).t, (yyvsp[(1) - (3)].value).t);
6898 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 1, 0);
6899 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
6909 /* Line 1464 of skeleton.m4 */
6910 #line 2900 "parser.y"
6912 (yyval.value).t = join_types((yyvsp[(3) - (5)].value).t,(yyvsp[(5) - (5)].value).t,'?');
6913 (yyval.value).c = (yyvsp[(1) - (5)].value).c;
6914 code_t*j1 = (yyval.value).c = abc_iffalse((yyval.value).c, 0);
6915 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (5)].value).c);
6916 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (5)].value).t, (yyval.value).t);
6917 code_t*j2 = (yyval.value).c = abc_jump((yyval.value).c, 0);
6918 (yyval.value).c = j1->branch = abc_label((yyval.value).c);
6919 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(5) - (5)].value).c);
6920 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (5)].value).t, (yyval.value).t);
6921 (yyval.value).c = j2->branch = abc_label((yyval.value).c);
6931 /* Line 1464 of skeleton.m4 */
6932 #line 2913 "parser.y"
6934 classinfo_t*type = (yyvsp[(1) - (2)].value).t;
6935 if((is_getlocal((yyvsp[(1) - (2)].value).c) && TYPE_IS_INT((yyvsp[(1) - (2)].value).t)) || TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t)) {
6936 int nr = getlocalnr((yyvsp[(1) - (2)].value).c);
6937 code_free((yyvsp[(1) - (2)].value).c);(yyvsp[(1) - (2)].value).c=0;
6938 if(TYPE_IS_INT((yyvsp[(1) - (2)].value).t)) {
6939 (yyval.value).c = abc_getlocal(0, nr);
6940 (yyval.value).c = abc_inclocal_i((yyval.value).c, nr);
6941 } else if(TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t)) {
6942 (yyval.value).c = abc_getlocal(0, nr);
6943 (yyval.value).c = abc_inclocal((yyval.value).c, nr);
6944 } else syntaxerror("internal error");
6946 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
6947 c=abc_increment_i(c);
6953 c=converttype(c, type, (yyvsp[(1) - (2)].value).t);
6954 (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1);
6955 (yyval.value).t = (yyvsp[(1) - (2)].value).t;
6966 /* Line 1464 of skeleton.m4 */
6967 #line 2940 "parser.y"
6969 classinfo_t*type = (yyvsp[(1) - (2)].value).t;
6970 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
6971 c=abc_decrement_i(c);
6977 c=converttype(c, type, (yyvsp[(1) - (2)].value).t);
6978 (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1);
6979 (yyval.value).t = (yyvsp[(1) - (2)].value).t;
6989 /* Line 1464 of skeleton.m4 */
6990 #line 2954 "parser.y"
6992 classinfo_t*type = (yyvsp[(2) - (2)].value).t;
6993 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
6994 c=abc_increment_i(c);
7000 c=converttype(c, type, (yyvsp[(2) - (2)].value).t);
7001 (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0);
7002 (yyval.value).t = (yyvsp[(2) - (2)].value).t;
7012 /* Line 1464 of skeleton.m4 */
7013 #line 2968 "parser.y"
7015 classinfo_t*type = (yyvsp[(2) - (2)].value).t;
7016 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7017 c=abc_decrement_i(c);
7023 c=converttype(c, type, (yyvsp[(2) - (2)].value).t);
7024 (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0);
7025 (yyval.value).t = (yyvsp[(2) - (2)].value).t;
7035 /* Line 1464 of skeleton.m4 */
7036 #line 2983 "parser.y"
7037 { if(!state->cls->info)
7038 syntaxerror("super keyword not allowed outside a class");
7039 classinfo_t*t = state->cls->info->superclass;
7040 if(!t) t = TYPE_OBJECT;
7042 memberinfo_t*f = registry_findmember(t, (yyvsp[(3) - (3)].id), 1);
7043 namespace_t ns = flags2namespace(f->flags, "");
7044 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
7045 (yyval.value).c = 0;
7046 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7047 (yyval.value).c = abc_getsuper2((yyval.value).c, &m);
7048 (yyval.value).t = memberinfo_gettype(f);
7058 /* Line 1464 of skeleton.m4 */
7059 #line 2998 "parser.y"
7060 {(yyval.value).c = (yyvsp[(1) - (3)].value).c;
7061 classinfo_t*t = (yyvsp[(1) - (3)].value).t;
7063 if(TYPE_IS_CLASS(t) && t->cls) {
7068 memberinfo_t*f = registry_findmember(t, (yyvsp[(3) - (3)].id), 1);
7070 if(f && !is_static != !(f->flags&FLAG_STATIC))
7072 if(f && f->slot && !noslot) {
7073 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
7075 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
7076 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7078 /* determine type */
7079 (yyval.value).t = memberinfo_gettype(f);
7080 if(!(yyval.value).t)
7081 (yyval.value).c = abc_coerce_a((yyval.value).c);
7083 /* when resolving a property on an unknown type, we do know the
7084 name of the property (and don't seem to need the package), but
7085 we need to make avm2 try out all access modes */
7086 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
7087 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7088 (yyval.value).c = abc_coerce_a((yyval.value).c);
7089 (yyval.value).t = registry_getanytype();
7100 /* Line 1464 of skeleton.m4 */
7101 #line 3031 "parser.y"
7103 (yyval.value).t = 0;
7104 (yyval.value).c = 0;
7109 /* look at variables */
7110 if((v = find_variable((yyvsp[(1) - (1)].id)))) {
7111 // $1 is a local variable
7112 (yyval.value).c = abc_getlocal((yyval.value).c, v->index);
7113 (yyval.value).t = v->type;
7117 int i_am_static = (state->method && state->method->info)?(state->method->info->flags&FLAG_STATIC):FLAG_STATIC;
7119 /* look at current class' members */
7120 if(state->cls && (f = registry_findmember(state->cls->info, (yyvsp[(1) - (1)].id), 1)) &&
7121 (f->flags&FLAG_STATIC) >= i_am_static) {
7122 // $1 is a function in this class
7123 int var_is_static = (f->flags&FLAG_STATIC);
7125 if(f->kind == MEMBER_METHOD) {
7126 (yyval.value).t = TYPE_FUNCTION(f);
7128 (yyval.value).t = f->type;
7130 if(var_is_static && !i_am_static) {
7131 /* access to a static member from a non-static location.
7132 do this via findpropstrict:
7133 there doesn't seem to be any non-lookup way to access
7134 static properties of a class */
7135 state->method->late_binding = 1;
7136 (yyval.value).t = f->type;
7137 namespace_t ns = {flags2access(f->flags), ""};
7138 multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)};
7139 (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
7140 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7142 } else if(f->slot>0) {
7143 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7144 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
7147 namespace_t ns = {flags2access(f->flags), ""};
7148 multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)};
7149 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7150 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7155 /* look at actual classes, in the current package and imported */
7156 if((a = find_class((yyvsp[(1) - (1)].id)))) {
7157 if(a->flags & FLAG_METHOD) {
7159 (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
7160 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7161 if(a->function->kind == MEMBER_METHOD) {
7162 (yyval.value).t = TYPE_FUNCTION(a->function);
7164 (yyval.value).t = a->function->type;
7168 (yyval.value).c = abc_getglobalscope((yyval.value).c);
7169 (yyval.value).c = abc_getslot((yyval.value).c, a->slot);
7172 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
7174 (yyval.value).t = TYPE_CLASS(a);
7179 /* unknown object, let the avm2 resolve it */
7181 as3_softwarning("Couldn't resolve '%s', doing late binding", (yyvsp[(1) - (1)].id));
7182 state->method->late_binding = 1;
7184 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(1) - (1)].id)};
7186 (yyval.value).t = 0;
7187 (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
7188 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7199 /* Line 1464 of skeleton.m4 */
7200 #line 3128 "parser.y"
7210 /* Line 1464 of skeleton.m4 */
7211 #line 3129 "parser.y"
7221 /* Line 1464 of skeleton.m4 */
7222 #line 3130 "parser.y"
7232 /* Line 1464 of skeleton.m4 */
7233 #line 3132 "parser.y"
7241 /* Line 1464 of skeleton.m4 */
7242 #line 7243 "parser.tab.c"
7245 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
7249 YY_STACK_PRINT (yyss, yyssp);
7253 /* Now `shift' the result of the reduction. Determine what state
7254 that goes to, based on the state we popped back to and the rule
7255 number reduced by. */
7259 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
7260 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
7261 yystate = yytable[yystate];
7263 yystate = yydefgoto[yyn - YYNTOKENS];
7268 /*------------------------------------.
7269 | yyerrlab -- here on detecting error |
7270 `------------------------------------*/
7272 /* If not already recovering from an error, report this error. */
7276 #if ! YYERROR_VERBOSE
7277 yyerror (YY_("syntax error"));
7280 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
7281 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
7283 YYSIZE_T yyalloc = 2 * yysize;
7284 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
7285 yyalloc = YYSTACK_ALLOC_MAXIMUM;
7286 if (yymsg != yymsgbuf)
7287 YYSTACK_FREE (yymsg);
7288 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
7290 yymsg_alloc = yyalloc;
7294 yymsg_alloc = sizeof yymsgbuf;
7298 if (0 < yysize && yysize <= yymsg_alloc)
7300 (void) yysyntax_error (yymsg, yystate, yychar);
7305 yyerror (YY_("syntax error"));
7307 goto yyexhaustedlab;
7315 if (yyerrstatus == 3)
7317 /* If just tried and failed to reuse lookahead token after an
7318 error, discard it. */
7320 if (yychar <= YYEOF)
7322 /* Return failure if at end of input. */
7323 if (yychar == YYEOF)
7328 yydestruct ("Error: discarding",
7334 /* Else will try to reuse lookahead token after shifting the error
7339 /*---------------------------------------------------.
7340 | yyerrorlab -- error raised explicitly by YYERROR. |
7341 `---------------------------------------------------*/
7344 /* Pacify compilers like GCC when the user code never invokes
7345 YYERROR and the label yyerrorlab therefore never appears in user
7347 if (/*CONSTCOND*/ 0)
7350 /* Do not reclaim the symbols of the rule which action triggered
7354 YY_STACK_PRINT (yyss, yyssp);
7359 /*-------------------------------------------------------------.
7360 | yyerrlab1 -- common code for both syntax error and YYERROR. |
7361 `-------------------------------------------------------------*/
7363 yyerrstatus = 3; /* Each real token shifted decrements this. */
7367 yyn = yypact[yystate];
7368 if (yyn != YYPACT_NINF)
7371 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
7379 /* Pop the current state because it cannot handle the error token. */
7384 yydestruct ("Error: popping",
7385 yystos[yystate], yyvsp);
7388 YY_STACK_PRINT (yyss, yyssp);
7394 /* Shift the error token. */
7395 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
7401 /*-------------------------------------.
7402 | yyacceptlab -- YYACCEPT comes here. |
7403 `-------------------------------------*/
7408 /*-----------------------------------.
7409 | yyabortlab -- YYABORT comes here. |
7410 `-----------------------------------*/
7415 #if !defined(yyoverflow) || YYERROR_VERBOSE
7416 /*-------------------------------------------------.
7417 | yyexhaustedlab -- memory exhaustion comes here. |
7418 `-------------------------------------------------*/
7420 yyerror (YY_("memory exhausted"));
7426 if (yychar != YYEMPTY)
7427 yydestruct ("Cleanup: discarding lookahead",
7429 /* Do not reclaim the symbols of the rule which action triggered
7430 this YYABORT or YYACCEPT. */
7432 YY_STACK_PRINT (yyss, yyssp);
7433 while (yyssp != yyss)
7435 yydestruct ("Cleanup: popping",
7436 yystos[*yyssp], yyvsp);
7441 YYSTACK_FREE (yyss);
7444 if (yymsg != yymsgbuf)
7445 YYSTACK_FREE (yymsg);
7447 /* Make sure YYID is used. */
7448 return YYID (yyresult);