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,
223 above_identifier = 359,
231 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
233 /* Line 223 of skeleton.m4 */
238 /* Line 223 of skeleton.m4 */
241 enum yytokentype token;
244 classinfo_t*classinfo;
245 classinfo_list_t*classinfo_list;
248 unsigned int number_uint;
252 //typedcode_list_t*value_list;
253 codeandnumber_t value_list;
259 for_start_t for_start;
260 abc_exception_t *exception;
263 abc_exception_list_t *l;
269 /* Line 223 of skeleton.m4 */
270 #line 271 "parser.tab.c"
272 # define YYSTYPE_IS_TRIVIAL 1
273 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
274 # define YYSTYPE_IS_DECLARED 1
278 /* Copy the second part of user declarations. */
280 /* Line 273 of skeleton.m4 */
284 static int a3_error(char*s)
286 syntaxerror("%s", s);
287 return 0; //make gcc happy
291 static char* concat2(const char* t1, const char* t2)
295 char*text = malloc(l1+l2+1);
296 memcpy(text , t1, l1);
297 memcpy(text+l1, t2, l2);
301 static char* concat3(const char* t1, const char* t2, const char* t3)
306 char*text = malloc(l1+l2+l3+1);
307 memcpy(text , t1, l1);
308 memcpy(text+l1, t2, l2);
309 memcpy(text+l1+l2, t3, l3);
314 typedef struct _import {
318 DECLARE_LIST(import);
320 typedef struct _classstate {
326 char has_constructor;
329 DECLARE_LIST(methodstate);
331 typedef struct _methodstate {
342 int var_index; // for inner methods
344 abc_exception_list_t*exceptions;
346 methodstate_list_t*innerfunctions;
349 typedef struct _state {
354 import_list_t*wildcard_imports;
356 char has_own_imports;
357 char new_vars; // e.g. transition between two functions
360 methodstate_t*method;
367 typedef struct _global {
373 static global_t*global = 0;
374 static state_t* state = 0;
378 #define MULTINAME(m,x) \
381 registry_fill_multiname(&m, &m##_ns, x);
383 #define MEMBER_MULTINAME(m,f,n) \
387 m##_ns = flags2namespace(f->flags, ""); \
390 m.namespace_set = 0; \
393 m.type = MULTINAME; \
395 m.namespace_set = &nopackage_namespace_set; \
399 /* warning: list length of namespace set is undefined */
400 #define MULTINAME_LATE(m, access, package) \
401 namespace_t m##_ns = {access, package}; \
402 namespace_set_t m##_nsset; \
403 namespace_list_t m##_l;m##_l.next = 0; \
404 m##_nsset.namespaces = &m##_l; \
405 m##_nsset = m##_nsset; \
406 m##_l.namespace = &m##_ns; \
407 multiname_t m = {MULTINAMEL, 0, &m##_nsset, 0};
409 static namespace_t ns1 = {ACCESS_PRIVATE, ""};
410 static namespace_t ns2 = {ACCESS_PROTECTED, ""};
411 static namespace_t ns3 = {ACCESS_PACKAGEINTERNAL, ""};
412 static namespace_t ns4 = {ACCESS_PACKAGE, ""};
413 static namespace_list_t nl4 = {&ns4,0};
414 static namespace_list_t nl3 = {&ns3,&nl4};
415 static namespace_list_t nl2 = {&ns2,&nl3};
416 static namespace_list_t nl1 = {&ns1,&nl2};
417 static namespace_set_t nopackage_namespace_set = {&nl1};
419 static void new_state()
422 state_t*oldstate = state;
424 memcpy(s, state, sizeof(state_t)); //shallow copy
426 s->imports = dict_new();
430 state->has_own_imports = 0;
431 state->vars = dict_new();
432 state->old = oldstate;
434 static void state_has_imports()
436 state->wildcard_imports = list_clone(state->wildcard_imports);
437 state->imports = dict_clone(state->imports);
438 state->has_own_imports = 1;
441 static void state_destroy(state_t*state)
443 if(state->has_own_imports) {
444 list_free(state->wildcard_imports);
445 dict_destroy(state->imports);state->imports=0;
447 if(state->imports && (!state->old || state->old->imports!=state->imports)) {
448 dict_destroy(state->imports);state->imports=0;
452 for(t=0;t<state->vars->hashsize;t++) {
453 dictentry_t*e =state->vars->slots[t];
455 free(e->data);e->data=0;
459 dict_destroy(state->vars);state->vars=0;
465 static void old_state()
467 if(!state || !state->old)
468 syntaxerror("invalid nesting");
469 state_t*leaving = state;
473 if(as3_pass>1 && leaving->method && leaving->method != state->method && !leaving->method->inner) {
474 free(leaving->method);
477 if(leaving->cls && leaving->cls != state->cls) {
482 state_destroy(leaving);
485 void initialize_file(char*filename)
488 state->package = filename;
490 state->method = rfx_calloc(sizeof(methodstate_t));
491 state->method->variable_count = 1;
496 if(!state || state->level!=1) {
497 syntaxerror("unexpected end of file in pass %d", as3_pass);
499 state_destroy(state);state=0;
502 void initialize_parser()
504 global = rfx_calloc(sizeof(global_t));
505 global->file = abc_file_new();
506 global->file->flags &= ~ABCFILE_LAZY;
507 global->token2info = dict_new2(&ptr_type);
509 global->init = abc_initscript(global->file);
510 code_t*c = global->init->method->body->code;
511 c = abc_getlocal_0(c);
512 c = abc_pushscope(c);
513 global->init->method->body->code = c;
516 void* finish_parser()
518 code_t*c = global->init->method->body->code;
519 /*c = abc_findpropstrict(c, "[package]::trace");
520 c = abc_pushstring(c, "[leaving global init function]");
521 c = abc_callpropvoid(c, "[package]::trace", 1);*/
522 c = abc_returnvoid(c);
523 global->init->method->body->code = c;
524 dict_destroy(global->token2info);global->token2info=0;
529 static void xx_scopetest()
531 /* findpropstrict doesn't just return a scope object- it
532 also makes it "active" somehow. Push local_0 on the
533 scope stack and read it back with findpropstrict, it'll
534 contain properties like "trace". Trying to find the same
535 property on a "vanilla" local_0 yields only a "undefined" */
536 //c = abc_findpropstrict(c, "[package]::trace");
538 /*c = abc_getlocal_0(c);
539 c = abc_findpropstrict(c, "[package]::trace");
541 c = abc_setlocal_1(c);
543 c = abc_pushbyte(c, 0);
544 c = abc_setlocal_2(c);
546 code_t*xx = c = abc_label(c);
547 c = abc_findpropstrict(c, "[package]::trace");
548 c = abc_pushstring(c, "prop:");
549 c = abc_hasnext2(c, 1, 2);
551 c = abc_setlocal_3(c);
552 c = abc_callpropvoid(c, "[package]::trace", 2);
553 c = abc_getlocal_3(c);
555 c = abc_iftrue(c,xx);*/
559 typedef struct _variable {
565 static variable_t* find_variable(char*name)
571 v = dict_lookup(s->vars, name);
581 static variable_t* find_variable_safe(char*name)
583 variable_t* v = find_variable(name);
585 syntaxerror("undefined variable: %s", name);
588 static char variable_exists(char*name)
590 return dict_lookup(state->vars, name)!=0;
592 code_t*defaultvalue(code_t*c, classinfo_t*type);
593 static int new_variable(const char*name, classinfo_t*type, char init)
596 v->index = state->method->variable_count;
600 dict_put(state->vars, name, v);
602 return state->method->variable_count++;
604 #define TEMPVARNAME "__as3_temp__"
605 static int gettempvar()
607 variable_t*v = find_variable(TEMPVARNAME);
610 return new_variable(TEMPVARNAME, 0, 0);
613 code_t* var_block(code_t*body)
619 for(t=0;t<state->vars->hashsize;t++) {
620 dictentry_t*e = state->vars->slots[t];
622 variable_t*v = (variable_t*)e->data;
623 if(v->type && v->init) {
624 c = defaultvalue(c, v->type);
625 c = abc_setlocal(c, v->index);
626 k = abc_kill(k, v->index);
636 if(x->opcode== OPCODE___BREAK__ ||
637 x->opcode== OPCODE___CONTINUE__) {
638 /* link kill code before break/continue */
639 code_t*e = code_dup(k);
640 code_t*s = code_start(e);
652 c = code_append(c, body);
653 c = code_append(c, k);
657 #define parserassert(b) {if(!(b)) parsererror(__FILE__, __LINE__,__func__);}
659 static void parsererror(const char*file, int line, const char*f)
661 syntaxerror("internal error in %s, %s:%d", f, file, line);
665 code_t* method_header()
668 if(state->method->late_binding && !state->method->inner) {
669 c = abc_getlocal_0(c);
670 c = abc_pushscope(c);
672 /*if(state->method->innerfunctions) {
673 c = abc_newactivation(c);
674 c = abc_pushscope(c);
676 if(state->method->is_constructor && !state->method->has_super) {
677 // call default constructor
678 c = abc_getlocal_0(c);
679 c = abc_constructsuper(c, 0);
681 methodstate_list_t*l = state->method->innerfunctions;
683 parserassert(l->methodstate->abc);
684 c = abc_newfunction(c, l->methodstate->abc);
685 c = abc_setlocal(c, l->methodstate->var_index);
686 free(l->methodstate);l->methodstate=0;
689 list_free(state->method->innerfunctions);
690 state->method->innerfunctions = 0;
695 static code_t* wrap_function(code_t*c,code_t*header, code_t*body)
697 c = code_append(c, header);
698 c = code_append(c, var_block(body));
699 /* append return if necessary */
700 if(!c || (c->opcode != OPCODE_RETURNVOID &&
701 c->opcode != OPCODE_RETURNVALUE)) {
702 c = abc_returnvoid(c);
708 static void startpackage(char*name)
711 /*printf("entering package \"%s\"\n", name);*/
712 state->package = strdup(name);
714 static void endpackage()
716 /*printf("leaving package \"%s\"\n", state->package);*/
718 //used e.g. in classinfo_register:
719 //free(state->package);state->package=0;
725 char*as3_globalclass=0;
726 static void startclass(int flags, char*classname, classinfo_t*extends, classinfo_list_t*implements, char interface)
729 syntaxerror("inner classes now allowed");
732 state->cls = rfx_calloc(sizeof(classstate_t));
733 state->method = rfx_calloc(sizeof(methodstate_t)); // method state, for static constructor
734 state->method->variable_count = 1;
737 classinfo_list_t*mlist=0;
739 if(flags&~(FLAG_PACKAGEINTERNAL|FLAG_PUBLIC|FLAG_FINAL|FLAG_DYNAMIC))
740 syntaxerror("invalid modifier(s)");
742 if((flags&(FLAG_PUBLIC|FLAG_PACKAGEINTERNAL)) == (FLAG_PUBLIC|FLAG_PACKAGEINTERNAL))
743 syntaxerror("public and internal not supported at the same time.");
745 /* create the class name, together with the proper attributes */
749 if(!(flags&FLAG_PUBLIC) && !state->package) {
750 access = ACCESS_PRIVATE; package = current_filename;
751 } else if(!(flags&FLAG_PUBLIC) && state->package) {
752 access = ACCESS_PACKAGEINTERNAL; package = state->package;
753 } else if(state->package) {
754 access = ACCESS_PACKAGE; package = state->package;
756 syntaxerror("public classes only allowed inside a package");
760 if(registry_findclass(package, classname)) {
761 syntaxerror("Package \"%s\" already contains a class called \"%s\"", package, classname);
763 /* build info struct */
764 int num_interfaces = (list_length(implements));
765 state->cls->info = classinfo_register(access, package, classname, num_interfaces);
769 state->cls->info = registry_findclass(package, classname);
770 parserassert((int)state->cls->info);
772 /* fill out interfaces and extends (we couldn't resolve those during the first pass) */
773 state->cls->info->superclass = extends?extends:TYPE_OBJECT;
775 classinfo_list_t*l = implements;
776 for(l=implements;l;l=l->next) {
777 state->cls->info->interfaces[pos++] = l->classinfo;
780 /* generate the abc code for this class */
781 MULTINAME(classname2,state->cls->info);
782 multiname_t*extends2 = sig2mname(extends);
784 state->cls->abc = abc_class_new(global->file, &classname2, extends2);
785 if(flags&FLAG_FINAL) abc_class_final(state->cls->abc);
786 if(!(flags&FLAG_DYNAMIC)) abc_class_sealed(state->cls->abc);
788 state->cls->info->flags |= CLASS_INTERFACE;
789 abc_class_interface(state->cls->abc);
792 abc_class_protectedNS(state->cls->abc, classname);
794 for(mlist=implements;mlist;mlist=mlist->next) {
795 MULTINAME(m, mlist->classinfo);
796 abc_class_add_interface(state->cls->abc, &m);
799 /* write the construction code for this class to the global init
801 int slotindex = abc_initscript_addClassTrait(global->init, &classname2, state->cls->abc);
803 abc_method_body_t*m = global->init->method->body;
804 __ getglobalscope(m);
805 classinfo_t*s = extends;
810 //TODO: take a look at the current scope stack, maybe
811 // we can re-use something
816 multiname_t*s2 = sig2mname(s);
818 multiname_destroy(s2);
820 __ pushscope(m); count++;
821 m->code = m->code->prev->prev; // invert
823 /* continue appending after last op end */
824 while(m->code && m->code->next) m->code = m->code->next;
826 /* TODO: if this is one of *our* classes, we can also
827 do a getglobalscope/getslot <nr> (which references
828 the init function's slots) */
830 __ getlex2(m, extends2);
832 /* notice: we get a Verify Error #1107 if the top elemnt on the scope
833 stack is not the superclass */
834 __ pushscope(m);count++;
837 /* notice: we get a verify error #1107 if the top element on the scope
838 stack is not the global object */
840 __ pushscope(m);count++;
842 __ newclass(m,state->cls->abc);
846 __ setslot(m, slotindex);
847 multiname_destroy(extends2);
849 /* flash.display.MovieClip handling */
851 if(!as3_globalclass && (flags&FLAG_PUBLIC) && classinfo_equals(registry_getMovieClip(),extends)) {
852 if(state->package && state->package[0]) {
853 as3_globalclass = concat3(state->package, ".", classname);
855 as3_globalclass = strdup(classname);
861 static void endclass()
864 if(!state->cls->has_constructor && !(state->cls->info->flags&CLASS_INTERFACE)) {
866 c = abc_getlocal_0(c);
867 c = abc_constructsuper(c, 0);
868 state->cls->init = code_append(state->cls->init, c);
870 if(!state->method->late_binding) {
871 // class initialization code uses late binding
873 c = abc_getlocal_0(c);
874 c = abc_pushscope(c);
875 state->cls->static_init = code_append(c, state->cls->static_init);
878 if(state->cls->init) {
879 abc_method_t*m = abc_class_getconstructor(state->cls->abc, 0);
880 m->body->code = wrap_function(0, state->cls->init, m->body->code);
882 if(state->cls->static_init) {
883 abc_method_t*m = abc_class_getstaticconstructor(state->cls->abc, 0);
884 m->body->code = wrap_function(0, state->cls->static_init, m->body->code);
891 void check_code_for_break(code_t*c)
894 if(c->opcode == OPCODE___BREAK__) {
895 char*name = string_cstr(c->data[0]);
896 syntaxerror("Unresolved \"break %s\"", name);
898 if(c->opcode == OPCODE___CONTINUE__) {
899 char*name = string_cstr(c->data[0]);
900 syntaxerror("Unresolved \"continue %s\"", name);
907 static void check_constant_against_type(classinfo_t*t, constant_t*c)
909 #define xassert(b) if(!(b)) syntaxerror("Invalid default value %s for type '%s'", constant_tostring(c), t->name)
910 if(TYPE_IS_NUMBER(t)) {
911 xassert(c->type == CONSTANT_FLOAT
912 || c->type == CONSTANT_INT
913 || c->type == CONSTANT_UINT);
914 } else if(TYPE_IS_UINT(t)) {
915 xassert(c->type == CONSTANT_UINT ||
916 (c->type == CONSTANT_INT && c->i>0));
917 } else if(TYPE_IS_INT(t)) {
918 xassert(c->type == CONSTANT_INT);
919 } else if(TYPE_IS_BOOLEAN(t)) {
920 xassert(c->type == CONSTANT_TRUE
921 || c->type == CONSTANT_FALSE);
926 static int flags2access(int flags)
929 if(flags&FLAG_PUBLIC) {
930 if(access&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
931 syntaxerror("invalid combination of access levels");
932 access = ACCESS_PACKAGE;
933 } else if(flags&FLAG_PRIVATE) {
934 if(access&(FLAG_PUBLIC|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL))
935 syntaxerror("invalid combination of access levels");
936 access = ACCESS_PRIVATE;
937 } else if(flags&FLAG_PROTECTED) {
938 if(access&(FLAG_PUBLIC|FLAG_PRIVATE|FLAG_PACKAGEINTERNAL))
939 syntaxerror("invalid combination of access levels");
940 access = ACCESS_PROTECTED;
942 access = ACCESS_PACKAGEINTERNAL;
948 static memberinfo_t*registerfunction(enum yytokentype getset, int flags, char*name, params_t*params, classinfo_t*return_type, int slot)
950 memberinfo_t*minfo = 0;
953 minfo = memberinfo_register_global(flags2access(flags), state->package, name, MEMBER_METHOD);
954 minfo->return_type = return_type;
955 } else if(getset != KW_GET && getset != KW_SET) {
957 if((minfo = registry_findmember(state->cls->info, name, 0))) {
958 if(minfo->parent == state->cls->info) {
959 syntaxerror("class already contains a member/method called '%s'", name);
960 } else if(!minfo->parent) {
961 syntaxerror("internal error: overriding method %s, which doesn't have parent", name);
963 if(!(minfo->flags&(FLAG_STATIC|FLAG_PRIVATE)))
964 syntaxerror("function %s already exists in superclass. Did you forget the 'override' keyword?");
967 minfo = memberinfo_register(state->cls->info, name, MEMBER_METHOD);
968 minfo->return_type = return_type;
969 // getslot on a member slot only returns "undefined", so no need
970 // to actually store these
971 //state->minfo->slot = state->method->abc->method->trait->slot_id;
973 //class getter/setter
974 int gs = getset==KW_GET?MEMBER_GET:MEMBER_SET;
978 else if(params->list && params->list->param)
979 type = params->list->param->type;
980 // not sure wether to look into superclasses here, too
981 if((minfo=registry_findmember(state->cls->info, name, 0))) {
982 if(minfo->kind & ~(MEMBER_GET|MEMBER_SET))
983 syntaxerror("class already contains a member or method called '%s'", name);
985 syntaxerror("getter/setter for '%s' already defined", name);
986 /* make a setter or getter into a getset */
991 if(type && minfo->type != type)
992 syntaxerror("different type in getter and setter");
994 minfo = memberinfo_register(state->cls->info, name, gs);
997 /* can't assign a slot as getter and setter might have different slots */
998 //minfo->slot = slot;
1000 if(flags&FLAG_STATIC) minfo->flags |= FLAG_STATIC;
1001 if(flags&FLAG_PUBLIC) minfo->flags |= FLAG_PUBLIC;
1002 if(flags&FLAG_PRIVATE) minfo->flags |= FLAG_PRIVATE;
1003 if(flags&FLAG_PROTECTED) minfo->flags |= FLAG_PROTECTED;
1004 if(flags&FLAG_PACKAGEINTERNAL) minfo->flags |= FLAG_PACKAGEINTERNAL;
1005 if(flags&FLAG_OVERRIDE) minfo->flags |= FLAG_OVERRIDE;
1009 static void function_initvars(params_t*params, int flags)
1011 if(state->method->inner)
1012 new_variable("this", 0, 0);
1013 else if(!state->method->is_global)
1014 new_variable((flags&FLAG_STATIC)?"class":"this", state->cls->info, 0);
1016 new_variable("globalscope", 0, 0);
1019 for(p=params->list;p;p=p->next) {
1020 new_variable(p->param->name, p->param->type, 0);
1023 methodstate_list_t*l = state->method->innerfunctions;
1025 methodstate_t*m = l->methodstate;
1026 m->var_index = new_variable(m->info->name, TYPE_FUNCTION(m->info), 0);
1031 static void innerfunction(char*name, params_t*params, classinfo_t*return_type)
1033 parserassert(state->method && state->method->info);
1035 methodstate_t*parent_method = state->method;
1044 state->new_vars = 1;
1047 state->method = rfx_calloc(sizeof(methodstate_t));
1048 state->method->inner = 1;
1049 state->method->variable_count = 0;
1050 state->method->abc = rfx_calloc(sizeof(abc_method_t));
1052 NEW(memberinfo_t,minfo);
1054 state->method->info = minfo;
1056 list_append(parent_method->innerfunctions, state->method);
1058 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1062 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1063 parserassert(state->method);
1065 state->method->info->return_type = return_type;
1066 function_initvars(params, 0);
1070 static void startfunction(token_t*ns, int flags, enum yytokentype getset, char*name,
1071 params_t*params, classinfo_t*return_type)
1073 if(state->method && state->method->info) {
1074 syntaxerror("not able to start another method scope");
1079 state->method = rfx_calloc(sizeof(methodstate_t));
1080 state->method->has_super = 0;
1081 state->method->variable_count = 0;
1084 state->method->is_constructor = !strcmp(state->cls->info->name,name);
1086 state->method->is_global = 1;
1087 state->method->late_binding = 1; // for global methods, always push local_0 on the scope stack
1089 if(state->method->is_constructor)
1090 name = "__as3_constructor__";
1093 state->method->info = registerfunction(getset, flags, name, params, return_type, 0);
1095 dict_put(global->token2info, (void*)(ptroff_t)as3_tokencount, state->method);
1099 state->method = dict_lookup(global->token2info, (void*)(ptroff_t)as3_tokencount);
1100 parserassert(state->method);
1103 state->cls->has_constructor |= state->method->is_constructor;
1106 state->method->info->return_type = return_type;
1107 function_initvars(params, flags);
1111 static abc_method_t* endfunction(token_t*ns, int flags, enum yytokentype getset, char*name,
1112 params_t*params, classinfo_t*return_type, code_t*body)
1121 multiname_t*type2 = sig2mname(return_type);
1123 if(state->method->inner) {
1124 f = state->method->abc;
1125 abc_method_init(f, global->file, type2, 1);
1126 } else if(state->method->is_constructor) {
1127 f = abc_class_getconstructor(state->cls->abc, type2);
1128 } else if(!state->method->is_global) {
1129 namespace_t mname_ns = flags2namespace(flags, "");
1130 multiname_t mname = {QNAME, &mname_ns, 0, name};
1132 if(flags&FLAG_STATIC)
1133 f = abc_class_staticmethod(state->cls->abc, type2, &mname);
1135 f = abc_class_method(state->cls->abc, type2, &mname);
1136 slot = f->trait->slot_id;
1138 namespace_t mname_ns = flags2namespace(flags, state->package);
1139 multiname_t mname = {QNAME, &mname_ns, 0, name};
1141 f = abc_method_new(global->file, type2, 1);
1142 trait_t*t = trait_new_method(&global->init->traits, multiname_clone(&mname), f);
1143 //abc_code_t*c = global->init->method->body->code;
1145 //flash doesn't seem to allow us to access function slots
1146 //state->method->info->slot = slot;
1148 if(flags&FLAG_OVERRIDE) f->trait->attributes |= TRAIT_ATTR_OVERRIDE;
1149 if(getset == KW_GET) f->trait->kind = TRAIT_GETTER;
1150 if(getset == KW_SET) f->trait->kind = TRAIT_SETTER;
1151 if(params->varargs) f->flags |= METHOD_NEED_REST;
1155 for(p=params->list;p;p=p->next) {
1156 if(params->varargs && !p->next) {
1157 break; //varargs: omit last parameter in function signature
1159 multiname_t*m = sig2mname(p->param->type);
1160 list_append(f->parameters, m);
1161 if(p->param->value) {
1162 check_constant_against_type(p->param->type, p->param->value);
1163 opt=1;list_append(f->optional_parameters, p->param->value);
1165 syntaxerror("non-optional parameter not allowed after optional parameters");
1168 check_code_for_break(body);
1171 f->body->code = body;
1172 f->body->exceptions = state->method->exceptions;
1173 } else { //interface
1175 syntaxerror("interface methods can't have a method body");
1182 char is_subtype_of(classinfo_t*type, classinfo_t*supertype)
1187 void breakjumpsto(code_t*c, char*name, code_t*jump)
1190 if(c->opcode == OPCODE___BREAK__) {
1191 string_t*name2 = c->data[0];
1192 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1193 c->opcode = OPCODE_JUMP;
1200 void continuejumpsto(code_t*c, char*name, code_t*jump)
1203 if(c->opcode == OPCODE___CONTINUE__) {
1204 string_t*name2 = c->data[0];
1205 if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1206 c->opcode = OPCODE_JUMP;
1214 #define IS_INT(a) (TYPE_IS_INT((a)) || TYPE_IS_UINT((a)))
1215 #define IS_NUMBER_OR_INT(a) (TYPE_IS_INT((a)) || TYPE_IS_UINT((a)) || TYPE_IS_NUMBER((a)))
1216 #define BOTH_INT(a,b) (IS_INT(a) && IS_INT(b))
1218 classinfo_t*join_types(classinfo_t*type1, classinfo_t*type2, char op)
1220 if(!type1 || !type2)
1221 return registry_getanytype();
1222 if(TYPE_IS_ANY(type1) || TYPE_IS_ANY(type2))
1223 return registry_getanytype();
1226 if(IS_NUMBER_OR_INT(type1) && IS_NUMBER_OR_INT(type2)) {
1235 return registry_getanytype();
1237 code_t*converttype(code_t*c, classinfo_t*from, classinfo_t*to)
1242 return abc_coerce_a(c);
1246 // cast an "any" type to a specific type. subject to
1247 // runtime exceptions
1248 return abc_coerce2(c, &m);
1251 if((TYPE_IS_NUMBER(from) || TYPE_IS_UINT(from) || TYPE_IS_INT(from)) &&
1252 (TYPE_IS_NUMBER(to) || TYPE_IS_UINT(to) || TYPE_IS_INT(to))) {
1253 // allow conversion between number types
1254 return abc_coerce2(c, &m);
1256 //printf("%s.%s\n", from.package, from.name);
1257 //printf("%s.%s\n", to.package, to.name);
1259 classinfo_t*supertype = from;
1261 if(supertype == to) {
1262 // target type is one of from's superclasses
1263 return abc_coerce2(c, &m);
1266 while(supertype->interfaces[t]) {
1267 if(supertype->interfaces[t]==to) {
1268 // target type is one of from's interfaces
1269 return abc_coerce2(c, &m);
1273 supertype = supertype->superclass;
1275 if(TYPE_IS_FUNCTION(from) && TYPE_IS_FUNCTION(to))
1277 if(TYPE_IS_CLASS(from) && TYPE_IS_CLASS(to))
1279 syntaxerror("can't convert type %s to %s", from->name, to->name);
1280 return 0; // make gcc happy
1283 code_t*defaultvalue(code_t*c, classinfo_t*type)
1285 if(TYPE_IS_INT(type)) {
1286 c = abc_pushbyte(c, 0);
1287 } else if(TYPE_IS_UINT(type)) {
1288 c = abc_pushuint(c, 0);
1289 } else if(TYPE_IS_FLOAT(type)) {
1291 } else if(TYPE_IS_BOOLEAN(type)) {
1292 c = abc_pushfalse(c);
1294 //c = abc_pushundefined(c);
1296 c = abc_pushnull(c);
1298 c = abc_coerce2(c, &m);
1303 char is_pushundefined(code_t*c)
1305 return (c && !c->prev && !c->next && c->opcode == OPCODE_PUSHUNDEFINED);
1308 static classinfo_t* find_class(char*name)
1312 c = registry_findclass(state->package, name);
1315 /* try explicit imports */
1316 dictentry_t* e = dict_get_slot(state->imports, name);
1319 if(!strcmp(e->key, name)) {
1320 c = (classinfo_t*)e->data;
1326 /* try package.* imports */
1327 import_list_t*l = state->wildcard_imports;
1329 //printf("does package %s contain a class %s?\n", l->import->package, name);
1330 c = registry_findclass(l->import->package, name);
1335 /* try global package */
1336 c = registry_findclass("", name);
1339 /* try local "filename" package */
1340 c = registry_findclass(current_filename_short, name);
1346 static char is_getlocal(code_t*c)
1348 if(!c || c->prev || c->next)
1350 return(c->opcode == OPCODE_GETLOCAL
1351 || c->opcode == OPCODE_GETLOCAL_0
1352 || c->opcode == OPCODE_GETLOCAL_1
1353 || c->opcode == OPCODE_GETLOCAL_2
1354 || c->opcode == OPCODE_GETLOCAL_3);
1356 static int getlocalnr(code_t*c)
1358 if(c->opcode == OPCODE_GETLOCAL) {return (ptroff_t)c->data[0];}
1359 else if(c->opcode == OPCODE_GETLOCAL_0) {return 0;}
1360 else if(c->opcode == OPCODE_GETLOCAL_1) {return 1;}
1361 else if(c->opcode == OPCODE_GETLOCAL_2) {return 2;}
1362 else if(c->opcode == OPCODE_GETLOCAL_3) {return 3;}
1363 else syntaxerror("Internal error: opcode %02x is not a getlocal call", c->opcode);
1367 static code_t* toreadwrite(code_t*in, code_t*middlepart, char justassign, char readbefore)
1371 [prefix code] [read instruction]
1375 [prefix code] ([dup]) [read instruction] [middlepart] [setvar] [write instruction] [getvar]
1378 if(in && in->opcode == OPCODE_COERCE_A) {
1379 in = code_cutlast(in);
1382 syntaxerror("internal error");
1384 /* chop off read instruction */
1388 prefix = r->prev;r->prev = 0;
1394 char use_temp_var = readbefore;
1396 /* generate the write instruction, and maybe append a dup to the prefix code */
1397 code_t* write = abc_nop(0);
1398 if(r->opcode == OPCODE_GETPROPERTY) {
1399 write->opcode = OPCODE_SETPROPERTY;
1400 multiname_t*m = (multiname_t*)r->data[0];
1401 write->data[0] = multiname_clone(m);
1402 if(m->type == QNAME || m->type == MULTINAME) {
1404 prefix = abc_dup(prefix); // we need the object, too
1407 } else if(m->type == MULTINAMEL) {
1409 /* dupping two values on the stack requires 5 operations and one register-
1410 couldn't adobe just have given us a dup2? */
1411 int temp = gettempvar();
1412 prefix = abc_setlocal(prefix, temp);
1413 prefix = abc_dup(prefix);
1414 prefix = abc_getlocal(prefix, temp);
1415 prefix = abc_swap(prefix);
1416 prefix = abc_getlocal(prefix, temp);
1418 prefix = abc_kill(prefix, temp);
1422 syntaxerror("illegal lvalue: can't assign a value to this expression (not a qname/multiname)");
1424 } else if(r->opcode == OPCODE_GETSLOT) {
1425 write->opcode = OPCODE_SETSLOT;
1426 write->data[0] = r->data[0];
1428 prefix = abc_dup(prefix); // we need the object, too
1431 } else if(r->opcode == OPCODE_GETLOCAL) {
1432 write->opcode = OPCODE_SETLOCAL;
1433 write->data[0] = r->data[0];
1434 } else if(r->opcode == OPCODE_GETLOCAL_0) {
1435 write->opcode = OPCODE_SETLOCAL_0;
1436 } else if(r->opcode == OPCODE_GETLOCAL_1) {
1437 write->opcode = OPCODE_SETLOCAL_1;
1438 } else if(r->opcode == OPCODE_GETLOCAL_2) {
1439 write->opcode = OPCODE_SETLOCAL_2;
1440 } else if(r->opcode == OPCODE_GETLOCAL_3) {
1441 write->opcode = OPCODE_SETLOCAL_3;
1444 syntaxerror("illegal lvalue: can't assign a value to this expression");
1451 /* with getproperty/getslot, we have to be extra careful not
1452 to execute the read code twice, as it might have side-effects
1453 (e.g. if the property is in fact a setter/getter combination)
1455 So read the value, modify it, and write it again,
1456 using prefix only once and making sure (by using a temporary
1457 register) that the return value is what we just wrote */
1458 temp = gettempvar();
1459 c = code_append(c, prefix);
1460 c = code_append(c, r);
1463 c = abc_setlocal(c, temp);
1465 c = code_append(c, middlepart);
1468 c = abc_setlocal(c, temp);
1470 c = code_append(c, write);
1471 c = abc_getlocal(c, temp);
1472 c = abc_kill(c, temp);
1474 /* if we're allowed to execute the read code twice *and*
1475 the middlepart doesn't modify the code, things are easier.
1477 code_t* r2 = code_dup(r);
1478 //c = code_append(c, prefix);
1479 parserassert(!prefix);
1480 c = code_append(c, r);
1481 c = code_append(c, middlepart);
1482 c = code_append(c, write);
1483 c = code_append(c, r2);
1486 /* even smaller version: overwrite the value without reading
1490 c = code_append(c, prefix);
1493 c = code_append(c, middlepart);
1494 c = code_append(c, write);
1495 c = code_append(c, r);
1497 temp = gettempvar();
1499 c = code_append(c, prefix);
1501 c = code_append(c, middlepart);
1503 c = abc_setlocal(c, temp);
1504 c = code_append(c, write);
1505 c = abc_getlocal(c, temp);
1506 c = abc_kill(c, temp);
1512 char is_break_or_jump(code_t*c)
1516 if(c->opcode == OPCODE_JUMP ||
1517 c->opcode == OPCODE___BREAK__ ||
1518 c->opcode == OPCODE___CONTINUE__ ||
1519 c->opcode == OPCODE_THROW ||
1520 c->opcode == OPCODE_RETURNVOID ||
1521 c->opcode == OPCODE_RETURNVALUE) {
1528 #define IS_FINALLY_TARGET(op) \
1529 ((op) == OPCODE___CONTINUE__ || \
1530 (op) == OPCODE___BREAK__ || \
1531 (op) == OPCODE_RETURNVOID || \
1532 (op) == OPCODE_RETURNVALUE || \
1533 (op) == OPCODE___RETHROW__)
1535 static code_t* insert_finally_lookup(code_t*c, code_t*finally, int tempvar)
1537 #define NEED_EXTRA_STACK_ARG
1538 code_t*finally_label = abc_nop(0);
1539 NEW(lookupswitch_t, l);
1545 code_t*prev = i->prev;
1546 if(IS_FINALLY_TARGET(i->opcode)) {
1549 if(i->opcode == OPCODE___RETHROW__ ||
1550 i->opcode == OPCODE_RETURNVALUE) {
1551 if(i->opcode == OPCODE___RETHROW__)
1552 i->opcode = OPCODE_THROW;
1554 p = abc_coerce_a(p);
1555 p = abc_setlocal(p, tempvar);
1557 p = abc_pushbyte(p, count++);
1558 p = abc_jump(p, finally_label);
1559 code_t*target = p = abc_label(p);
1560 #ifdef NEED_EXTRA_STACK_ARG
1564 p = abc_getlocal(p, tempvar);
1567 p->next = i;i->prev = p;
1568 list_append(l->targets, target);
1574 c = abc_pushbyte(c, -1);
1575 c = code_append(c, finally_label);
1576 c = code_append(c, finally);
1578 #ifdef NEED_EXTRA_STACK_ARG
1581 c = abc_lookupswitch(c, l);
1582 c = l->def = abc_label(c);
1583 #ifdef NEED_EXTRA_STACK_ARG
1590 static code_t* insert_finally_simple(code_t*c, code_t*finally, int tempvar)
1594 code_t*prev = i->prev;
1595 if(IS_FINALLY_TARGET(i->opcode)) {
1596 if(i->opcode == OPCODE___RETHROW__)
1597 i->opcode = OPCODE_THROW;
1598 code_t*end = code_dup(finally);
1599 code_t*start = code_start(end);
1600 if(prev) prev->next = start;
1607 return code_append(c, finally);
1610 code_t* insert_finally(code_t*c, code_t*finally, int tempvar)
1616 int num_insertion_points=0;
1618 if(IS_FINALLY_TARGET(i->opcode))
1619 num_insertion_points++;
1626 if(i->branch || i->opcode == OPCODE_LOOKUPSWITCH) {
1631 int simple_version_cost = (1+num_insertion_points)*code_size;
1632 int lookup_version_cost = 4*num_insertion_points + 5;
1634 if(cantdup || simple_version_cost > lookup_version_cost) {
1635 printf("lookup %d > *%d*\n", simple_version_cost, lookup_version_cost);
1636 return insert_finally_lookup(c, finally, tempvar);
1638 printf("simple *%d* < %d\n", simple_version_cost, lookup_version_cost);
1639 return insert_finally_simple(c, finally, tempvar);
1643 #define PASS1 }} if(as3_pass == 1) {{
1644 #define PASS1END }} if(as3_pass == 2) {{
1645 #define PASS2 }} if(as3_pass == 2) {{
1646 #define PASS12 }} {{
1647 #define PASS12END }} if(as3_pass == 2) {{
1651 /* Line 273 of skeleton.m4 */
1652 #line 1653 "parser.tab.c"
1659 typedef YYTYPE_UINT8 yytype_uint8;
1661 typedef unsigned char yytype_uint8;
1665 typedef YYTYPE_INT8 yytype_int8;
1666 #elif (defined __STDC__ || defined __C99__FUNC__ \
1667 || defined __cplusplus || defined _MSC_VER)
1668 typedef signed char yytype_int8;
1670 typedef short int yytype_int8;
1673 #ifdef YYTYPE_UINT16
1674 typedef YYTYPE_UINT16 yytype_uint16;
1676 typedef unsigned short int yytype_uint16;
1680 typedef YYTYPE_INT16 yytype_int16;
1682 typedef short int yytype_int16;
1686 # ifdef __SIZE_TYPE__
1687 # define YYSIZE_T __SIZE_TYPE__
1688 # elif defined size_t
1689 # define YYSIZE_T size_t
1690 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
1691 || defined __cplusplus || defined _MSC_VER)
1692 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1693 # define YYSIZE_T size_t
1695 # define YYSIZE_T unsigned int
1699 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
1704 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1705 # define YY_(msgid) dgettext ("bison-runtime", msgid)
1709 # define YY_(msgid) msgid
1713 /* Suppress unused-variable warnings by "using" E. */
1714 #if ! defined lint || defined __GNUC__
1715 # define YYUSE(e) ((void) (e))
1717 # define YYUSE(e) /* empty */
1720 /* Identity function, used to suppress warnings about constant conditions. */
1722 # define YYID(n) (n)
1724 #if (defined __STDC__ || defined __C99__FUNC__ \
1725 || defined __cplusplus || defined _MSC_VER)
1738 #if ! defined yyoverflow || YYERROR_VERBOSE
1740 /* The parser invokes alloca or malloc; define the necessary symbols. */
1742 # ifdef YYSTACK_USE_ALLOCA
1743 # if YYSTACK_USE_ALLOCA
1745 # define YYSTACK_ALLOC __builtin_alloca
1746 # elif defined __BUILTIN_VA_ARG_INCR
1747 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1749 # define YYSTACK_ALLOC __alloca
1750 # elif defined _MSC_VER
1751 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1752 # define alloca _alloca
1754 # define YYSTACK_ALLOC alloca
1755 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1756 || defined __cplusplus || defined _MSC_VER)
1757 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1759 # define _STDLIB_H 1
1766 # ifdef YYSTACK_ALLOC
1767 /* Pacify GCC's `empty if-body' warning. */
1768 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
1769 # ifndef YYSTACK_ALLOC_MAXIMUM
1770 /* The OS might guarantee only one guard page at the bottom of the stack,
1771 and a page size can be as small as 4096 bytes. So we cannot safely
1772 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1773 to allow for a few compiler-allocated temporary stack slots. */
1774 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1777 # define YYSTACK_ALLOC YYMALLOC
1778 # define YYSTACK_FREE YYFREE
1779 # ifndef YYSTACK_ALLOC_MAXIMUM
1780 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1782 # if (defined __cplusplus && ! defined _STDLIB_H \
1783 && ! ((defined YYMALLOC || defined malloc) \
1784 && (defined YYFREE || defined free)))
1785 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1787 # define _STDLIB_H 1
1791 # define YYMALLOC malloc
1792 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1793 || defined __cplusplus || defined _MSC_VER)
1794 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1798 # define YYFREE free
1799 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1800 || defined __cplusplus || defined _MSC_VER)
1801 void free (void *); /* INFRINGES ON USER NAME SPACE */
1805 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1808 #if (! defined yyoverflow \
1809 && (! defined __cplusplus \
1810 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1812 /* A type that is properly aligned for any stack member. */
1815 yytype_int16 yyss_alloc;
1819 /* The size of the maximum gap between one aligned stack and the next. */
1820 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1822 /* The size of an array large to enough to hold all stacks, each with
1824 # define YYSTACK_BYTES(N) \
1825 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1826 + YYSTACK_GAP_MAXIMUM)
1828 /* Copy COUNT objects from FROM to TO. The source and destination do
1831 # if defined __GNUC__ && 1 < __GNUC__
1832 # define YYCOPY(To, From, Count) \
1833 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1835 # define YYCOPY(To, From, Count) \
1839 for (yyi = 0; yyi < (Count); yyi++) \
1840 (To)[yyi] = (From)[yyi]; \
1846 /* Relocate STACK from its old location to the new one. The
1847 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1848 elements in the stack, and YYPTR gives the new location of the
1849 stack. Advance YYPTR to a properly aligned location for the next
1851 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
1854 YYSIZE_T yynewbytes; \
1855 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
1856 Stack = &yyptr->Stack_alloc; \
1857 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1858 yyptr += yynewbytes / sizeof (*yyptr); \
1864 /* YYFINAL -- State number of the termination state. */
1866 /* YYLAST -- Last index in YYTABLE. */
1869 /* YYNTOKENS -- Number of terminals. */
1870 #define YYNTOKENS 131
1871 /* YYNNTS -- Number of nonterminals. */
1873 /* YYNRULES -- Number of rules. */
1874 #define YYNRULES 287
1875 /* YYNRULES -- Number of states. */
1876 #define YYNSTATES 479
1878 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1879 #define YYUNDEFTOK 2
1880 #define YYMAXUTOK 361
1882 #define YYTRANSLATE(YYX) \
1883 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1885 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1886 static const yytype_uint8 yytranslate[] =
1888 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1889 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1890 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1891 2, 2, 2, 116, 2, 2, 2, 114, 106, 2,
1892 120, 130, 113, 111, 97, 110, 125, 112, 2, 2,
1893 2, 2, 2, 2, 2, 2, 2, 2, 103, 96,
1894 107, 99, 108, 102, 2, 2, 2, 2, 2, 2,
1895 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1896 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1897 2, 122, 2, 123, 105, 2, 2, 2, 2, 2,
1898 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1899 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1900 2, 2, 2, 124, 104, 129, 115, 2, 2, 2,
1901 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1902 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1903 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1904 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1905 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1906 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1907 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1908 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1909 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1910 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1911 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1912 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1913 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1914 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1915 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1916 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1917 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1918 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1919 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1920 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1921 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1922 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1923 95, 98, 100, 101, 109, 117, 118, 119, 121, 126,
1928 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1930 static const yytype_uint16 yyprhs[] =
1932 0, 0, 3, 5, 6, 8, 10, 13, 15, 17,
1933 19, 21, 23, 25, 27, 28, 30, 32, 35, 37,
1934 39, 41, 43, 45, 47, 49, 50, 53, 55, 57,
1935 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
1936 79, 81, 83, 85, 87, 89, 91, 93, 97, 100,
1937 103, 105, 107, 110, 111, 114, 117, 119, 123, 127,
1938 128, 131, 132, 140, 141, 143, 145, 149, 151, 154,
1939 158, 167, 174, 175, 182, 183, 191, 193, 196, 198,
1940 201, 202, 204, 206, 209, 211, 214, 219, 223, 224,
1941 233, 234, 244, 245, 251, 253, 256, 258, 261, 263,
1942 264, 271, 274, 276, 282, 284, 286, 290, 292, 293,
1943 300, 301, 307, 310, 315, 316, 318, 320, 323, 325,
1944 327, 329, 331, 333, 335, 337, 339, 341, 342, 345,
1945 346, 349, 350, 353, 354, 364, 365, 374, 375, 377,
1946 379, 382, 384, 386, 388, 390, 391, 393, 395, 398,
1947 400, 403, 412, 414, 416, 422, 423, 426, 428, 430,
1948 432, 434, 436, 438, 440, 442, 443, 445, 448, 453,
1949 457, 459, 464, 467, 469, 471, 472, 473, 486, 488,
1950 489, 490, 501, 503, 507, 509, 511, 513, 517, 519,
1951 521, 523, 526, 527, 528, 532, 533, 535, 537, 541,
1952 542, 547, 552, 557, 560, 562, 565, 567, 569, 573,
1953 575, 577, 579, 581, 583, 585, 587, 589, 591, 593,
1954 595, 597, 599, 601, 603, 605, 607, 609, 613, 617,
1955 621, 625, 629, 633, 637, 641, 645, 649, 652, 655,
1956 659, 663, 667, 671, 675, 679, 683, 687, 691, 695,
1957 699, 703, 707, 711, 715, 720, 723, 725, 729, 732,
1958 737, 741, 742, 744, 748, 754, 758, 762, 766, 770,
1959 774, 778, 782, 786, 790, 794, 798, 804, 807, 810,
1960 813, 816, 820, 824, 826, 830, 836, 842
1963 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1964 static const yytype_int16 yyrhs[] =
1966 132, 0, -1, 133, -1, -1, 134, -1, 135, -1,
1967 134, 135, -1, 181, -1, 193, -1, 191, -1, 209,
1968 -1, 202, -1, 144, -1, 96, -1, -1, 137, -1,
1969 138, -1, 137, 138, -1, 193, -1, 191, -1, 209,
1970 -1, 202, -1, 144, -1, 96, -1, 140, -1, -1,
1971 140, 142, -1, 142, -1, 184, -1, 155, -1, 156,
1972 -1, 157, -1, 159, -1, 167, -1, 150, -1, 178,
1973 -1, 175, -1, 230, -1, 96, -1, 141, -1, 146,
1974 -1, 161, -1, 162, -1, 227, -1, 177, -1, 236,
1975 -1, 237, -1, 124, 140, 129, -1, 124, 129, -1,
1976 142, 96, -1, 142, -1, 141, -1, 99, 228, -1,
1977 -1, 45, 147, -1, 31, 147, -1, 148, -1, 147,
1978 97, 148, -1, 3, 219, 145, -1, -1, 64, 143,
1979 -1, -1, 63, 120, 151, 229, 130, 143, 149, -1,
1980 -1, 146, -1, 230, -1, 45, 3, 219, -1, 3,
1981 -1, 12, 120, -1, 12, 49, 120, -1, 154, 152,
1982 96, 229, 96, 230, 130, 143, -1, 154, 153, 67,
1983 229, 130, 143, -1, -1, 13, 120, 158, 229, 130,
1984 143, -1, -1, 14, 160, 143, 13, 120, 229, 130,
1985 -1, 65, -1, 65, 3, -1, 29, -1, 29, 3,
1986 -1, -1, 164, -1, 166, -1, 164, 166, -1, 165,
1987 -1, 164, 165, -1, 33, 231, 103, 139, -1, 61,
1988 103, 139, -1, -1, 15, 120, 168, 231, 130, 124,
1989 163, 129, -1, -1, 32, 120, 3, 219, 130, 170,
1990 124, 139, 129, -1, -1, 27, 124, 172, 139, 129,
1991 -1, 169, -1, 173, 169, -1, 173, -1, 173, 171,
1992 -1, 171, -1, -1, 51, 124, 176, 139, 129, 174,
1993 -1, 36, 229, -1, 36, -1, 38, 120, 229, 130,
1994 143, -1, 3, -1, 18, -1, 180, 125, 179, -1,
1995 179, -1, -1, 18, 180, 124, 182, 136, 129, -1,
1996 -1, 18, 124, 183, 136, 129, -1, 40, 216, -1,
1997 40, 180, 125, 113, -1, -1, 186, -1, 187, -1,
1998 186, 187, -1, 20, -1, 21, -1, 19, -1, 37,
1999 -1, 46, -1, 48, -1, 47, -1, 25, -1, 23,
2000 -1, -1, 53, 216, -1, -1, 53, 217, -1, -1,
2001 16, 217, -1, -1, 185, 30, 3, 188, 190, 124,
2002 192, 195, 129, -1, -1, 185, 43, 3, 189, 124,
2003 194, 198, 129, -1, -1, 196, -1, 197, -1, 196,
2004 197, -1, 96, -1, 202, -1, 209, -1, 141, -1,
2005 -1, 199, -1, 200, -1, 199, 200, -1, 96, -1,
2006 45, 3, -1, 185, 26, 208, 3, 120, 205, 130,
2007 219, -1, 45, -1, 31, -1, 185, 201, 3, 219,
2008 145, -1, -1, 99, 204, -1, 9, -1, 7, -1,
2009 8, -1, 11, -1, 4, -1, 55, -1, 54, -1,
2010 44, -1, -1, 206, -1, 90, 207, -1, 206, 97,
2011 90, 207, -1, 206, 97, 207, -1, 207, -1, 3,
2012 103, 218, 203, -1, 3, 203, -1, 50, -1, 34,
2013 -1, -1, -1, 185, 26, 208, 3, 120, 205, 130,
2014 219, 124, 210, 139, 129, -1, 3, -1, -1, -1,
2015 26, 211, 120, 205, 130, 219, 124, 213, 139, 129,
2016 -1, 3, -1, 180, 125, 3, -1, 215, -1, 214,
2017 -1, 216, -1, 217, 97, 216, -1, 216, -1, 113,
2018 -1, 35, -1, 103, 218, -1, -1, -1, 120, 221,
2019 130, -1, -1, 222, -1, 228, -1, 222, 97, 228,
2020 -1, -1, 24, 231, 223, 220, -1, 231, 120, 221,
2021 130, -1, 52, 120, 221, 130, -1, 62, 231, -1,
2022 41, -1, 41, 229, -1, 231, -1, 231, -1, 229,
2023 97, 231, -1, 229, -1, 212, -1, 232, -1, 235,
2024 -1, 224, -1, 226, -1, 225, -1, 5, -1, 9,
2025 -1, 10, -1, 7, -1, 8, -1, 11, -1, 4,
2026 -1, 28, -1, 55, -1, 54, -1, 44, -1, 231,
2027 107, 231, -1, 231, 108, 231, -1, 231, 73, 231,
2028 -1, 231, 74, 231, -1, 231, 69, 231, -1, 231,
2029 70, 231, -1, 231, 72, 231, -1, 231, 71, 231,
2030 -1, 231, 84, 231, -1, 231, 85, 231, -1, 116,
2031 231, -1, 115, 231, -1, 231, 106, 231, -1, 231,
2032 105, 231, -1, 231, 104, 231, -1, 231, 93, 231,
2033 -1, 231, 92, 231, -1, 231, 91, 231, -1, 231,
2034 112, 231, -1, 231, 114, 231, -1, 231, 111, 231,
2035 -1, 231, 110, 231, -1, 231, 113, 231, -1, 231,
2036 67, 231, -1, 231, 68, 231, -1, 231, 39, 231,
2037 -1, 231, 66, 231, -1, 42, 120, 231, 130, -1,
2038 35, 231, -1, 35, -1, 120, 229, 130, -1, 110,
2039 231, -1, 231, 122, 231, 123, -1, 122, 221, 123,
2040 -1, -1, 234, -1, 228, 103, 228, -1, 234, 97,
2041 228, 103, 228, -1, 124, 233, 129, -1, 231, 78,
2042 231, -1, 231, 77, 231, -1, 231, 82, 231, -1,
2043 231, 81, 231, -1, 231, 83, 231, -1, 231, 76,
2044 231, -1, 231, 75, 231, -1, 231, 79, 231, -1,
2045 231, 80, 231, -1, 231, 99, 231, -1, 231, 102,
2046 231, 103, 231, -1, 231, 88, -1, 231, 87, -1,
2047 88, 231, -1, 87, 231, -1, 52, 125, 3, -1,
2048 231, 125, 3, -1, 3, -1, 185, 17, 3, -1,
2049 185, 17, 3, 99, 3, -1, 185, 17, 3, 99,
2050 4, -1, 22, 17, 3, -1
2053 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
2054 static const yytype_uint16 yyrline[] =
2056 0, 1629, 1629, 1631, 1631, 1632, 1633, 1635, 1636, 1637,
2057 1638, 1639, 1640, 1641, 1643, 1643, 1644, 1645, 1647, 1648,
2058 1649, 1650, 1651, 1652, 1654, 1655, 1657, 1658, 1661, 1662,
2059 1663, 1664, 1665, 1666, 1667, 1668, 1669, 1670, 1673, 1674,
2060 1675, 1676, 1677, 1678, 1679, 1681, 1682, 1684, 1685, 1686,
2061 1687, 1691, 1698, 1699, 1703, 1704, 1706, 1707, 1709, 1750,
2062 1751, 1754, 1754, 1773, 1774, 1775, 1778, 1781, 1785, 1786,
2063 1788, 1808, 1851, 1851, 1870, 1870, 1885, 1888, 1891, 1894,
2064 1898, 1899, 1900, 1901, 1902, 1903, 1905, 1916, 1919, 1919,
2065 1948, 1948, 1968, 1968, 1985, 1986, 1987, 1988, 1996, 2005,
2066 2005, 2050, 2054, 2065, 2074, 2075, 2077, 2078, 2080, 2080,
2067 2082, 2082, 2085, 2093, 2103, 2104, 2105, 2106, 2108, 2109,
2068 2110, 2111, 2112, 2113, 2114, 2115, 2116, 2118, 2119, 2121,
2069 2122, 2124, 2125, 2129, 2127, 2135, 2133, 2141, 2142, 2143,
2070 2144, 2145, 2146, 2147, 2149, 2155, 2156, 2157, 2158, 2159,
2071 2160, 2163, 2175, 2175, 2177, 2236, 2237, 2239, 2240, 2241,
2072 2242, 2243, 2245, 2246, 2247, 2252, 2256, 2262, 2268, 2276,
2073 2281, 2287, 2295, 2303, 2304, 2305, 2308, 2307, 2321, 2322,
2074 2324, 2323, 2344, 2352, 2360, 2361, 2363, 2364, 2366, 2367,
2075 2368, 2377, 2378, 2382, 2383, 2385, 2386, 2387, 2390, 2395,
2076 2396, 2432, 2478, 2499, 2520, 2523, 2530, 2531, 2532, 2538,
2077 2544, 2546, 2548, 2550, 2552, 2554, 2556, 2573, 2578, 2581,
2078 2584, 2587, 2590, 2593, 2596, 2599, 2602, 2606, 2609, 2612,
2079 2615, 2618, 2621, 2624, 2627, 2631, 2642, 2660, 2665, 2670,
2080 2675, 2680, 2685, 2689, 2693, 2698, 2702, 2706, 2715, 2724,
2081 2734, 2739, 2751, 2757, 2762, 2768, 2774, 2778, 2780, 2791,
2082 2800, 2807, 2808, 2810, 2816, 2825, 2832, 2844, 2850, 2856,
2083 2862, 2868, 2874, 2880, 2893, 2904, 2911, 2924, 2951, 2965,
2084 2979, 2993, 3008, 3042, 3139, 3140, 3141, 3143
2088 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
2089 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
2090 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
2091 static const char *const yytname[] =
2093 "$end", "error", "$undefined", "T_IDENTIFIER", "T_STRING", "T_REGEXP",
2094 "T_EMPTY", "T_INT", "T_UINT", "T_BYTE", "T_SHORT", "T_FLOAT", "\"for\"",
2095 "\"while\"", "\"do\"", "\"switch\"", "\"implements\"", "\"namespace\"",
2096 "\"package\"", "\"protected\"", "\"public\"", "\"private\"", "\"use\"",
2097 "\"internal\"", "\"new\"", "\"native\"", "\"function\"", "\"finally\"",
2098 "\"undefined\"", "\"continue\"", "\"class\"", "\"const\"", "\"catch\"",
2099 "\"case\"", "\"set\"", "\"void\"", "\"throw\"", "\"static\"", "\"with\"",
2100 "\"instanceof\"", "\"import\"", "\"return\"", "\"typeof\"",
2101 "\"interface\"", "\"null\"", "\"var\"", "\"dynamic\"", "\"override\"",
2102 "\"final\"", "\"each\"", "\"get\"", "\"try\"", "\"super\"",
2103 "\"extends\"", "\"false\"", "\"true\"", "\"Boolean\"", "\"uint\"",
2104 "\"int\"", "\"Number\"", "\"String\"", "\"default\"", "\"delete\"",
2105 "\"if\"", "\"else\"", "\"break\"", "\"is\"", "\"in\"", "\"as\"",
2106 "\"==\"", "\"===\"", "\"!=\"", "\"!==\"", "\"<=\"", "\">=\"", "\"|=\"",
2107 "\"/=\"", "\"%=\"", "\"*=\"", "\"+=\"", "\"-=\"", "\">>=\"", "\"<<=\"",
2108 "\">>>=\"", "\"||\"", "\"&&\"", "\"::\"", "\"--\"", "\"++\"", "\"..\"",
2109 "\"...\"", "\"<<\"", "\">>>\"", "\">>\"", "prec_none", "below_semicolon",
2110 "';'", "','", "below_assignment", "'='", "\"&=\"", "\"^=\"", "'?'",
2111 "':'", "'|'", "'^'", "'&'", "'<'", "'>'", "below_minus", "'-'", "'+'",
2112 "'/'", "'*'", "'%'", "'~'", "'!'", "minusminus_prefix",
2113 "plusplus_prefix", "below_curly", "'('", "new2", "'['", "']'", "'{'",
2114 "'.'", "above_identifier", "below_else", "above_function", "'}'", "')'",
2115 "$accept", "PROGRAM", "MAYBE_PROGRAM_CODE_LIST", "PROGRAM_CODE_LIST",
2116 "PROGRAM_CODE", "MAYBE_INPACKAGE_CODE_LIST", "INPACKAGE_CODE_LIST",
2117 "INPACKAGE_CODE", "MAYBECODE", "CODE", "CODE_STATEMENT", "CODEPIECE",
2118 "CODEBLOCK", "PACKAGE_INITCODE", "MAYBEEXPRESSION",
2119 "VARIABLE_DECLARATION", "VARIABLE_LIST", "ONE_VARIABLE", "MAYBEELSE",
2120 "IF", "$@1", "FOR_INIT", "FOR_IN_INIT", "FOR_START", "FOR", "FOR_IN",
2121 "WHILE", "$@2", "DO_WHILE", "$@3", "BREAK", "CONTINUE",
2122 "MAYBE_CASE_LIST", "CASE_LIST", "CASE", "DEFAULT", "SWITCH", "$@4",
2123 "CATCH", "$@5", "FINALLY", "$@6", "CATCH_LIST", "CATCH_FINALLY_LIST",
2124 "TRY", "$@7", "THROW", "WITH", "X_IDENTIFIER", "PACKAGE",
2125 "PACKAGE_DECLARATION", "$@8", "$@9", "IMPORT", "MAYBE_MODIFIERS",
2126 "MODIFIER_LIST", "MODIFIER", "EXTENDS", "EXTENDS_LIST",
2127 "IMPLEMENTS_LIST", "CLASS_DECLARATION", "$@10", "INTERFACE_DECLARATION",
2128 "$@11", "MAYBE_CLASS_BODY", "CLASS_BODY", "CLASS_BODY_ITEM",
2129 "MAYBE_INTERFACE_BODY", "INTERFACE_BODY", "IDECLARATION", "VARCONST",
2130 "SLOT_DECLARATION", "MAYBESTATICCONSTANT", "STATICCONSTANT",
2131 "MAYBE_PARAM_LIST", "PARAM_LIST", "PARAM", "GETSET",
2132 "FUNCTION_DECLARATION", "$@12", "MAYBE_IDENTIFIER", "INNERFUNCTION",
2133 "$@13", "CLASS", "PACKAGEANDCLASS", "QNAME", "QNAME_LIST", "TYPE",
2134 "MAYBETYPE", "MAYBE_PARAM_VALUES", "MAYBE_EXPRESSION_LIST",
2135 "EXPRESSION_LIST", "XX", "NEW", "FUNCTIONCALL", "DELETE", "RETURN",
2136 "NONCOMMAEXPRESSION", "EXPRESSION", "VOIDEXPRESSION", "E", "CONSTANT",
2137 "MAYBE_EXPRPAIR_LIST", "EXPRPAIR_LIST", "VAR_READ",
2138 "NAMESPACE_DECLARATION", "USE_NAMESPACE", 0
2143 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
2145 static const yytype_uint16 yytoknum[] =
2147 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
2148 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
2149 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
2150 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
2151 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
2152 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
2153 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
2154 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
2155 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
2156 345, 346, 347, 348, 349, 350, 59, 44, 351, 61,
2157 352, 353, 63, 58, 124, 94, 38, 60, 62, 354,
2158 45, 43, 47, 42, 37, 126, 33, 355, 356, 357,
2159 40, 358, 91, 93, 123, 46, 359, 360, 361, 125,
2164 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2165 static const yytype_uint8 yyr1[] =
2167 0, 131, 132, 133, 133, 134, 134, 135, 135, 135,
2168 135, 135, 135, 135, 136, 136, 137, 137, 138, 138,
2169 138, 138, 138, 138, 139, 139, 140, 140, 141, 141,
2170 141, 141, 141, 141, 141, 141, 141, 141, 142, 142,
2171 142, 142, 142, 142, 142, 142, 142, 143, 143, 143,
2172 143, 144, 145, 145, 146, 146, 147, 147, 148, 149,
2173 149, 151, 150, 152, 152, 152, 153, 153, 154, 154,
2174 155, 156, 158, 157, 160, 159, 161, 161, 162, 162,
2175 163, 163, 163, 163, 164, 164, 165, 166, 168, 167,
2176 170, 169, 172, 171, 173, 173, 174, 174, 174, 176,
2177 175, 177, 177, 178, 179, 179, 180, 180, 182, 181,
2178 183, 181, 184, 184, 185, 185, 186, 186, 187, 187,
2179 187, 187, 187, 187, 187, 187, 187, 188, 188, 189,
2180 189, 190, 190, 192, 191, 194, 193, 195, 195, 196,
2181 196, 197, 197, 197, 197, 198, 198, 199, 199, 200,
2182 200, 200, 201, 201, 202, 203, 203, 204, 204, 204,
2183 204, 204, 204, 204, 204, 205, 205, 205, 205, 206,
2184 206, 207, 207, 208, 208, 208, 210, 209, 211, 211,
2185 213, 212, 214, 215, 216, 216, 217, 217, 218, 218,
2186 218, 219, 219, 220, 220, 221, 221, 222, 222, 223,
2187 224, 225, 225, 226, 227, 227, 228, 229, 229, 230,
2188 231, 231, 231, 231, 231, 231, 231, 232, 232, 232,
2189 232, 232, 232, 232, 232, 232, 232, 231, 231, 231,
2190 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
2191 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
2192 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
2193 231, 233, 233, 234, 234, 231, 231, 231, 231, 231,
2194 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
2195 231, 231, 231, 235, 236, 236, 236, 237
2198 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2199 static const yytype_uint8 yyr2[] =
2201 0, 2, 1, 0, 1, 1, 2, 1, 1, 1,
2202 1, 1, 1, 1, 0, 1, 1, 2, 1, 1,
2203 1, 1, 1, 1, 1, 0, 2, 1, 1, 1,
2204 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2205 1, 1, 1, 1, 1, 1, 1, 3, 2, 2,
2206 1, 1, 2, 0, 2, 2, 1, 3, 3, 0,
2207 2, 0, 7, 0, 1, 1, 3, 1, 2, 3,
2208 8, 6, 0, 6, 0, 7, 1, 2, 1, 2,
2209 0, 1, 1, 2, 1, 2, 4, 3, 0, 8,
2210 0, 9, 0, 5, 1, 2, 1, 2, 1, 0,
2211 6, 2, 1, 5, 1, 1, 3, 1, 0, 6,
2212 0, 5, 2, 4, 0, 1, 1, 2, 1, 1,
2213 1, 1, 1, 1, 1, 1, 1, 0, 2, 0,
2214 2, 0, 2, 0, 9, 0, 8, 0, 1, 1,
2215 2, 1, 1, 1, 1, 0, 1, 1, 2, 1,
2216 2, 8, 1, 1, 5, 0, 2, 1, 1, 1,
2217 1, 1, 1, 1, 1, 0, 1, 2, 4, 3,
2218 1, 4, 2, 1, 1, 0, 0, 12, 1, 0,
2219 0, 10, 1, 3, 1, 1, 1, 3, 1, 1,
2220 1, 2, 0, 0, 3, 0, 1, 1, 3, 0,
2221 4, 4, 4, 2, 1, 2, 1, 1, 3, 1,
2222 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2223 1, 1, 1, 1, 1, 1, 1, 3, 3, 3,
2224 3, 3, 3, 3, 3, 3, 3, 2, 2, 3,
2225 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2226 3, 3, 3, 3, 4, 2, 1, 3, 2, 4,
2227 3, 0, 1, 3, 5, 3, 3, 3, 3, 3,
2228 3, 3, 3, 3, 3, 3, 5, 2, 2, 2,
2229 2, 3, 3, 1, 3, 5, 5, 3
2232 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2233 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2234 means the default is an error. */
2235 static const yytype_uint16 yydefact[] =
2237 114, 283, 222, 216, 219, 220, 217, 218, 221, 0,
2238 0, 74, 0, 0, 120, 118, 119, 126, 0, 125,
2239 179, 223, 256, 121, 0, 0, 0, 226, 122, 124,
2240 123, 0, 0, 225, 224, 0, 0, 0, 0, 13,
2241 0, 0, 0, 0, 195, 261, 0, 2, 114, 5,
2242 51, 12, 34, 63, 29, 30, 31, 32, 33, 36,
2243 35, 7, 28, 0, 115, 116, 9, 8, 11, 10,
2244 210, 213, 215, 214, 209, 37, 207, 211, 212, 0,
2245 68, 72, 114, 88, 104, 105, 110, 107, 0, 199,
2246 178, 0, 255, 0, 182, 0, 185, 184, 112, 0,
2247 99, 195, 0, 203, 61, 280, 279, 258, 238, 237,
2248 0, 0, 196, 197, 206, 0, 0, 262, 1, 6,
2249 283, 0, 0, 64, 0, 0, 65, 175, 0, 153,
2250 0, 152, 0, 117, 0, 0, 0, 0, 0, 0,
2251 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2252 0, 0, 0, 0, 0, 0, 278, 277, 0, 0,
2253 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2254 0, 0, 0, 195, 0, 0, 69, 0, 0, 78,
2255 102, 204, 0, 76, 38, 114, 39, 50, 0, 40,
2256 41, 42, 44, 0, 43, 45, 46, 0, 114, 108,
2257 0, 193, 165, 0, 0, 0, 25, 0, 281, 0,
2258 257, 260, 0, 0, 265, 0, 192, 55, 56, 192,
2259 54, 0, 0, 174, 173, 0, 127, 129, 192, 208,
2260 252, 253, 250, 251, 231, 232, 234, 233, 229, 230,
2261 272, 271, 267, 266, 273, 274, 269, 268, 270, 235,
2262 236, 244, 243, 242, 275, 0, 241, 240, 239, 227,
2263 228, 248, 247, 245, 249, 246, 0, 0, 282, 0,
2264 0, 79, 101, 205, 77, 48, 114, 27, 207, 49,
2265 0, 0, 0, 23, 0, 114, 16, 22, 19, 18,
2266 21, 20, 114, 106, 195, 200, 155, 0, 0, 166,
2267 170, 114, 183, 113, 254, 0, 24, 202, 0, 198,
2268 263, 0, 0, 53, 0, 53, 0, 0, 0, 0,
2269 131, 0, 0, 53, 0, 201, 259, 114, 287, 47,
2270 26, 0, 284, 0, 111, 17, 0, 0, 0, 0,
2271 172, 167, 192, 0, 103, 0, 114, 0, 190, 189,
2272 0, 188, 191, 0, 58, 57, 0, 114, 165, 128,
2273 0, 0, 186, 130, 135, 154, 276, 73, 0, 0,
2274 80, 109, 194, 161, 158, 159, 157, 160, 164, 163,
2275 162, 156, 155, 0, 0, 169, 0, 0, 94, 98,
2276 96, 100, 59, 264, 0, 52, 0, 71, 0, 132,
2277 133, 0, 114, 75, 285, 286, 0, 0, 0, 81,
2278 84, 82, 171, 180, 168, 92, 0, 95, 97, 114,
2279 62, 114, 192, 114, 187, 0, 149, 0, 0, 114,
2280 147, 0, 25, 89, 85, 83, 25, 25, 192, 60,
2281 70, 0, 141, 144, 0, 0, 114, 139, 142, 143,
2282 150, 175, 136, 148, 25, 87, 0, 0, 0, 176,
2283 134, 140, 0, 86, 181, 93, 90, 25, 0, 0,
2284 0, 165, 25, 177, 0, 0, 192, 91, 151
2287 /* YYDEFGOTO[NTERM-NUM]. */
2288 static const yytype_int16 yydefgoto[] =
2290 -1, 46, 47, 48, 49, 284, 285, 286, 305, 306,
2291 186, 277, 188, 287, 354, 189, 220, 218, 420, 52,
2292 209, 124, 125, 53, 54, 55, 56, 177, 57, 82,
2293 190, 191, 408, 409, 410, 411, 58, 197, 388, 469,
2294 389, 437, 390, 391, 59, 206, 192, 60, 87, 350,
2295 61, 292, 198, 62, 193, 64, 65, 320, 322, 361,
2296 288, 423, 289, 402, 445, 446, 447, 428, 429, 430,
2297 132, 290, 340, 381, 298, 299, 300, 225, 291, 467,
2298 91, 70, 436, 96, 97, 351, 363, 352, 313, 295,
2299 111, 112, 201, 71, 72, 73, 194, 113, 74, 75,
2300 76, 77, 116, 117, 78, 195, 196
2303 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2305 #define YYPACT_NINF -352
2306 static const yytype_int16 yypact[] =
2308 1185, -352, -352, -352, -352, -352, -352, -352, -352, -34,
2309 -75, -352, -55, 39, -352, -352, -352, -352, 1740, -352,
2310 40, -352, 310, -352, -46, 103, -39, -352, -352, -352,
2311 -352, -24, -85, -352, -352, 1740, -16, 1740, 1740, -352,
2312 1740, 1740, 1740, 1740, 1740, 1740, 114, -352, 1308, -352,
2313 -352, -352, -352, 1647, -352, -352, -352, -352, -352, -352,
2314 -352, -352, -352, 258, 305, -352, -352, -352, -352, -352,
2315 -352, -352, -352, -352, 21, -352, 2183, -352, -352, 59,
2316 -352, -352, 1552, -352, -352, -352, -352, -352, -61, -86,
2317 -352, 61, -10, 1740, 62, 63, -352, -352, -352, 1740,
2318 -352, 1740, 180, -10, -352, -10, -10, 155, -10, -10,
2319 -78, 67, 87, -352, 2183, 88, 82, 113, -352, -352,
2320 150, 215, 219, -352, 127, 157, -352, 10, 223, -352,
2321 225, -352, 226, -352, 1740, 1740, 1740, 1740, 1740, 1740,
2322 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740,
2323 1740, 1740, 1740, 1740, 1740, 1740, -352, -352, 1740, 1740,
2324 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740, 1740,
2325 1740, 1740, 1740, 1740, 1740, 227, -352, 1740, 214, 232,
2326 1740, 1740, 215, 233, -352, 447, -352, 144, 231, -352,
2327 -352, -352, -352, 229, -352, -352, -352, 1740, 693, -352,
2328 162, 128, 11, -77, 58, 1799, 1430, 117, -352, 1740,
2329 -352, -352, 1740, 1740, -352, 1740, 148, 159, -352, 148,
2330 159, 1740, 1740, -352, -352, 249, 201, 204, 148, 2183,
2331 803, 685, 685, 685, 2544, 2544, 2544, 2544, 803, 803,
2332 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2183, 2244,
2333 2304, 151, 151, 151, 2183, 1939, 2364, 2424, 2484, 803,
2334 803, 155, 155, -10, -10, -10, 136, 2000, -352, -76,
2335 255, -352, 21, 21, -352, -352, 570, -352, 2061, -352,
2336 154, 267, 1869, -352, 152, 816, -352, -352, -352, -352,
2337 -352, -352, 693, -352, 1740, -352, 8, 284, 160, 194,
2338 -352, 1552, 62, -352, -352, 165, 1430, -352, -60, -352,
2339 -352, 192, 6, 197, 215, -11, 20, -50, 177, 103,
2340 283, 103, 178, 197, 1740, -352, -352, 1552, -352, -352,
2341 -352, 1740, 206, 182, -352, -352, 175, 179, 205, 6,
2342 -352, -352, 148, 13, -352, 81, 1552, 1740, -352, -352,
2343 185, -352, -352, 1740, -352, -352, 1740, 1552, 11, -352,
2344 103, 183, -352, 230, -352, -352, 2183, -352, -38, 172,
2345 29, -352, -352, -352, -352, -352, -352, -352, -352, -352,
2346 -352, -352, 212, 198, 284, -352, 199, 196, -352, -352,
2347 81, -352, 265, -352, 164, -352, 202, -352, 203, 230,
2348 -352, 103, 48, -352, -352, -352, 1740, 228, 208, 29,
2349 -352, -352, -352, -352, -352, -352, 341, -352, -352, 1552,
2350 -352, 1552, 148, 939, -352, 345, -352, 323, 221, 149,
2351 -352, 2122, 1430, -352, -352, -352, 1430, 1430, 148, -352,
2352 -352, 234, -352, -352, 53, 237, 1062, -352, -352, -352,
2353 -352, 10, -352, -352, 1430, -352, 238, 239, 240, -352,
2354 -352, -352, 352, -352, -352, -352, -352, 1430, 236, 235,
2355 242, 11, 1430, -352, 243, 245, 148, -352, -352
2358 /* YYPGOTO[NTERM-NUM]. */
2359 static const yytype_int16 yypgoto[] =
2361 -352, -352, -352, -352, 309, 68, -352, 76, -217, 184,
2362 1, -74, -255, 18, 49, 322, 256, 64, -352, -352,
2363 -352, -352, -352, -352, -352, -352, -352, -352, -352, -352,
2364 -352, -352, -352, -352, -33, -30, -352, -352, -27, -352,
2365 -9, -352, -352, -352, -352, -352, -352, -352, -187, 84,
2366 -352, -352, -352, -352, 0, -352, 318, -352, -352, -352,
2367 27, -352, 34, -352, -352, -352, -63, -352, -352, -45,
2368 -352, 2, 4, -352, -351, -352, -285, -66, 3, -352,
2369 -352, -352, -352, -352, -352, -21, 28, 50, -197, -352,
2370 -90, -352, -352, -352, -352, -352, -352, -7, 12, -48,
2371 -12, -352, -352, -352, -352, -352, -352
2374 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2375 positive, shift that token. If negative, reduce the rule which
2376 number is the opposite. If zero, do what YYDEFACT says.
2377 If YYTABLE_NINF, syntax error. */
2378 #define YYTABLE_NINF -207
2379 static const yytype_int16 yytable[] =
2381 63, 50, 68, 69, 98, 126, 89, 398, 187, 94,
2382 92, 207, 341, 293, 296, 79, 296, 293, 51, 134,
2383 134, 134, 315, 103, 85, 105, 106, 66, 107, 108,
2384 109, 323, 114, 114, 67, 101, 174, 134, 115, 175,
2385 102, 348, 84, 90, 223, 81, 344, 134, 63, 50,
2386 68, 69, 210, 301, 327, 110, -66, 85, 385, 134,
2387 224, 302, 406, 199, 200, 83, 51, 14, 15, 16,
2388 346, 17, 367, 19, 93, 66, 85, 156, 157, 127,
2389 357, 99, 67, 266, 129, 23, 80, 205, 353, 114,
2390 407, 392, 403, 425, 28, 29, 30, 88, 131, 414,
2391 100, 297, 397, 384, 104, 203, 94, 338, 386, 95,
2392 173, 339, 174, 387, 118, 175, 356, 134, 134, 349,
2393 474, 85, 229, 230, 231, 232, 233, 234, 235, 236,
2394 237, 238, 239, 240, 241, 242, 243, 244, 245, 246,
2395 247, 248, 249, 250, 426, 383, 251, 252, 253, 254,
2396 255, 256, 257, 258, 259, 260, 261, 262, 263, 264,
2397 265, 114, 267, 86, 439, 84, 440, 302, 14, 15,
2398 16, 303, 17, 278, 19, 404, 405, -145, 115, 176,
2399 85, 202, 85, 208, 212, 282, 23, -104, 204, 269,
2400 211, 213, 272, 273, 425, 28, 29, 30, 63, 50,
2401 114, 114, 330, 114, 337, 309, 310, 293, 311, 373,
2402 215, 214, 374, 375, 376, 455, 377, -67, 216, 456,
2403 457, 308, 219, 221, 222, 441, 226, 187, 227, 228,
2404 268, 270, 330, 316, 317, 271, 274, 463, 156, 157,
2405 279, 458, 156, 157, 280, 426, 281, 307, 294, 378,
2406 470, 312, 318, 187, 319, 475, 314, 321, 328, 379,
2407 380, 168, 169, 170, 171, 172, 325, 170, 171, 172,
2408 332, 173, 187, 174, 331, 173, 175, 174, -146, 478,
2409 175, 334, 114, 187, 127, 63, 50, 296, 128, 129,
2410 342, 343, 63, 50, 345, 347, 353, 358, 359, 360,
2411 362, 130, 364, 131, 371, 369, 370, 400, 396, 372,
2412 394, 338, 366, 1, 2, 3, 416, 4, 5, 6,
2413 7, 8, 413, 415, 14, 15, 16, 401, 17, 419,
2414 19, 432, 421, 422, 18, 114, 20, 433, 21, 362,
2415 393, 114, 23, 368, 438, 187, 395, 187, 450, 451,
2416 452, 28, 29, 30, 27, 468, 471, 119, 459, 472,
2417 336, 335, 32, 417, 33, 34, 460, 464, 465, 276,
2418 466, 473, 365, 476, 477, 123, 434, 217, 355, 435,
2419 424, 418, 133, 461, 453, 462, 412, 0, 399, 382,
2420 0, 0, 0, 0, 431, 0, 0, 37, 38, 0,
2421 0, 0, 427, 0, 0, 0, 0, 0, 0, 0,
2422 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2423 0, 0, 0, 444, 443, 448, 449, 0, 0, 427,
2424 43, 0, 44, 0, 45, 0, 0, 0, 0, 0,
2425 0, 0, 0, 0, 0, 0, 444, 443, 448, 449,
2426 1, 2, 3, 0, 4, 5, 6, 7, 8, 9,
2427 10, 11, 12, 0, 0, 0, 14, 15, 16, 178,
2428 17, 18, 19, 20, 0, 21, 179, 0, 121, 0,
2429 0, 0, 22, 180, 23, 24, 0, 25, 181, 26,
2430 0, 27, 182, 28, 29, 30, 0, 0, 31, 32,
2431 0, 33, 34, 0, 0, 0, 0, 0, 0, 35,
2432 36, 0, 183, 0, 0, 0, 0, 0, 0, 0,
2433 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2434 0, 0, 0, 0, 37, 38, 0, 0, 0, 0,
2435 0, 0, 0, 184, 0, 0, 0, 0, 0, 0,
2436 0, 0, 0, 0, 0, 0, 0, 40, 0, 0,
2437 0, 0, 41, 42, 0, 0, 0, 43, 0, 44,
2438 0, 45, 0, 1, 2, 3, 275, 4, 5, 6,
2439 7, 8, 9, 10, 11, 12, 0, 0, 0, 14,
2440 15, 16, 178, 17, 18, 19, 20, 0, 21, 179,
2441 0, 121, 0, 0, 0, 22, 180, 23, 24, 0,
2442 25, 181, 26, 0, 27, 182, 28, 29, 30, 0,
2443 0, 31, 32, 0, 33, 34, 0, 0, 0, 0,
2444 0, 0, 35, 36, 0, 183, 0, 0, 0, 0,
2445 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2446 0, 0, 0, 0, 0, 0, 0, 37, 38, 0,
2447 0, 0, 0, 0, 0, 0, 184, 0, 0, 0,
2448 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2449 40, 0, 0, 0, 0, 41, 42, 0, 0, 0,
2450 43, 0, 44, 0, 45, 0, 1, 2, 3, 329,
2451 4, 5, 6, 7, 8, 9, 10, 11, 12, 0,
2452 0, 0, 14, 15, 16, 0, 17, 18, 19, 0,
2453 0, 21, 0, 0, 135, 0, 0, 0, 22, 0,
2454 23, 24, 0, 25, 0, 26, 0, 27, 0, 28,
2455 29, 30, 0, 0, 31, 32, 0, 33, 34, 0,
2456 0, -207, -207, -207, 0, 35, 36, 0, 143, 144,
2457 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2458 0, 0, 156, 157, 0, 0, 158, 159, 160, 0,
2459 37, 38, 0, 0, 0, 0, 0, 0, 0, 283,
2460 0, 0, 166, 167, 0, 168, 169, 170, 171, 172,
2461 0, 0, 0, 40, 0, 173, 0, 174, 41, 42,
2462 175, 0, 0, 43, 0, 44, 0, 45, 0, 1,
2463 2, 3, -14, 4, 5, 6, 7, 8, 9, 10,
2464 11, 12, 0, 0, 0, 14, 15, 16, 0, 17,
2465 18, 19, -207, 0, 21, 0, 0, 0, 0, 0,
2466 0, 22, 0, 23, 24, 0, 25, 0, 26, 0,
2467 27, 0, 28, 29, 30, 0, 0, 31, 32, 0,
2468 33, 34, 0, 0, 0, 0, -207, -207, 35, 36,
2469 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2470 156, 157, 0, 0, 158, 159, 160, 0, 0, 0,
2471 0, 0, 0, 37, 38, 0, 0, 0, 0, 0,
2472 -207, -207, 283, 168, 169, 170, 171, 172, 0, 0,
2473 0, 0, 0, 173, 0, 174, 40, 0, 175, 0,
2474 0, 41, 42, 0, 0, 0, 43, 0, 44, 0,
2475 45, 0, 1, 2, 3, -15, 4, 5, 6, 7,
2476 8, 9, 10, 11, 12, 0, 0, 0, 14, 15,
2477 16, 0, 17, 18, 19, 0, 0, 21, 0, 0,
2478 0, 0, 0, 0, 22, 0, 23, 24, 0, 25,
2479 0, 26, 0, 27, 0, 28, 29, 30, 0, 0,
2480 31, 32, 0, 33, 34, 0, 0, 0, 0, 0,
2481 0, 35, 36, 0, 0, 0, 0, 0, 0, 0,
2482 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2483 0, 0, 0, 0, 0, 0, 37, 38, 0, 0,
2484 0, 0, 0, 0, 0, 442, 0, 0, 0, 0,
2485 0, 0, 0, 0, 0, 0, 0, 0, 0, 40,
2486 0, 0, 0, 0, 41, 42, 0, 0, 0, 43,
2487 0, 44, 0, 45, 0, 1, 2, 3, -137, 4,
2488 5, 6, 7, 8, 9, 10, 11, 12, 0, 0,
2489 0, 14, 15, 16, 0, 17, 18, 19, 0, 0,
2490 21, 0, 0, 0, 0, 0, 0, 22, 0, 23,
2491 24, 0, 25, 0, 26, 0, 27, 0, 28, 29,
2492 30, 0, 0, 31, 32, 0, 33, 34, 0, 0,
2493 0, 0, 0, 0, 35, 36, 0, 0, 0, 0,
2494 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2495 0, 0, 0, 0, 0, 0, 0, 0, 0, 37,
2496 38, 0, 0, 0, 0, 0, 0, 0, 442, 0,
2497 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2498 0, 0, 40, 0, 0, 0, 0, 41, 42, 0,
2499 0, 0, 43, 0, 44, -3, 45, 0, 1, 2,
2500 3, -138, 4, 5, 6, 7, 8, 9, 10, 11,
2501 12, 0, 0, 13, 14, 15, 16, 0, 17, 18,
2502 19, 0, 0, 21, 0, 0, 0, 0, 0, 0,
2503 22, 0, 23, 24, 0, 25, 0, 26, 0, 27,
2504 0, 28, 29, 30, 0, 0, 31, 32, 0, 33,
2505 34, 0, 0, 0, 0, 0, 0, 35, 36, 0,
2506 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2507 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2508 0, 0, 37, 38, 0, 0, 0, 0, 0, 0,
2509 0, 39, 0, 0, 0, 0, 0, 0, 0, 0,
2510 0, 0, 0, 0, 0, 40, 0, 0, 0, 0,
2511 41, 42, 0, 0, 0, 43, 0, 44, -4, 45,
2512 0, 1, 2, 3, 0, 4, 5, 6, 7, 8,
2513 9, 10, 11, 12, 0, 0, 13, 14, 15, 16,
2514 0, 17, 18, 19, 0, 0, 21, 0, 0, 0,
2515 0, 0, 0, 22, 0, 23, 24, 0, 25, 0,
2516 26, 0, 27, 0, 28, 29, 30, 0, 0, 31,
2517 32, 0, 33, 34, 0, 0, 0, 0, 0, 0,
2518 35, 36, 0, 0, 0, 0, 0, 0, 0, 0,
2519 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2520 0, 0, 0, 0, 0, 37, 38, 0, 0, 0,
2521 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
2522 0, 0, 0, 0, 0, 0, 0, 0, 40, 0,
2523 0, 0, 0, 41, 42, 0, 0, 0, 43, 0,
2524 44, 0, 45, 1, 2, 3, 0, 4, 5, 6,
2525 7, 8, 9, 10, 11, 12, 0, -114, 0, 14,
2526 15, 16, 178, 17, 18, 19, 20, 0, 21, 179,
2527 0, 121, 0, 0, 0, 22, 180, 23, 24, 0,
2528 25, 181, 26, 0, 27, 182, 28, 29, 30, 0,
2529 0, 31, 32, 0, 33, 34, 0, 0, 0, 0,
2530 0, 0, 35, 36, 0, 183, 0, 0, 0, 0,
2531 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2532 0, 0, 0, 0, 0, 0, 0, 37, 38, 0,
2533 0, 0, 0, 0, 0, 0, 184, 0, 0, 0,
2534 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2535 40, 0, 0, 0, 0, 41, 42, 0, 0, 0,
2536 43, 0, 44, 0, 45, 1, 2, 3, 0, 4,
2537 5, 6, 7, 8, 9, 10, 11, 12, 0, 0,
2538 0, 14, 15, 16, 178, 17, 18, 19, 20, 0,
2539 21, 179, 0, 121, 0, 0, 0, 22, 180, 23,
2540 24, 0, 25, 181, 26, 0, 27, 182, 28, 29,
2541 30, 0, 0, 31, 32, 0, 33, 34, 0, 0,
2542 0, 0, 0, 0, 35, 36, 0, 183, 0, 0,
2543 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2544 0, 0, 0, 0, 0, 0, 0, 0, 0, 37,
2545 38, 0, 0, 0, 0, 0, 0, 0, 184, 0,
2546 120, 2, 3, 0, 4, 5, 6, 7, 8, 0,
2547 0, 0, 40, 0, 0, 0, 0, 41, 42, 0,
2548 0, 18, 43, 20, 44, 21, 185, 0, 121, 0,
2549 0, 0, 22, 0, 0, 0, 0, 0, 0, 26,
2550 0, 27, 122, 0, 0, 0, 0, 0, 0, 32,
2551 0, 33, 34, 0, 0, 0, 0, 0, 0, 35,
2552 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2553 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2554 0, 0, 0, 0, 37, 38, 0, 0, 0, 0,
2555 0, 0, 0, 1, 2, 3, 0, 4, 5, 6,
2556 7, 8, 0, 0, 0, 0, 0, 40, 0, 0,
2557 0, 0, 41, 42, 18, 0, 20, 43, 21, 44,
2558 0, 45, 0, 0, 0, 22, 0, 0, 0, 0,
2559 0, 0, 26, 0, 27, 0, 0, 0, 0, 0,
2560 0, 0, 32, 0, 33, 34, 0, 0, 0, 0,
2561 0, 0, 35, 0, 0, 0, 0, 0, 0, 0,
2562 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2563 0, 0, 0, 0, 0, 0, 0, 37, 38, 0,
2564 0, 0, 0, 0, 0, 0, 0, 0, 135, 0,
2565 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2566 40, 0, 0, 0, 0, 41, 42, 0, 0, 0,
2567 43, 0, 44, 0, 45, 136, 137, 138, 139, 140,
2568 141, 142, 143, 144, 145, 146, 147, 148, 149, 150,
2569 151, 152, 153, 154, 155, 0, 156, 157, 0, 0,
2570 158, 159, 160, 0, 0, 0, 0, 0, 161, 0,
2571 0, 162, 0, 163, 164, 165, 166, 167, 135, 168,
2572 169, 170, 171, 172, 0, 0, 0, 0, 0, 173,
2573 0, 174, 0, 0, 175, 0, 0, 0, 0, 304,
2574 0, 0, 0, 0, 0, 136, 137, 138, 139, 140,
2575 141, 142, 143, 144, 145, 146, 147, 148, 149, 150,
2576 151, 152, 153, 154, 155, 0, 156, 157, 0, 0,
2577 158, 159, 160, 0, 0, 0, 0, 0, 161, 0,
2578 0, 162, 0, 163, 164, 165, 166, 167, 135, 168,
2579 169, 170, 171, 172, 0, 0, 0, 0, 0, 173,
2580 0, 174, 0, 0, 175, 0, 0, 0, 0, 333,
2581 0, 0, 0, 0, 0, 136, 137, 138, 139, 140,
2582 141, 142, 143, 144, 145, 146, 147, 148, 149, 150,
2583 151, 152, 153, 154, 155, 0, 156, 157, 0, 0,
2584 158, 159, 160, 0, 0, 0, 0, 0, 161, 135,
2585 0, 162, 324, 163, 164, 165, 166, 167, 0, 168,
2586 169, 170, 171, 172, 0, 0, 0, 0, 0, 173,
2587 0, 174, 0, 0, 175, 0, 136, 137, 138, 139,
2588 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
2589 150, 151, 152, 153, 154, 155, 0, 156, 157, 0,
2590 0, 158, 159, 160, 0, 0, 0, 0, 0, 161,
2591 135, 0, 162, 0, 163, 164, 165, 166, 167, 0,
2592 168, 169, 170, 171, 172, 0, 0, 0, 0, 0,
2593 173, 0, 174, 326, 0, 175, 0, 136, 137, 138,
2594 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
2595 149, 150, 151, 152, 153, 154, 155, 0, 156, 157,
2596 0, 0, 158, 159, 160, 0, 0, 0, 0, 0,
2597 161, 135, 0, 162, -206, 163, 164, 165, 166, 167,
2598 0, 168, 169, 170, 171, 172, 0, 0, 0, 0,
2599 0, 173, 0, 174, 0, 0, 175, 0, 136, 137,
2600 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
2601 148, 149, 150, 151, 152, 153, 154, 155, 0, 156,
2602 157, 0, 0, 158, 159, 160, 0, 0, 0, 0,
2603 0, 161, 135, 0, 162, 454, 163, 164, 165, 166,
2604 167, 0, 168, 169, 170, 171, 172, 0, 0, 0,
2605 0, 0, 173, 0, 174, 0, 0, 175, 0, 136,
2606 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
2607 147, 148, 149, 150, 151, 152, 153, 154, 155, 0,
2608 156, 157, 0, 0, 158, 159, 160, 0, 0, 0,
2609 0, 0, 161, 135, 0, 162, 0, 163, 164, 165,
2610 166, 167, 0, 168, 169, 170, 171, 172, 0, 0,
2611 0, 0, 0, 173, 0, 174, 0, 0, 175, 0,
2612 136, 137, 138, 139, 140, 141, 142, 143, 144, 0,
2613 0, 0, 0, 0, 0, 0, 0, 0, 0, 155,
2614 0, 156, 157, 0, 0, 158, 159, 160, 0, 0,
2615 0, 0, 0, 135, 0, 0, 0, 0, 163, 164,
2616 165, 166, 167, 0, 168, 169, 170, 171, 172, 0,
2617 0, 0, 0, 0, 173, 0, 174, 0, 0, 175,
2618 136, 137, 138, 139, 140, 141, 142, 143, 144, 0,
2619 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2620 0, 156, 157, 0, 0, 158, 159, 160, 0, 0,
2621 0, 0, 0, 135, 0, 0, 0, 0, 163, 164,
2622 165, 166, 167, 0, 168, 169, 170, 171, 172, 0,
2623 0, 0, 0, 0, 173, 0, 174, 0, 0, 175,
2624 136, 137, 138, 139, 140, 141, 142, 143, 144, 0,
2625 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2626 0, 156, 157, 0, 0, 158, 159, 160, 0, 0,
2627 0, 0, 0, 135, 0, 0, 0, 0, 0, 164,
2628 165, 166, 167, 0, 168, 169, 170, 171, 172, 0,
2629 0, 0, 0, 0, 173, 0, 174, 0, 0, 175,
2630 136, 137, 138, 139, 140, 141, 142, 143, 144, 0,
2631 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2632 0, 156, 157, 0, 0, 158, 159, 160, 0, 0,
2633 0, 0, 0, 135, 0, 0, 0, 0, 0, 0,
2634 165, 166, 167, 0, 168, 169, 170, 171, 172, 0,
2635 0, 0, 0, 0, 173, 0, 174, 0, 0, 175,
2636 136, 137, 138, 139, 140, 141, 142, 143, 144, 0,
2637 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2638 0, 156, 157, 0, 0, 158, 159, 160, 0, 0,
2639 0, 0, 0, 135, 0, 0, 0, 0, 0, 0,
2640 -207, 166, 167, 0, 168, 169, 170, 171, 172, 0,
2641 0, 0, 0, 0, 173, 0, 174, 0, 0, 175,
2642 136, 137, 138, -207, -207, -207, -207, 143, 144, 0,
2643 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2644 0, 156, 157, 0, 0, 158, 159, 160, 0, 0,
2645 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2646 0, 166, 167, 0, 168, 169, 170, 171, 172, 0,
2647 0, 0, 0, 0, 173, 0, 174, 0, 0, 175
2650 static const yytype_int16 yycheck[] =
2652 0, 0, 0, 0, 25, 53, 18, 358, 82, 3,
2653 22, 101, 297, 200, 3, 49, 3, 204, 0, 97,
2654 97, 97, 219, 35, 18, 37, 38, 0, 40, 41,
2655 42, 228, 44, 45, 0, 120, 122, 97, 45, 125,
2656 125, 35, 3, 3, 34, 120, 301, 97, 48, 48,
2657 48, 48, 130, 130, 130, 43, 67, 18, 343, 97,
2658 50, 3, 33, 124, 125, 120, 48, 19, 20, 21,
2659 130, 23, 327, 25, 120, 48, 18, 87, 88, 26,
2660 130, 120, 48, 173, 31, 37, 120, 99, 99, 101,
2661 61, 346, 130, 45, 46, 47, 48, 13, 45, 384,
2662 124, 90, 357, 90, 120, 93, 3, 99, 27, 25,
2663 120, 103, 122, 32, 0, 125, 96, 97, 97, 113,
2664 471, 18, 134, 135, 136, 137, 138, 139, 140, 141,
2665 142, 143, 144, 145, 146, 147, 148, 149, 150, 151,
2666 152, 153, 154, 155, 96, 342, 158, 159, 160, 161,
2667 162, 163, 164, 165, 166, 167, 168, 169, 170, 171,
2668 172, 173, 174, 124, 419, 3, 421, 3, 19, 20,
2669 21, 113, 23, 185, 25, 3, 4, 129, 185, 120,
2670 18, 120, 18, 3, 97, 197, 37, 125, 125, 177,
2671 123, 103, 180, 181, 45, 46, 47, 48, 198, 198,
2672 212, 213, 276, 215, 294, 212, 213, 394, 215, 4,
2673 97, 129, 7, 8, 9, 432, 11, 67, 3, 436,
2674 437, 209, 3, 96, 67, 422, 3, 301, 3, 3,
2675 3, 17, 306, 221, 222, 3, 3, 454, 87, 88,
2676 96, 438, 87, 88, 13, 96, 17, 130, 120, 44,
2677 467, 103, 3, 327, 53, 472, 97, 53, 3, 54,
2678 55, 110, 111, 112, 113, 114, 130, 112, 113, 114,
2679 3, 120, 346, 122, 120, 120, 125, 122, 129, 476,
2680 125, 129, 294, 357, 26, 285, 285, 3, 30, 31,
2681 130, 97, 292, 292, 129, 103, 99, 120, 319, 16,
2682 321, 43, 124, 45, 129, 99, 124, 124, 356, 130,
2683 125, 99, 324, 3, 4, 5, 120, 7, 8, 9,
2684 10, 11, 124, 124, 19, 20, 21, 97, 23, 64,
2685 25, 103, 130, 130, 24, 347, 26, 129, 28, 360,
2686 347, 353, 37, 331, 3, 419, 353, 421, 3, 26,
2687 129, 46, 47, 48, 44, 3, 120, 48, 124, 124,
2688 292, 285, 52, 390, 54, 55, 129, 129, 129, 185,
2689 130, 129, 323, 130, 129, 53, 409, 121, 314, 409,
2690 401, 390, 64, 446, 429, 451, 382, -1, 360, 339,
2691 -1, -1, -1, -1, 406, -1, -1, 87, 88, -1,
2692 -1, -1, 402, -1, -1, -1, -1, -1, -1, -1,
2693 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2694 -1, -1, -1, 423, 423, 423, 423, -1, -1, 429,
2695 120, -1, 122, -1, 124, -1, -1, -1, -1, -1,
2696 -1, -1, -1, -1, -1, -1, 446, 446, 446, 446,
2697 3, 4, 5, -1, 7, 8, 9, 10, 11, 12,
2698 13, 14, 15, -1, -1, -1, 19, 20, 21, 22,
2699 23, 24, 25, 26, -1, 28, 29, -1, 31, -1,
2700 -1, -1, 35, 36, 37, 38, -1, 40, 41, 42,
2701 -1, 44, 45, 46, 47, 48, -1, -1, 51, 52,
2702 -1, 54, 55, -1, -1, -1, -1, -1, -1, 62,
2703 63, -1, 65, -1, -1, -1, -1, -1, -1, -1,
2704 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2705 -1, -1, -1, -1, 87, 88, -1, -1, -1, -1,
2706 -1, -1, -1, 96, -1, -1, -1, -1, -1, -1,
2707 -1, -1, -1, -1, -1, -1, -1, 110, -1, -1,
2708 -1, -1, 115, 116, -1, -1, -1, 120, -1, 122,
2709 -1, 124, -1, 3, 4, 5, 129, 7, 8, 9,
2710 10, 11, 12, 13, 14, 15, -1, -1, -1, 19,
2711 20, 21, 22, 23, 24, 25, 26, -1, 28, 29,
2712 -1, 31, -1, -1, -1, 35, 36, 37, 38, -1,
2713 40, 41, 42, -1, 44, 45, 46, 47, 48, -1,
2714 -1, 51, 52, -1, 54, 55, -1, -1, -1, -1,
2715 -1, -1, 62, 63, -1, 65, -1, -1, -1, -1,
2716 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2717 -1, -1, -1, -1, -1, -1, -1, 87, 88, -1,
2718 -1, -1, -1, -1, -1, -1, 96, -1, -1, -1,
2719 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2720 110, -1, -1, -1, -1, 115, 116, -1, -1, -1,
2721 120, -1, 122, -1, 124, -1, 3, 4, 5, 129,
2722 7, 8, 9, 10, 11, 12, 13, 14, 15, -1,
2723 -1, -1, 19, 20, 21, -1, 23, 24, 25, -1,
2724 -1, 28, -1, -1, 39, -1, -1, -1, 35, -1,
2725 37, 38, -1, 40, -1, 42, -1, 44, -1, 46,
2726 47, 48, -1, -1, 51, 52, -1, 54, 55, -1,
2727 -1, 66, 67, 68, -1, 62, 63, -1, 73, 74,
2728 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2729 -1, -1, 87, 88, -1, -1, 91, 92, 93, -1,
2730 87, 88, -1, -1, -1, -1, -1, -1, -1, 96,
2731 -1, -1, 107, 108, -1, 110, 111, 112, 113, 114,
2732 -1, -1, -1, 110, -1, 120, -1, 122, 115, 116,
2733 125, -1, -1, 120, -1, 122, -1, 124, -1, 3,
2734 4, 5, 129, 7, 8, 9, 10, 11, 12, 13,
2735 14, 15, -1, -1, -1, 19, 20, 21, -1, 23,
2736 24, 25, 39, -1, 28, -1, -1, -1, -1, -1,
2737 -1, 35, -1, 37, 38, -1, 40, -1, 42, -1,
2738 44, -1, 46, 47, 48, -1, -1, 51, 52, -1,
2739 54, 55, -1, -1, -1, -1, 73, 74, 62, 63,
2740 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2741 87, 88, -1, -1, 91, 92, 93, -1, -1, -1,
2742 -1, -1, -1, 87, 88, -1, -1, -1, -1, -1,
2743 107, 108, 96, 110, 111, 112, 113, 114, -1, -1,
2744 -1, -1, -1, 120, -1, 122, 110, -1, 125, -1,
2745 -1, 115, 116, -1, -1, -1, 120, -1, 122, -1,
2746 124, -1, 3, 4, 5, 129, 7, 8, 9, 10,
2747 11, 12, 13, 14, 15, -1, -1, -1, 19, 20,
2748 21, -1, 23, 24, 25, -1, -1, 28, -1, -1,
2749 -1, -1, -1, -1, 35, -1, 37, 38, -1, 40,
2750 -1, 42, -1, 44, -1, 46, 47, 48, -1, -1,
2751 51, 52, -1, 54, 55, -1, -1, -1, -1, -1,
2752 -1, 62, 63, -1, -1, -1, -1, -1, -1, -1,
2753 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2754 -1, -1, -1, -1, -1, -1, 87, 88, -1, -1,
2755 -1, -1, -1, -1, -1, 96, -1, -1, -1, -1,
2756 -1, -1, -1, -1, -1, -1, -1, -1, -1, 110,
2757 -1, -1, -1, -1, 115, 116, -1, -1, -1, 120,
2758 -1, 122, -1, 124, -1, 3, 4, 5, 129, 7,
2759 8, 9, 10, 11, 12, 13, 14, 15, -1, -1,
2760 -1, 19, 20, 21, -1, 23, 24, 25, -1, -1,
2761 28, -1, -1, -1, -1, -1, -1, 35, -1, 37,
2762 38, -1, 40, -1, 42, -1, 44, -1, 46, 47,
2763 48, -1, -1, 51, 52, -1, 54, 55, -1, -1,
2764 -1, -1, -1, -1, 62, 63, -1, -1, -1, -1,
2765 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2766 -1, -1, -1, -1, -1, -1, -1, -1, -1, 87,
2767 88, -1, -1, -1, -1, -1, -1, -1, 96, -1,
2768 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2769 -1, -1, 110, -1, -1, -1, -1, 115, 116, -1,
2770 -1, -1, 120, -1, 122, 0, 124, -1, 3, 4,
2771 5, 129, 7, 8, 9, 10, 11, 12, 13, 14,
2772 15, -1, -1, 18, 19, 20, 21, -1, 23, 24,
2773 25, -1, -1, 28, -1, -1, -1, -1, -1, -1,
2774 35, -1, 37, 38, -1, 40, -1, 42, -1, 44,
2775 -1, 46, 47, 48, -1, -1, 51, 52, -1, 54,
2776 55, -1, -1, -1, -1, -1, -1, 62, 63, -1,
2777 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2778 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2779 -1, -1, 87, 88, -1, -1, -1, -1, -1, -1,
2780 -1, 96, -1, -1, -1, -1, -1, -1, -1, -1,
2781 -1, -1, -1, -1, -1, 110, -1, -1, -1, -1,
2782 115, 116, -1, -1, -1, 120, -1, 122, 0, 124,
2783 -1, 3, 4, 5, -1, 7, 8, 9, 10, 11,
2784 12, 13, 14, 15, -1, -1, 18, 19, 20, 21,
2785 -1, 23, 24, 25, -1, -1, 28, -1, -1, -1,
2786 -1, -1, -1, 35, -1, 37, 38, -1, 40, -1,
2787 42, -1, 44, -1, 46, 47, 48, -1, -1, 51,
2788 52, -1, 54, 55, -1, -1, -1, -1, -1, -1,
2789 62, 63, -1, -1, -1, -1, -1, -1, -1, -1,
2790 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2791 -1, -1, -1, -1, -1, 87, 88, -1, -1, -1,
2792 -1, -1, -1, -1, 96, -1, -1, -1, -1, -1,
2793 -1, -1, -1, -1, -1, -1, -1, -1, 110, -1,
2794 -1, -1, -1, 115, 116, -1, -1, -1, 120, -1,
2795 122, -1, 124, 3, 4, 5, -1, 7, 8, 9,
2796 10, 11, 12, 13, 14, 15, -1, 17, -1, 19,
2797 20, 21, 22, 23, 24, 25, 26, -1, 28, 29,
2798 -1, 31, -1, -1, -1, 35, 36, 37, 38, -1,
2799 40, 41, 42, -1, 44, 45, 46, 47, 48, -1,
2800 -1, 51, 52, -1, 54, 55, -1, -1, -1, -1,
2801 -1, -1, 62, 63, -1, 65, -1, -1, -1, -1,
2802 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2803 -1, -1, -1, -1, -1, -1, -1, 87, 88, -1,
2804 -1, -1, -1, -1, -1, -1, 96, -1, -1, -1,
2805 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2806 110, -1, -1, -1, -1, 115, 116, -1, -1, -1,
2807 120, -1, 122, -1, 124, 3, 4, 5, -1, 7,
2808 8, 9, 10, 11, 12, 13, 14, 15, -1, -1,
2809 -1, 19, 20, 21, 22, 23, 24, 25, 26, -1,
2810 28, 29, -1, 31, -1, -1, -1, 35, 36, 37,
2811 38, -1, 40, 41, 42, -1, 44, 45, 46, 47,
2812 48, -1, -1, 51, 52, -1, 54, 55, -1, -1,
2813 -1, -1, -1, -1, 62, 63, -1, 65, -1, -1,
2814 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2815 -1, -1, -1, -1, -1, -1, -1, -1, -1, 87,
2816 88, -1, -1, -1, -1, -1, -1, -1, 96, -1,
2817 3, 4, 5, -1, 7, 8, 9, 10, 11, -1,
2818 -1, -1, 110, -1, -1, -1, -1, 115, 116, -1,
2819 -1, 24, 120, 26, 122, 28, 124, -1, 31, -1,
2820 -1, -1, 35, -1, -1, -1, -1, -1, -1, 42,
2821 -1, 44, 45, -1, -1, -1, -1, -1, -1, 52,
2822 -1, 54, 55, -1, -1, -1, -1, -1, -1, 62,
2823 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2824 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2825 -1, -1, -1, -1, 87, 88, -1, -1, -1, -1,
2826 -1, -1, -1, 3, 4, 5, -1, 7, 8, 9,
2827 10, 11, -1, -1, -1, -1, -1, 110, -1, -1,
2828 -1, -1, 115, 116, 24, -1, 26, 120, 28, 122,
2829 -1, 124, -1, -1, -1, 35, -1, -1, -1, -1,
2830 -1, -1, 42, -1, 44, -1, -1, -1, -1, -1,
2831 -1, -1, 52, -1, 54, 55, -1, -1, -1, -1,
2832 -1, -1, 62, -1, -1, -1, -1, -1, -1, -1,
2833 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2834 -1, -1, -1, -1, -1, -1, -1, 87, 88, -1,
2835 -1, -1, -1, -1, -1, -1, -1, -1, 39, -1,
2836 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2837 110, -1, -1, -1, -1, 115, 116, -1, -1, -1,
2838 120, -1, 122, -1, 124, 66, 67, 68, 69, 70,
2839 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
2840 81, 82, 83, 84, 85, -1, 87, 88, -1, -1,
2841 91, 92, 93, -1, -1, -1, -1, -1, 99, -1,
2842 -1, 102, -1, 104, 105, 106, 107, 108, 39, 110,
2843 111, 112, 113, 114, -1, -1, -1, -1, -1, 120,
2844 -1, 122, -1, -1, 125, -1, -1, -1, -1, 130,
2845 -1, -1, -1, -1, -1, 66, 67, 68, 69, 70,
2846 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
2847 81, 82, 83, 84, 85, -1, 87, 88, -1, -1,
2848 91, 92, 93, -1, -1, -1, -1, -1, 99, -1,
2849 -1, 102, -1, 104, 105, 106, 107, 108, 39, 110,
2850 111, 112, 113, 114, -1, -1, -1, -1, -1, 120,
2851 -1, 122, -1, -1, 125, -1, -1, -1, -1, 130,
2852 -1, -1, -1, -1, -1, 66, 67, 68, 69, 70,
2853 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
2854 81, 82, 83, 84, 85, -1, 87, 88, -1, -1,
2855 91, 92, 93, -1, -1, -1, -1, -1, 99, 39,
2856 -1, 102, 103, 104, 105, 106, 107, 108, -1, 110,
2857 111, 112, 113, 114, -1, -1, -1, -1, -1, 120,
2858 -1, 122, -1, -1, 125, -1, 66, 67, 68, 69,
2859 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
2860 80, 81, 82, 83, 84, 85, -1, 87, 88, -1,
2861 -1, 91, 92, 93, -1, -1, -1, -1, -1, 99,
2862 39, -1, 102, -1, 104, 105, 106, 107, 108, -1,
2863 110, 111, 112, 113, 114, -1, -1, -1, -1, -1,
2864 120, -1, 122, 123, -1, 125, -1, 66, 67, 68,
2865 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
2866 79, 80, 81, 82, 83, 84, 85, -1, 87, 88,
2867 -1, -1, 91, 92, 93, -1, -1, -1, -1, -1,
2868 99, 39, -1, 102, 103, 104, 105, 106, 107, 108,
2869 -1, 110, 111, 112, 113, 114, -1, -1, -1, -1,
2870 -1, 120, -1, 122, -1, -1, 125, -1, 66, 67,
2871 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
2872 78, 79, 80, 81, 82, 83, 84, 85, -1, 87,
2873 88, -1, -1, 91, 92, 93, -1, -1, -1, -1,
2874 -1, 99, 39, -1, 102, 103, 104, 105, 106, 107,
2875 108, -1, 110, 111, 112, 113, 114, -1, -1, -1,
2876 -1, -1, 120, -1, 122, -1, -1, 125, -1, 66,
2877 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
2878 77, 78, 79, 80, 81, 82, 83, 84, 85, -1,
2879 87, 88, -1, -1, 91, 92, 93, -1, -1, -1,
2880 -1, -1, 99, 39, -1, 102, -1, 104, 105, 106,
2881 107, 108, -1, 110, 111, 112, 113, 114, -1, -1,
2882 -1, -1, -1, 120, -1, 122, -1, -1, 125, -1,
2883 66, 67, 68, 69, 70, 71, 72, 73, 74, -1,
2884 -1, -1, -1, -1, -1, -1, -1, -1, -1, 85,
2885 -1, 87, 88, -1, -1, 91, 92, 93, -1, -1,
2886 -1, -1, -1, 39, -1, -1, -1, -1, 104, 105,
2887 106, 107, 108, -1, 110, 111, 112, 113, 114, -1,
2888 -1, -1, -1, -1, 120, -1, 122, -1, -1, 125,
2889 66, 67, 68, 69, 70, 71, 72, 73, 74, -1,
2890 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2891 -1, 87, 88, -1, -1, 91, 92, 93, -1, -1,
2892 -1, -1, -1, 39, -1, -1, -1, -1, 104, 105,
2893 106, 107, 108, -1, 110, 111, 112, 113, 114, -1,
2894 -1, -1, -1, -1, 120, -1, 122, -1, -1, 125,
2895 66, 67, 68, 69, 70, 71, 72, 73, 74, -1,
2896 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2897 -1, 87, 88, -1, -1, 91, 92, 93, -1, -1,
2898 -1, -1, -1, 39, -1, -1, -1, -1, -1, 105,
2899 106, 107, 108, -1, 110, 111, 112, 113, 114, -1,
2900 -1, -1, -1, -1, 120, -1, 122, -1, -1, 125,
2901 66, 67, 68, 69, 70, 71, 72, 73, 74, -1,
2902 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2903 -1, 87, 88, -1, -1, 91, 92, 93, -1, -1,
2904 -1, -1, -1, 39, -1, -1, -1, -1, -1, -1,
2905 106, 107, 108, -1, 110, 111, 112, 113, 114, -1,
2906 -1, -1, -1, -1, 120, -1, 122, -1, -1, 125,
2907 66, 67, 68, 69, 70, 71, 72, 73, 74, -1,
2908 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2909 -1, 87, 88, -1, -1, 91, 92, 93, -1, -1,
2910 -1, -1, -1, 39, -1, -1, -1, -1, -1, -1,
2911 106, 107, 108, -1, 110, 111, 112, 113, 114, -1,
2912 -1, -1, -1, -1, 120, -1, 122, -1, -1, 125,
2913 66, 67, 68, 69, 70, 71, 72, 73, 74, -1,
2914 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2915 -1, 87, 88, -1, -1, 91, 92, 93, -1, -1,
2916 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2917 -1, 107, 108, -1, 110, 111, 112, 113, 114, -1,
2918 -1, -1, -1, -1, 120, -1, 122, -1, -1, 125
2921 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2922 symbol of state STATE-NUM. */
2923 static const yytype_uint8 yystos[] =
2925 0, 3, 4, 5, 7, 8, 9, 10, 11, 12,
2926 13, 14, 15, 18, 19, 20, 21, 23, 24, 25,
2927 26, 28, 35, 37, 38, 40, 42, 44, 46, 47,
2928 48, 51, 52, 54, 55, 62, 63, 87, 88, 96,
2929 110, 115, 116, 120, 122, 124, 132, 133, 134, 135,
2930 141, 144, 150, 154, 155, 156, 157, 159, 167, 175,
2931 178, 181, 184, 185, 186, 187, 191, 193, 202, 209,
2932 212, 224, 225, 226, 229, 230, 231, 232, 235, 49,
2933 120, 120, 160, 120, 3, 18, 124, 179, 180, 231,
2934 3, 211, 231, 120, 3, 180, 214, 215, 216, 120,
2935 124, 120, 125, 231, 120, 231, 231, 231, 231, 231,
2936 229, 221, 222, 228, 231, 228, 233, 234, 0, 135,
2937 3, 31, 45, 146, 152, 153, 230, 26, 30, 31,
2938 43, 45, 201, 187, 97, 39, 66, 67, 68, 69,
2939 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
2940 80, 81, 82, 83, 84, 85, 87, 88, 91, 92,
2941 93, 99, 102, 104, 105, 106, 107, 108, 110, 111,
2942 112, 113, 114, 120, 122, 125, 120, 158, 22, 29,
2943 36, 41, 45, 65, 96, 124, 141, 142, 143, 146,
2944 161, 162, 177, 185, 227, 236, 237, 168, 183, 124,
2945 125, 223, 120, 229, 125, 231, 176, 221, 3, 151,
2946 130, 123, 97, 103, 129, 97, 3, 147, 148, 3,
2947 147, 96, 67, 34, 50, 208, 3, 3, 3, 231,
2948 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
2949 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
2950 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
2951 231, 231, 231, 231, 231, 231, 221, 231, 3, 229,
2952 17, 3, 229, 229, 3, 129, 140, 142, 231, 96,
2953 13, 17, 231, 96, 136, 137, 138, 144, 191, 193,
2954 202, 209, 182, 179, 120, 220, 3, 90, 205, 206,
2955 207, 130, 3, 113, 130, 139, 140, 130, 229, 228,
2956 228, 228, 103, 219, 97, 219, 229, 229, 3, 53,
2957 188, 53, 189, 219, 103, 130, 123, 130, 3, 129,
2958 142, 120, 3, 130, 129, 138, 136, 221, 99, 103,
2959 203, 207, 130, 97, 143, 129, 130, 103, 35, 113,
2960 180, 216, 218, 99, 145, 148, 96, 130, 120, 216,
2961 16, 190, 216, 217, 124, 145, 231, 143, 229, 99,
2962 124, 129, 130, 4, 7, 8, 9, 11, 44, 54,
2963 55, 204, 218, 219, 90, 207, 27, 32, 169, 171,
2964 173, 174, 143, 228, 125, 228, 230, 143, 205, 217,
2965 124, 97, 194, 130, 3, 4, 33, 61, 163, 164,
2966 165, 166, 203, 124, 207, 124, 120, 169, 171, 64,
2967 149, 130, 130, 192, 216, 45, 96, 185, 198, 199,
2968 200, 231, 103, 129, 165, 166, 213, 172, 3, 143,
2969 143, 219, 96, 141, 185, 195, 196, 197, 202, 209,
2970 3, 26, 129, 200, 103, 139, 139, 139, 219, 124,
2971 129, 197, 208, 139, 129, 129, 130, 210, 3, 170,
2972 139, 120, 124, 129, 205, 139, 130, 129, 219
2975 #define yyerrok (yyerrstatus = 0)
2976 #define yyclearin (yychar = YYEMPTY)
2977 #define YYEMPTY (-2)
2980 #define YYACCEPT goto yyacceptlab
2981 #define YYABORT goto yyabortlab
2982 #define YYERROR goto yyerrorlab
2985 /* Like YYERROR except do call yyerror. This remains here temporarily
2986 to ease the transition to the new meaning of YYERROR, for GCC.
2987 Once GCC version 2 has supplanted version 1, this can go. */
2989 #define YYFAIL goto yyerrlab
2991 #define YYRECOVERING() (!!yyerrstatus)
2993 #define YYBACKUP(Token, Value) \
2995 if (yychar == YYEMPTY && yylen == 1) \
2999 yytoken = YYTRANSLATE (yychar); \
3005 yyerror (YY_("syntax error: cannot back up")); \
3012 #define YYERRCODE 256
3015 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
3016 If N is 0, then set CURRENT to the empty location which ends
3017 the previous symbol: RHS[0] (always defined). */
3019 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
3020 #ifndef YYLLOC_DEFAULT
3021 # define YYLLOC_DEFAULT(Current, Rhs, N) \
3025 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
3026 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
3027 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
3028 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
3032 (Current).first_line = (Current).last_line = \
3033 YYRHSLOC (Rhs, 0).last_line; \
3034 (Current).first_column = (Current).last_column = \
3035 YYRHSLOC (Rhs, 0).last_column; \
3041 /* YY_LOCATION_PRINT -- Print the location on the stream.
3042 This macro was not mandated originally: define only if we know
3043 we won't break user code: when these are the locations we know. */
3045 #ifndef YY_LOCATION_PRINT
3046 # if YYLTYPE_IS_TRIVIAL
3047 # define YY_LOCATION_PRINT(File, Loc) \
3048 fprintf (File, "%d.%d-%d.%d", \
3049 (Loc).first_line, (Loc).first_column, \
3050 (Loc).last_line, (Loc).last_column)
3052 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
3057 /* YYLEX -- calling `yylex' with the right arguments. */
3060 # define YYLEX yylex (YYLEX_PARAM)
3062 # define YYLEX yylex ()
3065 /* Enable debugging if requested. */
3069 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
3070 # define YYFPRINTF fprintf
3073 # define YYDPRINTF(Args) \
3079 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
3083 YYFPRINTF (stderr, "%s ", Title); \
3084 yy_symbol_print (stderr, \
3086 YYFPRINTF (stderr, "\n"); \
3091 /*--------------------------------.
3092 | Print this symbol on YYOUTPUT. |
3093 `--------------------------------*/
3096 #if (defined __STDC__ || defined __C99__FUNC__ \
3097 || defined __cplusplus || defined _MSC_VER)
3099 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3102 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
3105 YYSTYPE const * const yyvaluep;
3111 if (yytype < YYNTOKENS)
3112 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
3124 /*--------------------------------.
3125 | Print this symbol on YYOUTPUT. |
3126 `--------------------------------*/
3128 #if (defined __STDC__ || defined __C99__FUNC__ \
3129 || defined __cplusplus || defined _MSC_VER)
3131 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3134 yy_symbol_print (yyoutput, yytype, yyvaluep)
3137 YYSTYPE const * const yyvaluep;
3140 if (yytype < YYNTOKENS)
3141 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
3143 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
3145 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
3146 YYFPRINTF (yyoutput, ")");
3149 /*------------------------------------------------------------------.
3150 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3152 `------------------------------------------------------------------*/
3154 #if (defined __STDC__ || defined __C99__FUNC__ \
3155 || defined __cplusplus || defined _MSC_VER)
3157 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
3160 yy_stack_print (yybottom, yytop)
3161 yytype_int16 *yybottom;
3162 yytype_int16 *yytop;
3165 YYFPRINTF (stderr, "Stack now");
3166 for (; yybottom <= yytop; yybottom++)
3168 int yybot = *yybottom;
3169 YYFPRINTF (stderr, " %d", yybot);
3171 YYFPRINTF (stderr, "\n");
3174 # define YY_STACK_PRINT(Bottom, Top) \
3177 yy_stack_print ((Bottom), (Top)); \
3181 /*------------------------------------------------.
3182 | Report that the YYRULE is going to be reduced. |
3183 `------------------------------------------------*/
3185 #if (defined __STDC__ || defined __C99__FUNC__ \
3186 || defined __cplusplus || defined _MSC_VER)
3188 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3191 yy_reduce_print (yyvsp, yyrule)
3196 int yynrhs = yyr2[yyrule];
3198 unsigned long int yylno = yyrline[yyrule];
3199 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3201 /* The symbols being reduced. */
3202 for (yyi = 0; yyi < yynrhs; yyi++)
3204 YYFPRINTF (stderr, " $%d = ", yyi + 1);
3205 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3206 &(yyvsp[(yyi + 1) - (yynrhs)])
3208 YYFPRINTF (stderr, "\n");
3212 # define YY_REDUCE_PRINT(Rule) \
3215 yy_reduce_print (yyvsp, Rule); \
3218 /* Nonzero means print parse trace. It is left uninitialized so that
3219 multiple parsers can coexist. */
3221 #else /* !YYDEBUG */
3222 # define YYDPRINTF(Args)
3223 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3224 # define YY_STACK_PRINT(Bottom, Top)
3225 # define YY_REDUCE_PRINT(Rule)
3226 #endif /* !YYDEBUG */
3229 /* YYINITDEPTH -- initial size of the parser's stacks. */
3231 # define YYINITDEPTH 200
3234 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3235 if the built-in stack extension method is used).
3237 Do not make this value too large; the results are undefined if
3238 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3239 evaluated with infinite-precision integer arithmetic. */
3242 # define YYMAXDEPTH 10000
3250 # if defined __GLIBC__ && defined _STRING_H
3251 # define yystrlen strlen
3253 /* Return the length of YYSTR. */
3254 #if (defined __STDC__ || defined __C99__FUNC__ \
3255 || defined __cplusplus || defined _MSC_VER)
3257 yystrlen (const char *yystr)
3265 for (yylen = 0; yystr[yylen]; yylen++)
3273 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3274 # define yystpcpy stpcpy
3276 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3278 #if (defined __STDC__ || defined __C99__FUNC__ \
3279 || defined __cplusplus || defined _MSC_VER)
3281 yystpcpy (char *yydest, const char *yysrc)
3284 yystpcpy (yydest, yysrc)
3290 const char *yys = yysrc;
3292 while ((*yyd++ = *yys++) != '\0')
3301 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3302 quotes and backslashes, so that it's suitable for yyerror. The
3303 heuristic is that double-quoting is unnecessary unless the string
3304 contains an apostrophe, a comma, or backslash (other than
3305 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3306 null, do not copy; instead, return the length of what the result
3309 yytnamerr (char *yyres, const char *yystr)
3314 char const *yyp = yystr;
3321 goto do_not_strip_quotes;
3325 goto do_not_strip_quotes;
3338 do_not_strip_quotes: ;
3342 return yystrlen (yystr);
3344 return yystpcpy (yyres, yystr) - yyres;
3348 /* Copy into YYRESULT an error message about the unexpected token
3349 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3350 including the terminating null byte. If YYRESULT is null, do not
3351 copy anything; just return the number of bytes that would be
3352 copied. As a special case, return 0 if an ordinary "syntax error"
3353 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3354 size calculation. */
3356 yysyntax_error (char *yyresult, int yystate, int yychar)
3358 int yyn = yypact[yystate];
3360 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3364 int yytype = YYTRANSLATE (yychar);
3365 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3366 YYSIZE_T yysize = yysize0;
3368 int yysize_overflow = 0;
3369 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3370 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3374 /* This is so xgettext sees the translatable formats that are
3375 constructed on the fly. */
3376 YY_("syntax error, unexpected %s");
3377 YY_("syntax error, unexpected %s, expecting %s");
3378 YY_("syntax error, unexpected %s, expecting %s or %s");
3379 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3380 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3384 static char const yyunexpected[] = "syntax error, unexpected %s";
3385 static char const yyexpecting[] = ", expecting %s";
3386 static char const yyor[] = " or %s";
3387 char yyformat[sizeof yyunexpected
3388 + sizeof yyexpecting - 1
3389 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3390 * (sizeof yyor - 1))];
3391 char const *yyprefix = yyexpecting;
3393 /* Start YYX at -YYN if negative to avoid negative indexes in
3395 int yyxbegin = yyn < 0 ? -yyn : 0;
3397 /* Stay within bounds of both yycheck and yytname. */
3398 int yychecklim = YYLAST - yyn + 1;
3399 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3402 yyarg[0] = yytname[yytype];
3403 yyfmt = yystpcpy (yyformat, yyunexpected);
3405 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3406 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3408 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3412 yyformat[sizeof yyunexpected - 1] = '\0';
3415 yyarg[yycount++] = yytname[yyx];
3416 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3417 yysize_overflow |= (yysize1 < yysize);
3419 yyfmt = yystpcpy (yyfmt, yyprefix);
3423 yyf = YY_(yyformat);
3424 yysize1 = yysize + yystrlen (yyf);
3425 yysize_overflow |= (yysize1 < yysize);
3428 if (yysize_overflow)
3429 return YYSIZE_MAXIMUM;
3433 /* Avoid sprintf, as that infringes on the user's name space.
3434 Don't have undefined behavior even if the translation
3435 produced a string with the wrong number of "%s"s. */
3436 char *yyp = yyresult;
3438 while ((*yyp = *yyf) != '\0')
3440 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3442 yyp += yytnamerr (yyp, yyarg[yyi++]);
3455 #endif /* YYERROR_VERBOSE */
3458 /*-----------------------------------------------.
3459 | Release the memory associated to this symbol. |
3460 `-----------------------------------------------*/
3463 #if (defined __STDC__ || defined __C99__FUNC__ \
3464 || defined __cplusplus || defined _MSC_VER)
3466 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
3469 yydestruct (yymsg, yytype, yyvaluep)
3479 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
3489 /* Prevent warnings from -Wmissing-prototypes. */
3490 #ifdef YYPARSE_PARAM
3491 #if defined __STDC__ || defined __cplusplus
3492 int yyparse (void *YYPARSE_PARAM);
3496 #else /* ! YYPARSE_PARAM */
3497 #if defined __STDC__ || defined __cplusplus
3502 #endif /* ! YYPARSE_PARAM */
3505 /* The lookahead symbol. */
3508 /* The semantic value of the lookahead symbol. */
3511 /* Number of syntax errors so far. */
3516 /*-------------------------.
3517 | yyparse or yypush_parse. |
3518 `-------------------------*/
3520 #ifdef YYPARSE_PARAM
3521 #if (defined __STDC__ || defined __C99__FUNC__ \
3522 || defined __cplusplus || defined _MSC_VER)
3524 yyparse (void *YYPARSE_PARAM)
3527 yyparse (YYPARSE_PARAM)
3528 void *YYPARSE_PARAM;
3530 #else /* ! YYPARSE_PARAM */
3531 #if (defined __STDC__ || defined __C99__FUNC__ \
3532 || defined __cplusplus || defined _MSC_VER)
3545 /* Number of tokens to shift before error messages enabled. */
3548 /* The stacks and their tools:
3549 `yyss': related to states.
3550 `yyvs': related to semantic values.
3552 Refer to the stacks thru separate pointers, to allow yyoverflow
3553 to reallocate them elsewhere. */
3555 /* The state stack. */
3556 yytype_int16 yyssa[YYINITDEPTH];
3558 yytype_int16 *yyssp;
3560 /* The semantic value stack. */
3561 YYSTYPE yyvsa[YYINITDEPTH];
3565 YYSIZE_T yystacksize;
3569 /* Lookahead token as an internal (translated) token number. */
3571 /* The variables used to return semantic value and location from the
3576 /* Buffer for error messages, and its allocated size. */
3578 char *yymsg = yymsgbuf;
3579 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
3582 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
3584 /* The number of symbols on the RHS of the reduced rule.
3585 Keep to zero when no symbol should be popped. */
3591 yystacksize = YYINITDEPTH;
3593 YYDPRINTF ((stderr, "Starting parse\n"));
3598 yychar = YYEMPTY; /* Cause a token to be read. */
3600 /* Initialize stack pointers.
3601 Waste one element of value and location stack
3602 so that they stay on the same level as the state stack.
3603 The wasted elements are never initialized. */
3609 /*------------------------------------------------------------.
3610 | yynewstate -- Push a new state, which is found in yystate. |
3611 `------------------------------------------------------------*/
3613 /* In all cases, when you get here, the value and location stacks
3614 have just been pushed. So pushing a state here evens the stacks. */
3620 if (yyss + yystacksize - 1 <= yyssp)
3622 /* Get the current used size of the three stacks, in elements. */
3623 YYSIZE_T yysize = yyssp - yyss + 1;
3627 /* Give user a chance to reallocate the stack. Use copies of
3628 these so that the &'s don't force the real ones into
3630 YYSTYPE *yyvs1 = yyvs;
3631 yytype_int16 *yyss1 = yyss;
3633 /* Each stack pointer address is followed by the size of the
3634 data in use in that stack, in bytes. This used to be a
3635 conditional around just the two extra args, but that might
3636 be undefined if yyoverflow is a macro. */
3637 yyoverflow (YY_("memory exhausted"),
3638 &yyss1, yysize * sizeof (*yyssp),
3639 &yyvs1, yysize * sizeof (*yyvsp),
3645 #else /* no yyoverflow */
3646 # ifndef YYSTACK_RELOCATE
3647 goto yyexhaustedlab;
3649 /* Extend the stack our own way. */
3650 if (YYMAXDEPTH <= yystacksize)
3651 goto yyexhaustedlab;
3653 if (YYMAXDEPTH < yystacksize)
3654 yystacksize = YYMAXDEPTH;
3657 yytype_int16 *yyss1 = yyss;
3658 union yyalloc *yyptr =
3659 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
3661 goto yyexhaustedlab;
3662 YYSTACK_RELOCATE (yyss_alloc, yyss);
3663 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
3664 # undef YYSTACK_RELOCATE
3666 YYSTACK_FREE (yyss1);
3669 #endif /* no yyoverflow */
3671 yyssp = yyss + yysize - 1;
3672 yyvsp = yyvs + yysize - 1;
3674 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
3675 (unsigned long int) yystacksize));
3677 if (yyss + yystacksize - 1 <= yyssp)
3681 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3683 if (yystate == YYFINAL)
3693 /* Do appropriate processing given the current state. Read a
3694 lookahead token if we need one and don't already have one. */
3696 /* First try to decide what to do without reference to lookahead token. */
3697 yyn = yypact[yystate];
3698 if (yyn == YYPACT_NINF)
3701 /* Not known => get a lookahead token if don't already have one. */
3703 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
3704 if (yychar == YYEMPTY)
3706 YYDPRINTF ((stderr, "Reading a token: "));
3710 if (yychar <= YYEOF)
3712 yychar = yytoken = YYEOF;
3713 YYDPRINTF ((stderr, "Now at end of input.\n"));
3717 yytoken = YYTRANSLATE (yychar);
3718 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3721 /* If the proper action on seeing token YYTOKEN is to reduce or to
3722 detect an error, take that action. */
3724 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3729 if (yyn == 0 || yyn == YYTABLE_NINF)
3735 /* Count tokens shifted since error; after three, turn off error
3740 /* Shift the lookahead token. */
3741 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3743 /* Discard the shifted token. */
3752 /*-----------------------------------------------------------.
3753 | yydefault -- do the default action for the current state. |
3754 `-----------------------------------------------------------*/
3756 yyn = yydefact[yystate];
3762 /*-----------------------------.
3763 | yyreduce -- Do a reduction. |
3764 `-----------------------------*/
3766 /* yyn is the number of a rule to reduce with. */
3769 /* If YYLEN is nonzero, implement the default value of the action:
3772 Otherwise, the following line sets YYVAL to garbage.
3773 This behavior is undocumented and Bison
3774 users should not rely upon it. Assigning to YYVAL
3775 unconditionally makes the parser a bit smaller, and it avoids a
3776 GCC warning that YYVAL may be used uninitialized. */
3777 yyval = yyvsp[1-yylen];
3780 YY_REDUCE_PRINT (yyn);
3787 /* Line 1464 of skeleton.m4 */
3788 #line 1654 "parser.y"
3789 {(yyval.code)=(yyvsp[(1) - (1)].code);}
3798 /* Line 1464 of skeleton.m4 */
3799 #line 1655 "parser.y"
3800 {(yyval.code)=code_new();}
3809 /* Line 1464 of skeleton.m4 */
3810 #line 1657 "parser.y"
3811 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
3820 /* Line 1464 of skeleton.m4 */
3821 #line 1658 "parser.y"
3822 {(yyval.code)=(yyvsp[(1) - (1)].code);}
3831 /* Line 1464 of skeleton.m4 */
3832 #line 1673 "parser.y"
3842 /* Line 1464 of skeleton.m4 */
3843 #line 1681 "parser.y"
3844 {/*TODO*/(yyval.code)=0;}
3853 /* Line 1464 of skeleton.m4 */
3854 #line 1682 "parser.y"
3855 {/*TODO*/(yyval.code)=0;}
3864 /* Line 1464 of skeleton.m4 */
3865 #line 1684 "parser.y"
3866 {(yyval.code)=(yyvsp[(2) - (3)].code);}
3875 /* Line 1464 of skeleton.m4 */
3876 #line 1685 "parser.y"
3886 /* Line 1464 of skeleton.m4 */
3887 #line 1686 "parser.y"
3888 {(yyval.code)=(yyvsp[(1) - (2)].code);}
3897 /* Line 1464 of skeleton.m4 */
3898 #line 1687 "parser.y"
3899 {(yyval.code)=(yyvsp[(1) - (1)].code);}
3908 /* Line 1464 of skeleton.m4 */
3909 #line 1691 "parser.y"
3911 code_t**cc = &global->init->method->body->code;
3912 *cc = code_append(*cc, (yyvsp[(1) - (1)].code));
3922 /* Line 1464 of skeleton.m4 */
3923 #line 1698 "parser.y"
3924 {(yyval.value)=(yyvsp[(2) - (2)].value);}
3933 /* Line 1464 of skeleton.m4 */
3934 #line 1699 "parser.y"
3935 {(yyval.value).c=abc_pushundefined(0);
3936 (yyval.value).t=TYPE_ANY;
3946 /* Line 1464 of skeleton.m4 */
3947 #line 1703 "parser.y"
3948 {(yyval.code)=(yyvsp[(2) - (2)].code);}
3957 /* Line 1464 of skeleton.m4 */
3958 #line 1704 "parser.y"
3959 {(yyval.code)=(yyvsp[(2) - (2)].code);}
3968 /* Line 1464 of skeleton.m4 */
3969 #line 1706 "parser.y"
3970 {(yyval.code) = (yyvsp[(1) - (1)].code);}
3979 /* Line 1464 of skeleton.m4 */
3980 #line 1707 "parser.y"
3981 {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));}
3990 /* Line 1464 of skeleton.m4 */
3991 #line 1710 "parser.y"
3993 if(variable_exists((yyvsp[(1) - (3)].id)))
3994 syntaxerror("Variable %s already defined", (yyvsp[(1) - (3)].id));
3996 if(!is_subtype_of((yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo))) {
3997 syntaxerror("Can't convert %s to %s", (yyvsp[(3) - (3)].value).t->name,
3998 (yyvsp[(2) - (3)].classinfo)->name);
4001 int index = new_variable((yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].classinfo), 1);
4003 if((yyvsp[(2) - (3)].classinfo)) {
4004 if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) {
4005 (yyval.code) = (yyvsp[(3) - (3)].value).c;
4006 (yyval.code) = converttype((yyval.code), (yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo));
4007 (yyval.code) = abc_setlocal((yyval.code), index);
4009 (yyval.code) = defaultvalue(0, (yyvsp[(2) - (3)].classinfo));
4010 (yyval.code) = abc_setlocal((yyval.code), index);
4013 if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) {
4014 (yyval.code) = (yyvsp[(3) - (3)].value).c;
4015 (yyval.code) = abc_coerce_a((yyval.code));
4016 (yyval.code) = abc_setlocal((yyval.code), index);
4018 (yyval.code) = code_new();
4022 /* that's the default for a local register, anyway
4024 state->method->initcode = abc_pushundefined(state->method->initcode);
4025 state->method->initcode = abc_setlocal(state->method->initcode, index);
4027 //printf("variable %s -> %d (%s)\n", $2->text, index, $4.t?$4.t->name:"");
4037 /* Line 1464 of skeleton.m4 */
4038 #line 1750 "parser.y"
4039 {(yyval.code) = code_new();}
4048 /* Line 1464 of skeleton.m4 */
4049 #line 1751 "parser.y"
4050 {(yyval.code)=(yyvsp[(2) - (2)].code);}
4059 /* Line 1464 of skeleton.m4 */
4060 #line 1754 "parser.y"
4070 /* Line 1464 of skeleton.m4 */
4071 #line 1754 "parser.y"
4074 (yyval.code) = code_new();
4075 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (7)].value).c);
4076 code_t*myjmp,*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4078 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].code));
4079 if((yyvsp[(7) - (7)].code)) {
4080 myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4082 myif->branch = (yyval.code) = abc_nop((yyval.code));
4083 if((yyvsp[(7) - (7)].code)) {
4084 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (7)].code));
4085 myjmp->branch = (yyval.code) = abc_nop((yyval.code));
4087 (yyval.code) = var_block((yyval.code));
4098 /* Line 1464 of skeleton.m4 */
4099 #line 1773 "parser.y"
4100 {(yyval.code)=code_new();}
4109 /* Line 1464 of skeleton.m4 */
4110 #line 1778 "parser.y"
4112 (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1);
4122 /* Line 1464 of skeleton.m4 */
4123 #line 1781 "parser.y"
4125 (yyval.id)=(yyvsp[(1) - (1)].id);
4135 /* Line 1464 of skeleton.m4 */
4136 #line 1785 "parser.y"
4137 {new_state();(yyval.for_start).name=(yyvsp[(1) - (2)].id);(yyval.for_start).each=0;}
4146 /* Line 1464 of skeleton.m4 */
4147 #line 1786 "parser.y"
4148 {new_state();(yyval.for_start).name=(yyvsp[(1) - (3)].id);(yyval.for_start).each=1;}
4157 /* Line 1464 of skeleton.m4 */
4158 #line 1788 "parser.y"
4160 if((yyvsp[(1) - (8)].for_start).each) syntaxerror("invalid syntax: ; not allowed in for each statement");
4161 (yyval.code) = code_new();
4162 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (8)].code));
4163 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4164 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (8)].value).c);
4165 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4166 (yyval.code) = code_append((yyval.code), (yyvsp[(8) - (8)].code));
4167 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4168 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (8)].code));
4169 (yyval.code) = abc_jump((yyval.code), loopstart);
4170 code_t*out = (yyval.code) = abc_nop((yyval.code));
4171 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, out);
4172 continuejumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, cont);
4175 (yyval.code) = var_block((yyval.code));
4186 /* Line 1464 of skeleton.m4 */
4187 #line 1808 "parser.y"
4189 variable_t*var = find_variable((yyvsp[(2) - (6)].id));
4190 char*tmp1name = concat2((yyvsp[(2) - (6)].id), "__tmp1__");
4191 int it = new_variable(tmp1name, TYPE_INT, 0);
4192 char*tmp2name = concat2((yyvsp[(2) - (6)].id), "__array__");
4193 int array = new_variable(tmp1name, 0, 0);
4195 (yyval.code) = code_new();
4196 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
4197 (yyval.code) = abc_coerce_a((yyval.code));
4198 (yyval.code) = abc_setlocal((yyval.code), array);
4199 (yyval.code) = abc_pushbyte((yyval.code), 0);
4200 (yyval.code) = abc_setlocal((yyval.code), it);
4202 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4204 (yyval.code) = abc_hasnext2((yyval.code), array, it);
4205 code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
4206 (yyval.code) = abc_getlocal((yyval.code), array);
4207 (yyval.code) = abc_getlocal((yyval.code), it);
4208 if(!(yyvsp[(1) - (6)].for_start).each)
4209 (yyval.code) = abc_nextname((yyval.code));
4211 (yyval.code) = abc_nextvalue((yyval.code));
4212 (yyval.code) = converttype((yyval.code), 0, var->type);
4213 (yyval.code) = abc_setlocal((yyval.code), var->index);
4215 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
4216 (yyval.code) = abc_jump((yyval.code), loopstart);
4218 code_t*out = (yyval.code) = abc_nop((yyval.code));
4219 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, out);
4220 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, loopstart);
4224 (yyval.code) = var_block((yyval.code));
4238 /* Line 1464 of skeleton.m4 */
4239 #line 1851 "parser.y"
4249 /* Line 1464 of skeleton.m4 */
4250 #line 1851 "parser.y"
4253 (yyval.code) = code_new();
4255 code_t*myjmp = (yyval.code) = abc_jump((yyval.code), 0);
4256 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4257 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
4258 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4259 myjmp->branch = cont;
4260 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
4261 (yyval.code) = abc_iftrue((yyval.code), loopstart);
4262 code_t*out = (yyval.code) = abc_nop((yyval.code));
4263 breakjumpsto((yyval.code), (yyvsp[(1) - (6)].id), out);
4264 continuejumpsto((yyval.code), (yyvsp[(1) - (6)].id), cont);
4266 (yyval.code) = var_block((yyval.code));
4277 /* Line 1464 of skeleton.m4 */
4278 #line 1870 "parser.y"
4288 /* Line 1464 of skeleton.m4 */
4289 #line 1870 "parser.y"
4291 (yyval.code) = code_new();
4292 code_t*loopstart = (yyval.code) = abc_label((yyval.code));
4293 (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (7)].code));
4294 code_t*cont = (yyval.code) = abc_nop((yyval.code));
4295 (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].value).c);
4296 (yyval.code) = abc_iftrue((yyval.code), loopstart);
4297 code_t*out = (yyval.code) = abc_nop((yyval.code));
4298 breakjumpsto((yyval.code), (yyvsp[(1) - (7)].id), out);
4299 continuejumpsto((yyval.code), (yyvsp[(1) - (7)].id), cont);
4301 (yyval.code) = var_block((yyval.code));
4312 /* Line 1464 of skeleton.m4 */
4313 #line 1885 "parser.y"
4315 (yyval.code) = abc___break__(0, "");
4325 /* Line 1464 of skeleton.m4 */
4326 #line 1888 "parser.y"
4328 (yyval.code) = abc___break__(0, (yyvsp[(2) - (2)].id));
4338 /* Line 1464 of skeleton.m4 */
4339 #line 1891 "parser.y"
4341 (yyval.code) = abc___continue__(0, "");
4351 /* Line 1464 of skeleton.m4 */
4352 #line 1894 "parser.y"
4354 (yyval.code) = abc___continue__(0, (yyvsp[(2) - (2)].id));
4364 /* Line 1464 of skeleton.m4 */
4365 #line 1898 "parser.y"
4375 /* Line 1464 of skeleton.m4 */
4376 #line 1899 "parser.y"
4377 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4386 /* Line 1464 of skeleton.m4 */
4387 #line 1900 "parser.y"
4388 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4397 /* Line 1464 of skeleton.m4 */
4398 #line 1901 "parser.y"
4399 {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));}
4408 /* Line 1464 of skeleton.m4 */
4409 #line 1902 "parser.y"
4410 {(yyval.code)=(yyvsp[(1) - (1)].code);}
4419 /* Line 1464 of skeleton.m4 */
4420 #line 1903 "parser.y"
4421 {(yyval.code)=code_append((yyval.code),(yyvsp[(2) - (2)].code));}
4430 /* Line 1464 of skeleton.m4 */
4431 #line 1905 "parser.y"
4433 (yyval.code) = abc_dup(0);
4434 (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (4)].value).c);
4435 code_t*j = (yyval.code) = abc_ifne((yyval.code), 0);
4436 (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (4)].code));
4437 if((yyval.code)->opcode != OPCODE___BREAK__) {
4438 (yyval.code) = abc___fallthrough__((yyval.code), "");
4440 code_t*e = (yyval.code) = abc_nop((yyval.code));
4451 /* Line 1464 of skeleton.m4 */
4452 #line 1916 "parser.y"
4454 (yyval.code) = (yyvsp[(3) - (3)].code);
4464 /* Line 1464 of skeleton.m4 */
4465 #line 1919 "parser.y"
4475 /* Line 1464 of skeleton.m4 */
4476 #line 1919 "parser.y"
4478 (yyval.code)=(yyvsp[(4) - (8)].value).c;
4479 (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (8)].code));
4480 code_t*out = (yyval.code) = abc_pop((yyval.code));
4481 breakjumpsto((yyval.code), (yyvsp[(1) - (8)].id), out);
4483 code_t*c = (yyval.code),*lastblock=0;
4485 if(c->opcode == OPCODE_IFNE) {
4486 if(!c->next) syntaxerror("internal error in fallthrough handling");
4488 } else if(c->opcode == OPCODE___FALLTHROUGH__) {
4490 c->opcode = OPCODE_JUMP;
4491 c->branch = lastblock;
4493 /* fall through end of switch */
4494 c->opcode = OPCODE_NOP;
4500 (yyval.code) = var_block((yyval.code));
4511 /* Line 1464 of skeleton.m4 */
4512 #line 1948 "parser.y"
4513 {new_state();state->exception_name=(yyvsp[(3) - (5)].id);new_variable((yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].classinfo), 0);}
4522 /* Line 1464 of skeleton.m4 */
4523 #line 1949 "parser.y"
4525 namespace_t name_ns = {ACCESS_PACKAGE, ""};
4526 multiname_t name = {QNAME, &name_ns, 0, (yyvsp[(3) - (9)].id)};
4528 NEW(abc_exception_t, e)
4529 e->exc_type = sig2mname((yyvsp[(4) - (9)].classinfo));
4530 e->var_name = multiname_clone(&name);
4531 (yyval.exception) = e;
4534 int i = find_variable_safe((yyvsp[(3) - (9)].id))->index;
4535 e->target = c = abc_nop(0);
4536 c = abc_setlocal(c, i);
4537 c = code_append(c, (yyvsp[(8) - (9)].code));
4551 /* Line 1464 of skeleton.m4 */
4552 #line 1968 "parser.y"
4553 {new_state();state->exception_name=0;}
4562 /* Line 1464 of skeleton.m4 */
4563 #line 1968 "parser.y"
4565 (yyvsp[(4) - (5)].code) = var_block((yyvsp[(4) - (5)].code));
4566 if(!(yyvsp[(4) - (5)].code)) {
4567 (yyval.exception)=0;
4570 NEW(abc_exception_t, e)
4571 e->exc_type = 0; //all exceptions
4572 e->var_name = 0; //no name
4575 e->to = code_append(e->to, (yyvsp[(4) - (5)].code));
4577 (yyval.exception) = e;
4588 /* Line 1464 of skeleton.m4 */
4589 #line 1985 "parser.y"
4590 {(yyval.catch_list).l=list_new();(yyval.catch_list).finally=0;list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));}
4599 /* Line 1464 of skeleton.m4 */
4600 #line 1986 "parser.y"
4601 {(yyval.catch_list)=(yyvsp[(1) - (2)].catch_list);list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));}
4610 /* Line 1464 of skeleton.m4 */
4611 #line 1987 "parser.y"
4612 {(yyval.catch_list)=(yyvsp[(1) - (1)].catch_list);}
4621 /* Line 1464 of skeleton.m4 */
4622 #line 1988 "parser.y"
4624 (yyval.catch_list) = (yyvsp[(1) - (2)].catch_list);
4625 (yyval.catch_list).finally = 0;
4626 if((yyvsp[(2) - (2)].exception)) {
4627 list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));
4628 (yyval.catch_list).finally = (yyvsp[(2) - (2)].exception)->to;(yyvsp[(2) - (2)].exception)->to=0;
4639 /* Line 1464 of skeleton.m4 */
4640 #line 1996 "parser.y"
4642 (yyval.catch_list).l=list_new();
4643 (yyval.catch_list).finally = 0;
4644 if((yyvsp[(1) - (1)].exception)) {
4645 list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));
4646 (yyval.catch_list).finally = (yyvsp[(1) - (1)].exception)->to;(yyvsp[(1) - (1)].exception)->to=0;
4657 /* Line 1464 of skeleton.m4 */
4658 #line 2005 "parser.y"
4668 /* Line 1464 of skeleton.m4 */
4669 #line 2005 "parser.y"
4671 code_t*out = abc_nop(0);
4673 code_t*start = abc_nop(0);
4674 (yyval.code) = code_append(start, (yyvsp[(4) - (6)].code));
4675 if(!is_break_or_jump((yyvsp[(4) - (6)].code))) {
4676 (yyval.code) = abc_jump((yyval.code), out);
4678 code_t*end = (yyval.code) = abc_nop((yyval.code));
4681 if((yyvsp[(6) - (6)].catch_list).finally)
4682 tmp = new_variable("__finally__", 0, 0);
4684 abc_exception_list_t*l = (yyvsp[(6) - (6)].catch_list).l;
4687 abc_exception_t*e = l->abc_exception;
4689 (yyval.code) = code_append((yyval.code), e->target);
4690 (yyval.code) = abc_jump((yyval.code), out);
4692 parserassert((ptroff_t)(yyvsp[(6) - (6)].catch_list).finally);
4694 e->target = (yyval.code) = abc_nop((yyval.code));
4695 (yyval.code) = abc___rethrow__((yyval.code));
4703 (yyval.code) = code_append((yyval.code), out);
4705 (yyval.code) = insert_finally((yyval.code), (yyvsp[(6) - (6)].catch_list).finally, tmp);
4707 list_concat(state->method->exceptions, (yyvsp[(6) - (6)].catch_list).l);
4709 (yyval.code) = var_block((yyval.code));
4720 /* Line 1464 of skeleton.m4 */
4721 #line 2050 "parser.y"
4723 (yyval.code)=(yyvsp[(2) - (2)].value).c;
4724 (yyval.code)=abc_throw((yyval.code));
4734 /* Line 1464 of skeleton.m4 */
4735 #line 2054 "parser.y"
4737 if(!state->exception_name)
4738 syntaxerror("re-throw only possible within a catch block");
4739 variable_t*v = find_variable(state->exception_name);
4740 (yyval.code)=code_new();
4741 (yyval.code)=abc_getlocal((yyval.code), v->index);
4742 (yyval.code)=abc_throw((yyval.code));
4752 /* Line 1464 of skeleton.m4 */
4753 #line 2065 "parser.y"
4755 (yyval.code) = (yyvsp[(3) - (5)].value).c;
4756 (yyval.code) = abc_pushscope((yyval.code));
4757 (yyval.code) = code_append((yyval.code), (yyvsp[(5) - (5)].code));
4758 (yyval.code) = abc_popscope((yyval.code));
4768 /* Line 1464 of skeleton.m4 */
4769 #line 2075 "parser.y"
4770 {PASS12 (yyval.id)="package";}
4779 /* Line 1464 of skeleton.m4 */
4780 #line 2077 "parser.y"
4781 {PASS12 (yyval.id) = concat3((yyvsp[(1) - (3)].id),".",(yyvsp[(3) - (3)].id));free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;}
4790 /* Line 1464 of skeleton.m4 */
4791 #line 2078 "parser.y"
4792 {PASS12 (yyval.id)=strdup((yyvsp[(1) - (1)].id));}
4801 /* Line 1464 of skeleton.m4 */
4802 #line 2080 "parser.y"
4803 {PASS12 startpackage((yyvsp[(2) - (3)].id));free((yyvsp[(2) - (3)].id));(yyvsp[(2) - (3)].id)=0;}
4812 /* Line 1464 of skeleton.m4 */
4813 #line 2081 "parser.y"
4814 {PASS12 endpackage();(yyval.code)=0;}
4823 /* Line 1464 of skeleton.m4 */
4824 #line 2082 "parser.y"
4825 {PASS12 startpackage("");}
4834 /* Line 1464 of skeleton.m4 */
4835 #line 2083 "parser.y"
4836 {PASS12 endpackage();(yyval.code)=0;}
4845 /* Line 1464 of skeleton.m4 */
4846 #line 2085 "parser.y"
4848 classinfo_t*c = (yyvsp[(2) - (2)].classinfo);
4850 syntaxerror("Couldn't import class\n");
4851 state_has_imports();
4852 dict_put(state->imports, c->name, c);
4863 /* Line 1464 of skeleton.m4 */
4864 #line 2093 "parser.y"
4867 i->package = (yyvsp[(2) - (4)].id);
4868 state_has_imports();
4869 list_append(state->wildcard_imports, i);
4880 /* Line 1464 of skeleton.m4 */
4881 #line 2103 "parser.y"
4882 {PASS12 (yyval.flags)=0;}
4891 /* Line 1464 of skeleton.m4 */
4892 #line 2104 "parser.y"
4893 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].flags);}
4902 /* Line 1464 of skeleton.m4 */
4903 #line 2105 "parser.y"
4904 {PASS12 (yyval.flags)=(yyvsp[(1) - (1)].token);}
4913 /* Line 1464 of skeleton.m4 */
4914 #line 2106 "parser.y"
4915 {PASS12 (yyval.flags)=(yyvsp[(1) - (2)].flags)|(yyvsp[(2) - (2)].token);}
4924 /* Line 1464 of skeleton.m4 */
4925 #line 2108 "parser.y"
4926 {PASS12 (yyval.token)=FLAG_PUBLIC;}
4935 /* Line 1464 of skeleton.m4 */
4936 #line 2109 "parser.y"
4937 {PASS12 (yyval.token)=FLAG_PRIVATE;}
4946 /* Line 1464 of skeleton.m4 */
4947 #line 2110 "parser.y"
4948 {PASS12 (yyval.token)=FLAG_PROTECTED;}
4957 /* Line 1464 of skeleton.m4 */
4958 #line 2111 "parser.y"
4959 {PASS12 (yyval.token)=FLAG_STATIC;}
4968 /* Line 1464 of skeleton.m4 */
4969 #line 2112 "parser.y"
4970 {PASS12 (yyval.token)=FLAG_DYNAMIC;}
4979 /* Line 1464 of skeleton.m4 */
4980 #line 2113 "parser.y"
4981 {PASS12 (yyval.token)=FLAG_FINAL;}
4990 /* Line 1464 of skeleton.m4 */
4991 #line 2114 "parser.y"
4992 {PASS12 (yyval.token)=FLAG_OVERRIDE;}
5001 /* Line 1464 of skeleton.m4 */
5002 #line 2115 "parser.y"
5003 {PASS12 (yyval.token)=FLAG_NATIVE;}
5012 /* Line 1464 of skeleton.m4 */
5013 #line 2116 "parser.y"
5014 {PASS12 (yyval.token)=FLAG_PACKAGEINTERNAL;}
5023 /* Line 1464 of skeleton.m4 */
5024 #line 2118 "parser.y"
5025 {(yyval.classinfo)=registry_getobjectclass();}
5034 /* Line 1464 of skeleton.m4 */
5035 #line 2119 "parser.y"
5036 {(yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
5045 /* Line 1464 of skeleton.m4 */
5046 #line 2121 "parser.y"
5047 {PASS12 (yyval.classinfo_list)=list_new();}
5056 /* Line 1464 of skeleton.m4 */
5057 #line 2122 "parser.y"
5058 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5067 /* Line 1464 of skeleton.m4 */
5068 #line 2124 "parser.y"
5069 {PASS12 (yyval.classinfo_list)=list_new();}
5078 /* Line 1464 of skeleton.m4 */
5079 #line 2125 "parser.y"
5080 {PASS12 (yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);}
5089 /* Line 1464 of skeleton.m4 */
5090 #line 2129 "parser.y"
5091 {PASS12 startclass((yyvsp[(1) - (6)].flags),(yyvsp[(3) - (6)].id),(yyvsp[(4) - (6)].classinfo),(yyvsp[(5) - (6)].classinfo_list), 0);}
5100 /* Line 1464 of skeleton.m4 */
5101 #line 2131 "parser.y"
5102 {PASS12 endclass();(yyval.code)=0;}
5111 /* Line 1464 of skeleton.m4 */
5112 #line 2135 "parser.y"
5113 {PASS12 startclass((yyvsp[(1) - (5)].flags),(yyvsp[(3) - (5)].id),0,(yyvsp[(4) - (5)].classinfo_list),1);}
5122 /* Line 1464 of skeleton.m4 */
5123 #line 2137 "parser.y"
5124 {PASS12 endclass();(yyval.code)=0;}
5133 /* Line 1464 of skeleton.m4 */
5134 #line 2149 "parser.y"
5136 code_t*c = state->cls->static_init;
5137 c = code_append(c, (yyvsp[(1) - (1)].code));
5138 state->cls->static_init = c;
5148 /* Line 1464 of skeleton.m4 */
5149 #line 2160 "parser.y"
5151 syntaxerror("variable declarations not allowed in interfaces");
5161 /* Line 1464 of skeleton.m4 */
5162 #line 2163 "parser.y"
5165 (yyvsp[(1) - (8)].flags) |= FLAG_PUBLIC;
5166 if((yyvsp[(1) - (8)].flags)&(FLAG_PRIVATE|FLAG_PACKAGEINTERNAL|FLAG_PROTECTED)) {
5167 syntaxerror("invalid method modifiers: interface methods always need to be public");
5169 startfunction(0,(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo));
5170 endfunction(0,(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo), 0);
5180 /* Line 1464 of skeleton.m4 */
5181 #line 2177 "parser.y"
5183 int flags = (yyvsp[(1) - (5)].flags);
5184 memberinfo_t* info = state->cls?
5185 memberinfo_register(state->cls->info, (yyvsp[(3) - (5)].id), MEMBER_SLOT):
5186 memberinfo_register_global(flags2access((yyvsp[(1) - (5)].flags)), state->package, (yyvsp[(3) - (5)].id), MEMBER_SLOT);
5188 info->type = (yyvsp[(4) - (5)].classinfo);
5189 info->flags = flags;
5192 namespace_t mname_ns = {flags2access(flags), ""};
5193 multiname_t mname = {QNAME, &mname_ns, 0, (yyvsp[(3) - (5)].id)};
5195 trait_list_t**traits;
5199 mname_ns.name = state->package;
5200 traits = &global->init->traits;
5201 code = &global->init->method->body->code;
5202 } else if(flags&FLAG_STATIC) {
5204 traits = &state->cls->abc->static_traits;
5205 code = &state->cls->static_init;
5207 // instance variable
5208 traits = &state->cls->abc->traits;
5209 code = &state->cls->init;
5213 if((yyvsp[(4) - (5)].classinfo)) {
5214 MULTINAME(m, (yyvsp[(4) - (5)].classinfo));
5215 t = trait_new_member(traits, multiname_clone(&m), multiname_clone(&mname), 0);
5217 t = trait_new_member(traits, 0, multiname_clone(&mname), 0);
5219 info->slot = t->slot_id;
5221 /* initalization code (if needed) */
5223 if((yyvsp[(5) - (5)].value).c && !is_pushundefined((yyvsp[(5) - (5)].value).c)) {
5224 c = abc_getlocal_0(c);
5225 c = code_append(c, (yyvsp[(5) - (5)].value).c);
5226 c = converttype(c, (yyvsp[(5) - (5)].value).t, (yyvsp[(4) - (5)].classinfo));
5227 c = abc_setslot(c, t->slot_id);
5230 *code = code_append(*code, c);
5232 if((yyvsp[(2) - (5)].token)==KW_CONST) {
5233 t->kind= TRAIT_CONST;
5246 /* Line 1464 of skeleton.m4 */
5247 #line 2236 "parser.y"
5248 {(yyval.constant)=0;}
5257 /* Line 1464 of skeleton.m4 */
5258 #line 2237 "parser.y"
5259 {(yyval.constant)=(yyvsp[(2) - (2)].constant);}
5268 /* Line 1464 of skeleton.m4 */
5269 #line 2239 "parser.y"
5270 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_uint));}
5279 /* Line 1464 of skeleton.m4 */
5280 #line 2240 "parser.y"
5281 {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_int));}
5290 /* Line 1464 of skeleton.m4 */
5291 #line 2241 "parser.y"
5292 {(yyval.constant) = constant_new_uint((yyvsp[(1) - (1)].number_uint));}
5301 /* Line 1464 of skeleton.m4 */
5302 #line 2242 "parser.y"
5303 {(yyval.constant) = constant_new_float((yyvsp[(1) - (1)].number_float));}
5312 /* Line 1464 of skeleton.m4 */
5313 #line 2243 "parser.y"
5314 {(yyval.constant) = constant_new_string2((yyvsp[(1) - (1)].str).str,(yyvsp[(1) - (1)].str).len);}
5323 /* Line 1464 of skeleton.m4 */
5324 #line 2245 "parser.y"
5325 {(yyval.constant) = constant_new_true((yyvsp[(1) - (1)].token));}
5334 /* Line 1464 of skeleton.m4 */
5335 #line 2246 "parser.y"
5336 {(yyval.constant) = constant_new_false((yyvsp[(1) - (1)].token));}
5345 /* Line 1464 of skeleton.m4 */
5346 #line 2247 "parser.y"
5347 {(yyval.constant) = constant_new_null((yyvsp[(1) - (1)].token));}
5356 /* Line 1464 of skeleton.m4 */
5357 #line 2252 "parser.y"
5360 memset(&(yyval.params),0,sizeof((yyval.params)));
5370 /* Line 1464 of skeleton.m4 */
5371 #line 2256 "parser.y"
5374 (yyval.params)=(yyvsp[(1) - (1)].params);
5384 /* Line 1464 of skeleton.m4 */
5385 #line 2262 "parser.y"
5388 memset(&(yyval.params),0,sizeof((yyval.params)));
5389 (yyval.params).varargs=1;
5390 list_append((yyval.params).list, (yyvsp[(2) - (2)].param));
5400 /* Line 1464 of skeleton.m4 */
5401 #line 2268 "parser.y"
5404 (yyval.params) =(yyvsp[(1) - (4)].params);
5405 (yyval.params).varargs=1;
5406 list_append((yyval.params).list, (yyvsp[(4) - (4)].param));
5416 /* Line 1464 of skeleton.m4 */
5417 #line 2276 "parser.y"
5420 (yyval.params) = (yyvsp[(1) - (3)].params);
5421 list_append((yyval.params).list, (yyvsp[(3) - (3)].param));
5431 /* Line 1464 of skeleton.m4 */
5432 #line 2281 "parser.y"
5435 memset(&(yyval.params),0,sizeof((yyval.params)));
5436 list_append((yyval.params).list, (yyvsp[(1) - (1)].param));
5446 /* Line 1464 of skeleton.m4 */
5447 #line 2287 "parser.y"
5449 PASS1 (yyval.param)=0;
5451 (yyval.param) = malloc(sizeof(param_t));
5452 (yyval.param)->name=(yyvsp[(1) - (4)].id);
5453 (yyval.param)->type = (yyvsp[(3) - (4)].classinfo);
5454 (yyval.param)->value = (yyvsp[(4) - (4)].constant);
5464 /* Line 1464 of skeleton.m4 */
5465 #line 2295 "parser.y"
5467 PASS1 (yyval.param)=0;
5469 (yyval.param) = malloc(sizeof(param_t));
5470 (yyval.param)->name=(yyvsp[(1) - (2)].id);
5471 (yyval.param)->type = TYPE_ANY;
5472 (yyval.param)->value = (yyvsp[(2) - (2)].constant);
5482 /* Line 1464 of skeleton.m4 */
5483 #line 2303 "parser.y"
5484 {(yyval.token)=(yyvsp[(1) - (1)].token);}
5493 /* Line 1464 of skeleton.m4 */
5494 #line 2304 "parser.y"
5495 {(yyval.token)=(yyvsp[(1) - (1)].token);}
5504 /* Line 1464 of skeleton.m4 */
5505 #line 2305 "parser.y"
5515 /* Line 1464 of skeleton.m4 */
5516 #line 2308 "parser.y"
5517 {PASS12 startfunction(0,(yyvsp[(1) - (9)].flags),(yyvsp[(3) - (9)].token),(yyvsp[(4) - (9)].id),&(yyvsp[(6) - (9)].params),(yyvsp[(8) - (9)].classinfo));}
5526 /* Line 1464 of skeleton.m4 */
5527 #line 2309 "parser.y"
5531 if(!state->method->info) syntaxerror("internal error");
5533 code_t*c = method_header();
5534 c = wrap_function(c, 0, (yyvsp[(11) - (12)].code));
5536 endfunction(0,(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),(yyvsp[(8) - (12)].classinfo),c);
5547 /* Line 1464 of skeleton.m4 */
5548 #line 2322 "parser.y"
5549 {PASS12 (yyval.id)=0;}
5558 /* Line 1464 of skeleton.m4 */
5559 #line 2324 "parser.y"
5560 {PASS12 innerfunction((yyvsp[(2) - (7)].id),&(yyvsp[(4) - (7)].params),(yyvsp[(6) - (7)].classinfo));}
5569 /* Line 1464 of skeleton.m4 */
5570 #line 2325 "parser.y"
5574 memberinfo_t*f = state->method->info;
5575 if(!f) syntaxerror("internal error");
5577 code_t*c = method_header();
5578 c = wrap_function(c, 0, (yyvsp[(9) - (10)].code));
5580 int index = state->method->var_index;
5581 endfunction(0,0,0,(yyvsp[(2) - (10)].id),&(yyvsp[(4) - (10)].params),(yyvsp[(6) - (10)].classinfo),c);
5583 (yyval.value).c = abc_getlocal(0, index);
5584 (yyval.value).t = TYPE_FUNCTION(f);
5594 /* Line 1464 of skeleton.m4 */
5595 #line 2344 "parser.y"
5597 PASS1 (yyval.classinfo)=0;
5599 /* try current package */
5600 (yyval.classinfo) = find_class((yyvsp[(1) - (1)].id));
5601 if(!(yyval.classinfo)) syntaxerror("Could not find class %s\n", (yyvsp[(1) - (1)].id));
5611 /* Line 1464 of skeleton.m4 */
5612 #line 2352 "parser.y"
5614 PASS1 (yyval.classinfo)=0;
5616 (yyval.classinfo) = registry_findclass((yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
5617 if(!(yyval.classinfo)) syntaxerror("Couldn't find class %s.%s\n", (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
5618 free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;
5628 /* Line 1464 of skeleton.m4 */
5629 #line 2363 "parser.y"
5630 {PASS12 (yyval.classinfo_list)=list_new();list_append((yyval.classinfo_list), (yyvsp[(1) - (1)].classinfo));}
5639 /* Line 1464 of skeleton.m4 */
5640 #line 2364 "parser.y"
5641 {PASS12 (yyval.classinfo_list)=(yyvsp[(1) - (3)].classinfo_list);list_append((yyval.classinfo_list),(yyvsp[(3) - (3)].classinfo));}
5650 /* Line 1464 of skeleton.m4 */
5651 #line 2366 "parser.y"
5652 {(yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);}
5661 /* Line 1464 of skeleton.m4 */
5662 #line 2367 "parser.y"
5663 {(yyval.classinfo)=registry_getanytype();}
5672 /* Line 1464 of skeleton.m4 */
5673 #line 2368 "parser.y"
5674 {(yyval.classinfo)=registry_getanytype();}
5683 /* Line 1464 of skeleton.m4 */
5684 #line 2377 "parser.y"
5685 {(yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);}
5694 /* Line 1464 of skeleton.m4 */
5695 #line 2378 "parser.y"
5696 {(yyval.classinfo)=0;}
5705 /* Line 1464 of skeleton.m4 */
5706 #line 2382 "parser.y"
5707 {(yyval.value_list).cc=0;(yyval.value_list).len=0;}
5716 /* Line 1464 of skeleton.m4 */
5717 #line 2383 "parser.y"
5718 {(yyval.value_list)=(yyvsp[(2) - (3)].value_list);}
5727 /* Line 1464 of skeleton.m4 */
5728 #line 2385 "parser.y"
5729 {(yyval.value_list).cc=0;(yyval.value_list).len=0;}
5738 /* Line 1464 of skeleton.m4 */
5739 #line 2387 "parser.y"
5740 {(yyval.value_list).len=1;
5741 (yyval.value_list).cc = (yyvsp[(1) - (1)].value).c;
5751 /* Line 1464 of skeleton.m4 */
5752 #line 2390 "parser.y"
5754 (yyval.value_list).len= (yyvsp[(1) - (3)].value_list).len+1;
5755 (yyval.value_list).cc = code_append((yyvsp[(1) - (3)].value_list).cc, (yyvsp[(3) - (3)].value).c);
5765 /* Line 1464 of skeleton.m4 */
5766 #line 2396 "parser.y"
5768 (yyval.value).c = (yyvsp[(2) - (4)].value).c;
5769 if((yyval.value).c->opcode == OPCODE_COERCE_A) (yyval.value).c = code_cutlast((yyval.value).c);
5771 code_t*paramcode = (yyvsp[(4) - (4)].value_list).cc;
5772 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
5773 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
5774 (yyval.value).c = code_cutlast((yyval.value).c);
5775 (yyval.value).c = code_append((yyval.value).c, paramcode);
5776 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).len);
5777 multiname_destroy(name);
5778 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
5779 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
5780 trait_t*t = abc_class_find_slotid(state->cls->abc,slot);//FIXME
5781 multiname_t*name = t->name;
5782 (yyval.value).c = code_cutlast((yyval.value).c);
5783 (yyval.value).c = code_append((yyval.value).c, paramcode);
5784 (yyval.value).c = abc_constructprop2((yyval.value).c, name, (yyvsp[(4) - (4)].value_list).len);
5786 (yyval.value).c = code_append((yyval.value).c, paramcode);
5787 (yyval.value).c = abc_construct((yyval.value).c, (yyvsp[(4) - (4)].value_list).len);
5790 (yyval.value).t = TYPE_ANY;
5791 if(TYPE_IS_CLASS((yyvsp[(2) - (4)].value).t) && (yyvsp[(2) - (4)].value).t->cls) {
5792 (yyval.value).t = (yyvsp[(2) - (4)].value).t->cls;
5794 (yyval.value).c = abc_coerce_a((yyval.value).c);
5795 (yyval.value).t = TYPE_ANY;
5806 /* Line 1464 of skeleton.m4 */
5807 #line 2432 "parser.y"
5810 (yyval.value).c = (yyvsp[(1) - (4)].value).c;
5811 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
5812 (yyval.value).c = code_cutlast((yyval.value).c);
5814 code_t*paramcode = (yyvsp[(3) - (4)].value_list).cc;
5816 (yyval.value).t = TYPE_ANY;
5817 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
5818 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
5819 (yyval.value).c = code_cutlast((yyval.value).c);
5820 (yyval.value).c = code_append((yyval.value).c, paramcode);
5821 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).len);
5822 multiname_destroy(name);
5823 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
5824 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
5825 trait_t*t = abc_class_find_slotid(state->cls->abc,slot);//FIXME
5826 if(t->kind!=TRAIT_METHOD) {
5827 //ok: flash allows to assign closures to members.
5829 multiname_t*name = t->name;
5830 (yyval.value).c = code_cutlast((yyval.value).c);
5831 (yyval.value).c = code_append((yyval.value).c, paramcode);
5832 //$$.c = abc_callmethod($$.c, t->method, len); //#1051 illegal early access binding
5833 (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).len);
5834 } else if((yyval.value).c->opcode == OPCODE_GETSUPER) {
5835 multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
5836 (yyval.value).c = code_cutlast((yyval.value).c);
5837 (yyval.value).c = code_append((yyval.value).c, paramcode);
5838 (yyval.value).c = abc_callsuper2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).len);
5839 multiname_destroy(name);
5841 (yyval.value).c = abc_getglobalscope((yyval.value).c);
5842 (yyval.value).c = code_append((yyval.value).c, paramcode);
5843 (yyval.value).c = abc_call((yyval.value).c, (yyvsp[(3) - (4)].value_list).len);
5846 if(TYPE_IS_FUNCTION((yyvsp[(1) - (4)].value).t) && (yyvsp[(1) - (4)].value).t->function) {
5847 (yyval.value).t = (yyvsp[(1) - (4)].value).t->function->return_type;
5849 (yyval.value).c = abc_coerce_a((yyval.value).c);
5850 (yyval.value).t = TYPE_ANY;
5861 /* Line 1464 of skeleton.m4 */
5862 #line 2478 "parser.y"
5864 if(!state->cls) syntaxerror("super() not allowed outside of a class");
5865 if(!state->method) syntaxerror("super() not allowed outside of a function");
5866 if(!state->method->is_constructor) syntaxerror("super() not allowed outside of a constructor");
5868 (yyval.value).c = code_new();
5869 (yyval.value).c = abc_getlocal_0((yyval.value).c);
5871 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value_list).cc);
5873 this is dependent on the control path, check this somewhere else
5874 if(state->method->has_super)
5875 syntaxerror("constructor may call super() only once");
5877 state->method->has_super = 1;
5879 (yyval.value).c = abc_constructsuper((yyval.value).c, (yyvsp[(3) - (4)].value_list).len);
5880 (yyval.value).c = abc_pushundefined((yyval.value).c);
5881 (yyval.value).t = TYPE_ANY;
5891 /* Line 1464 of skeleton.m4 */
5892 #line 2499 "parser.y"
5894 (yyval.value).c = (yyvsp[(2) - (2)].value).c;
5895 if((yyval.value).c->opcode == OPCODE_COERCE_A) {
5896 (yyval.value).c = code_cutlast((yyval.value).c);
5898 multiname_t*name = 0;
5899 if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
5900 (yyval.value).c->opcode = OPCODE_DELETEPROPERTY;
5901 } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
5902 int slot = (int)(ptroff_t)(yyval.value).c->data[0];
5903 multiname_t*name = abc_class_find_slotid(state->cls->abc,slot)->name;
5904 (yyval.value).c = code_cutlast((yyval.value).c);
5905 (yyval.value).c = abc_deleteproperty2((yyval.value).c, name);
5907 (yyval.value).c = abc_getlocal_0((yyval.value).c);
5908 MULTINAME_LATE(m, (yyvsp[(2) - (2)].value).t?(yyvsp[(2) - (2)].value).t->access:ACCESS_PACKAGE, "");
5909 (yyval.value).c = abc_deleteproperty2((yyval.value).c, &m);
5911 (yyval.value).t = TYPE_BOOLEAN;
5921 /* Line 1464 of skeleton.m4 */
5922 #line 2520 "parser.y"
5924 (yyval.code) = abc_returnvoid(0);
5934 /* Line 1464 of skeleton.m4 */
5935 #line 2523 "parser.y"
5937 (yyval.code) = (yyvsp[(2) - (2)].value).c;
5938 (yyval.code) = abc_returnvalue((yyval.code));
5948 /* Line 1464 of skeleton.m4 */
5949 #line 2530 "parser.y"
5950 {(yyval.value)=(yyvsp[(1) - (1)].value);}
5959 /* Line 1464 of skeleton.m4 */
5960 #line 2531 "parser.y"
5961 {(yyval.value) = (yyvsp[(1) - (1)].value);}
5970 /* Line 1464 of skeleton.m4 */
5971 #line 2532 "parser.y"
5973 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
5974 (yyval.value).c = cut_last_push((yyval.value).c);
5975 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
5976 (yyval.value).t = (yyvsp[(3) - (3)].value).t;
5986 /* Line 1464 of skeleton.m4 */
5987 #line 2538 "parser.y"
5989 (yyval.code)=cut_last_push((yyvsp[(1) - (1)].value).c);
5999 /* Line 1464 of skeleton.m4 */
6000 #line 2544 "parser.y"
6001 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6010 /* Line 1464 of skeleton.m4 */
6011 #line 2548 "parser.y"
6012 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6021 /* Line 1464 of skeleton.m4 */
6022 #line 2550 "parser.y"
6023 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6032 /* Line 1464 of skeleton.m4 */
6033 #line 2552 "parser.y"
6034 {(yyval.value) = (yyvsp[(1) - (1)].value);}
6043 /* Line 1464 of skeleton.m4 */
6044 #line 2556 "parser.y"
6046 (yyval.value).c = 0;
6047 namespace_t ns = {ACCESS_PACKAGE, ""};
6048 multiname_t m = {QNAME, &ns, 0, "RegExp"};
6049 if(!(yyvsp[(1) - (1)].regexp).options) {
6050 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
6051 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern);
6052 (yyval.value).c = abc_construct((yyval.value).c, 1);
6054 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
6055 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern);
6056 (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).options);
6057 (yyval.value).c = abc_construct((yyval.value).c, 2);
6059 (yyval.value).t = TYPE_REGEXP;
6069 /* Line 1464 of skeleton.m4 */
6070 #line 2573 "parser.y"
6071 {(yyval.value).c = abc_pushbyte(0, (yyvsp[(1) - (1)].number_uint));
6072 //MULTINAME(m, registry_getintclass());
6073 //$$.c = abc_coerce2($$.c, &m); // FIXME
6074 (yyval.value).t = TYPE_INT;
6084 /* Line 1464 of skeleton.m4 */
6085 #line 2578 "parser.y"
6086 {(yyval.value).c = abc_pushshort(0, (yyvsp[(1) - (1)].number_uint));
6087 (yyval.value).t = TYPE_INT;
6097 /* Line 1464 of skeleton.m4 */
6098 #line 2581 "parser.y"
6099 {(yyval.value).c = abc_pushint(0, (yyvsp[(1) - (1)].number_int));
6100 (yyval.value).t = TYPE_INT;
6110 /* Line 1464 of skeleton.m4 */
6111 #line 2584 "parser.y"
6112 {(yyval.value).c = abc_pushuint(0, (yyvsp[(1) - (1)].number_uint));
6113 (yyval.value).t = TYPE_UINT;
6123 /* Line 1464 of skeleton.m4 */
6124 #line 2587 "parser.y"
6125 {(yyval.value).c = abc_pushdouble(0, (yyvsp[(1) - (1)].number_float));
6126 (yyval.value).t = TYPE_FLOAT;
6136 /* Line 1464 of skeleton.m4 */
6137 #line 2590 "parser.y"
6138 {(yyval.value).c = abc_pushstring2(0, &(yyvsp[(1) - (1)].str));
6139 (yyval.value).t = TYPE_STRING;
6149 /* Line 1464 of skeleton.m4 */
6150 #line 2593 "parser.y"
6151 {(yyval.value).c = abc_pushundefined(0);
6152 (yyval.value).t = TYPE_ANY;
6162 /* Line 1464 of skeleton.m4 */
6163 #line 2596 "parser.y"
6164 {(yyval.value).c = abc_pushtrue(0);
6165 (yyval.value).t = TYPE_BOOLEAN;
6175 /* Line 1464 of skeleton.m4 */
6176 #line 2599 "parser.y"
6177 {(yyval.value).c = abc_pushfalse(0);
6178 (yyval.value).t = TYPE_BOOLEAN;
6188 /* Line 1464 of skeleton.m4 */
6189 #line 2602 "parser.y"
6190 {(yyval.value).c = abc_pushnull(0);
6191 (yyval.value).t = TYPE_NULL;
6201 /* Line 1464 of skeleton.m4 */
6202 #line 2606 "parser.y"
6203 {(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);
6204 (yyval.value).t = TYPE_BOOLEAN;
6214 /* Line 1464 of skeleton.m4 */
6215 #line 2609 "parser.y"
6216 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterthan((yyval.value).c);
6217 (yyval.value).t = TYPE_BOOLEAN;
6227 /* Line 1464 of skeleton.m4 */
6228 #line 2612 "parser.y"
6229 {(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);
6230 (yyval.value).t = TYPE_BOOLEAN;
6240 /* Line 1464 of skeleton.m4 */
6241 #line 2615 "parser.y"
6242 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterequals((yyval.value).c);
6243 (yyval.value).t = TYPE_BOOLEAN;
6253 /* Line 1464 of skeleton.m4 */
6254 #line 2618 "parser.y"
6255 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_equals((yyval.value).c);
6256 (yyval.value).t = TYPE_BOOLEAN;
6266 /* Line 1464 of skeleton.m4 */
6267 #line 2621 "parser.y"
6268 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_strictequals((yyval.value).c);
6269 (yyval.value).t = TYPE_BOOLEAN;
6279 /* Line 1464 of skeleton.m4 */
6280 #line 2624 "parser.y"
6281 {(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);
6282 (yyval.value).t = TYPE_BOOLEAN;
6292 /* Line 1464 of skeleton.m4 */
6293 #line 2627 "parser.y"
6294 {(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);
6295 (yyval.value).t = TYPE_BOOLEAN;
6305 /* Line 1464 of skeleton.m4 */
6306 #line 2631 "parser.y"
6307 {(yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'O');
6308 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
6309 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t);
6310 (yyval.value).c = abc_dup((yyval.value).c);
6311 code_t*jmp = (yyval.value).c = abc_iftrue((yyval.value).c, 0);
6312 (yyval.value).c = cut_last_push((yyval.value).c);
6313 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
6314 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t);
6315 code_t*label = (yyval.value).c = abc_label((yyval.value).c);
6316 jmp->branch = label;
6326 /* Line 1464 of skeleton.m4 */
6327 #line 2642 "parser.y"
6329 (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'A');
6330 /*printf("%08x:\n",$1.t);
6331 code_dump($1.c, 0, 0, "", stdout);
6332 printf("%08x:\n",$3.t);
6333 code_dump($3.c, 0, 0, "", stdout);
6334 printf("joining %08x and %08x to %08x\n", $1.t, $3.t, $$.t);*/
6335 (yyval.value).c = (yyvsp[(1) - (3)].value).c;
6336 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t);
6337 (yyval.value).c = abc_dup((yyval.value).c);
6338 code_t*jmp = (yyval.value).c = abc_iffalse((yyval.value).c, 0);
6339 (yyval.value).c = cut_last_push((yyval.value).c);
6340 (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
6341 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t);
6342 code_t*label = (yyval.value).c = abc_label((yyval.value).c);
6343 jmp->branch = label;
6353 /* Line 1464 of skeleton.m4 */
6354 #line 2660 "parser.y"
6355 {(yyval.value).c=(yyvsp[(2) - (2)].value).c;
6356 (yyval.value).c = abc_not((yyval.value).c);
6357 (yyval.value).t = TYPE_BOOLEAN;
6367 /* Line 1464 of skeleton.m4 */
6368 #line 2665 "parser.y"
6369 {(yyval.value).c=(yyvsp[(2) - (2)].value).c;
6370 (yyval.value).c = abc_bitnot((yyval.value).c);
6371 (yyval.value).t = TYPE_INT;
6381 /* Line 1464 of skeleton.m4 */
6382 #line 2670 "parser.y"
6383 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6384 (yyval.value).c = abc_bitand((yyval.value).c);
6385 (yyval.value).t = TYPE_INT;
6395 /* Line 1464 of skeleton.m4 */
6396 #line 2675 "parser.y"
6397 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6398 (yyval.value).c = abc_bitxor((yyval.value).c);
6399 (yyval.value).t = TYPE_INT;
6409 /* Line 1464 of skeleton.m4 */
6410 #line 2680 "parser.y"
6411 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6412 (yyval.value).c = abc_bitor((yyval.value).c);
6413 (yyval.value).t = TYPE_INT;
6423 /* Line 1464 of skeleton.m4 */
6424 #line 2685 "parser.y"
6425 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6426 (yyval.value).c = abc_rshift((yyval.value).c);
6427 (yyval.value).t = TYPE_INT;
6437 /* Line 1464 of skeleton.m4 */
6438 #line 2689 "parser.y"
6439 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6440 (yyval.value).c = abc_urshift((yyval.value).c);
6441 (yyval.value).t = TYPE_INT;
6451 /* Line 1464 of skeleton.m4 */
6452 #line 2693 "parser.y"
6453 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6454 (yyval.value).c = abc_lshift((yyval.value).c);
6455 (yyval.value).t = TYPE_INT;
6465 /* Line 1464 of skeleton.m4 */
6466 #line 2698 "parser.y"
6467 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6468 (yyval.value).c = abc_divide((yyval.value).c);
6469 (yyval.value).t = TYPE_NUMBER;
6479 /* Line 1464 of skeleton.m4 */
6480 #line 2702 "parser.y"
6481 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6482 (yyval.value).c = abc_modulo((yyval.value).c);
6483 (yyval.value).t = TYPE_NUMBER;
6493 /* Line 1464 of skeleton.m4 */
6494 #line 2706 "parser.y"
6495 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6496 if(BOTH_INT((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t)) {
6497 (yyval.value).c = abc_add_i((yyval.value).c);
6498 (yyval.value).t = TYPE_INT;
6500 (yyval.value).c = abc_add((yyval.value).c);
6501 (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t,'+');
6512 /* Line 1464 of skeleton.m4 */
6513 #line 2715 "parser.y"
6514 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6515 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
6516 (yyval.value).c = abc_subtract_i((yyval.value).c);
6517 (yyval.value).t = TYPE_INT;
6519 (yyval.value).c = abc_subtract((yyval.value).c);
6520 (yyval.value).t = TYPE_NUMBER;
6531 /* Line 1464 of skeleton.m4 */
6532 #line 2724 "parser.y"
6533 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6534 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
6535 (yyval.value).c = abc_multiply_i((yyval.value).c);
6536 (yyval.value).t = TYPE_INT;
6538 (yyval.value).c = abc_multiply((yyval.value).c);
6539 (yyval.value).t = TYPE_NUMBER;
6550 /* Line 1464 of skeleton.m4 */
6551 #line 2734 "parser.y"
6552 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
6553 (yyval.value).c = abc_in((yyval.value).c);
6554 (yyval.value).t = TYPE_BOOLEAN;
6564 /* Line 1464 of skeleton.m4 */
6565 #line 2739 "parser.y"
6566 {char use_astype=0; // flash player's astype works differently than astypelate
6567 if(use_astype && TYPE_IS_CLASS((yyvsp[(3) - (3)].value).t)) {
6568 MULTINAME(m,(yyvsp[(3) - (3)].value).t->cls);
6569 (yyval.value).c = abc_astype2((yyvsp[(1) - (3)].value).c, &m);
6570 (yyval.value).t = (yyvsp[(3) - (3)].value).t->cls;
6572 (yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
6573 (yyval.value).c = abc_astypelate((yyval.value).c);
6574 (yyval.value).t = TYPE_ANY;
6585 /* Line 1464 of skeleton.m4 */
6586 #line 2752 "parser.y"
6587 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
6588 (yyval.value).c = abc_instanceof((yyval.value).c);
6589 (yyval.value).t = TYPE_BOOLEAN;
6599 /* Line 1464 of skeleton.m4 */
6600 #line 2757 "parser.y"
6601 {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
6602 (yyval.value).c = abc_istypelate((yyval.value).c);
6603 (yyval.value).t = TYPE_BOOLEAN;
6613 /* Line 1464 of skeleton.m4 */
6614 #line 2762 "parser.y"
6616 (yyval.value).c = (yyvsp[(3) - (4)].value).c;
6617 (yyval.value).c = abc_typeof((yyval.value).c);
6618 (yyval.value).t = TYPE_STRING;
6628 /* Line 1464 of skeleton.m4 */
6629 #line 2768 "parser.y"
6631 (yyval.value).c = cut_last_push((yyvsp[(2) - (2)].value).c);
6632 (yyval.value).c = abc_pushundefined((yyval.value).c);
6633 (yyval.value).t = TYPE_ANY;
6643 /* Line 1464 of skeleton.m4 */
6644 #line 2774 "parser.y"
6645 { (yyval.value).c = abc_pushundefined(0);
6646 (yyval.value).t = TYPE_ANY;
6656 /* Line 1464 of skeleton.m4 */
6657 #line 2778 "parser.y"
6658 {(yyval.value)=(yyvsp[(2) - (3)].value);}
6667 /* Line 1464 of skeleton.m4 */
6668 #line 2780 "parser.y"
6670 (yyval.value)=(yyvsp[(2) - (2)].value);
6671 if(IS_INT((yyvsp[(2) - (2)].value).t)) {
6672 (yyval.value).c=abc_negate_i((yyval.value).c);
6673 (yyval.value).t = TYPE_INT;
6675 (yyval.value).c=abc_negate((yyval.value).c);
6676 (yyval.value).t = TYPE_NUMBER;
6687 /* Line 1464 of skeleton.m4 */
6688 #line 2791 "parser.y"
6690 (yyval.value).c = (yyvsp[(1) - (4)].value).c;
6691 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value).c);
6693 MULTINAME_LATE(m, (yyvsp[(1) - (4)].value).t?(yyvsp[(1) - (4)].value).t->access:ACCESS_PACKAGE, "");
6694 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
6695 (yyval.value).t = 0; // array elements have unknown type
6705 /* Line 1464 of skeleton.m4 */
6706 #line 2800 "parser.y"
6708 (yyval.value).c = code_new();
6709 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc);
6710 (yyval.value).c = abc_newarray((yyval.value).c, (yyvsp[(2) - (3)].value_list).len);
6711 (yyval.value).t = registry_getarrayclass();
6721 /* Line 1464 of skeleton.m4 */
6722 #line 2807 "parser.y"
6723 {(yyval.value_list).cc=0;(yyval.value_list).len=0;}
6732 /* Line 1464 of skeleton.m4 */
6733 #line 2808 "parser.y"
6734 {(yyval.value_list)=(yyvsp[(1) - (1)].value_list);}
6743 /* Line 1464 of skeleton.m4 */
6744 #line 2810 "parser.y"
6746 (yyval.value_list).cc = 0;
6747 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(1) - (3)].value).c);
6748 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (3)].value).c);
6749 (yyval.value_list).len = 2;
6759 /* Line 1464 of skeleton.m4 */
6760 #line 2816 "parser.y"
6762 (yyval.value_list).cc = (yyvsp[(1) - (5)].value_list).cc;
6763 (yyval.value_list).len = (yyvsp[(1) - (5)].value_list).len+2;
6764 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (5)].value).c);
6765 (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(5) - (5)].value).c);
6775 /* Line 1464 of skeleton.m4 */
6776 #line 2825 "parser.y"
6778 (yyval.value).c = code_new();
6779 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc);
6780 (yyval.value).c = abc_newobject((yyval.value).c, (yyvsp[(2) - (3)].value_list).len/2);
6781 (yyval.value).t = registry_getobjectclass();
6791 /* Line 1464 of skeleton.m4 */
6792 #line 2832 "parser.y"
6794 code_t*c = (yyvsp[(3) - (3)].value).c;
6795 if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
6796 c=abc_multiply_i(c);
6800 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '*'), (yyvsp[(1) - (3)].value).t);
6801 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
6802 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
6812 /* Line 1464 of skeleton.m4 */
6813 #line 2844 "parser.y"
6815 code_t*c = abc_modulo((yyvsp[(3) - (3)].value).c);
6816 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '%'), (yyvsp[(1) - (3)].value).t);
6817 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
6818 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
6828 /* Line 1464 of skeleton.m4 */
6829 #line 2850 "parser.y"
6831 code_t*c = abc_lshift((yyvsp[(3) - (3)].value).c);
6832 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '<'), (yyvsp[(1) - (3)].value).t);
6833 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
6834 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
6844 /* Line 1464 of skeleton.m4 */
6845 #line 2856 "parser.y"
6847 code_t*c = abc_rshift((yyvsp[(3) - (3)].value).c);
6848 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '>'), (yyvsp[(1) - (3)].value).t);
6849 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
6850 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
6860 /* Line 1464 of skeleton.m4 */
6861 #line 2862 "parser.y"
6863 code_t*c = abc_urshift((yyvsp[(3) - (3)].value).c);
6864 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'U'), (yyvsp[(1) - (3)].value).t);
6865 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
6866 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
6876 /* Line 1464 of skeleton.m4 */
6877 #line 2868 "parser.y"
6879 code_t*c = abc_divide((yyvsp[(3) - (3)].value).c);
6880 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '/'), (yyvsp[(1) - (3)].value).t);
6881 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
6882 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
6892 /* Line 1464 of skeleton.m4 */
6893 #line 2874 "parser.y"
6895 code_t*c = abc_bitor((yyvsp[(3) - (3)].value).c);
6896 c=converttype(c, TYPE_INT, (yyvsp[(1) - (3)].value).t);
6897 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
6898 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
6908 /* Line 1464 of skeleton.m4 */
6909 #line 2880 "parser.y"
6911 code_t*c = (yyvsp[(3) - (3)].value).c;
6913 if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) {
6917 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '+'), (yyvsp[(1) - (3)].value).t);
6920 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
6921 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
6931 /* Line 1464 of skeleton.m4 */
6932 #line 2893 "parser.y"
6933 { code_t*c = (yyvsp[(3) - (3)].value).c;
6934 if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) {
6935 c=abc_subtract_i(c);
6938 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '-'), (yyvsp[(1) - (3)].value).t);
6941 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
6942 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
6952 /* Line 1464 of skeleton.m4 */
6953 #line 2904 "parser.y"
6955 c = code_append(c, (yyvsp[(3) - (3)].value).c);
6956 c = converttype(c, (yyvsp[(3) - (3)].value).t, (yyvsp[(1) - (3)].value).t);
6957 (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 1, 0);
6958 (yyval.value).t = (yyvsp[(1) - (3)].value).t;
6968 /* Line 1464 of skeleton.m4 */
6969 #line 2911 "parser.y"
6971 (yyval.value).t = join_types((yyvsp[(3) - (5)].value).t,(yyvsp[(5) - (5)].value).t,'?');
6972 (yyval.value).c = (yyvsp[(1) - (5)].value).c;
6973 code_t*j1 = (yyval.value).c = abc_iffalse((yyval.value).c, 0);
6974 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (5)].value).c);
6975 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (5)].value).t, (yyval.value).t);
6976 code_t*j2 = (yyval.value).c = abc_jump((yyval.value).c, 0);
6977 (yyval.value).c = j1->branch = abc_label((yyval.value).c);
6978 (yyval.value).c = code_append((yyval.value).c, (yyvsp[(5) - (5)].value).c);
6979 (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (5)].value).t, (yyval.value).t);
6980 (yyval.value).c = j2->branch = abc_label((yyval.value).c);
6990 /* Line 1464 of skeleton.m4 */
6991 #line 2924 "parser.y"
6993 classinfo_t*type = (yyvsp[(1) - (2)].value).t;
6994 if((is_getlocal((yyvsp[(1) - (2)].value).c) && TYPE_IS_INT((yyvsp[(1) - (2)].value).t)) || TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t)) {
6995 int nr = getlocalnr((yyvsp[(1) - (2)].value).c);
6996 code_free((yyvsp[(1) - (2)].value).c);(yyvsp[(1) - (2)].value).c=0;
6997 if(TYPE_IS_INT((yyvsp[(1) - (2)].value).t)) {
6998 (yyval.value).c = abc_getlocal(0, nr);
6999 (yyval.value).c = abc_inclocal_i((yyval.value).c, nr);
7000 } else if(TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t)) {
7001 (yyval.value).c = abc_getlocal(0, nr);
7002 (yyval.value).c = abc_inclocal((yyval.value).c, nr);
7003 } else syntaxerror("internal error");
7005 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7006 c=abc_increment_i(c);
7012 c=converttype(c, type, (yyvsp[(1) - (2)].value).t);
7013 (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1);
7014 (yyval.value).t = (yyvsp[(1) - (2)].value).t;
7025 /* Line 1464 of skeleton.m4 */
7026 #line 2951 "parser.y"
7028 classinfo_t*type = (yyvsp[(1) - (2)].value).t;
7029 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7030 c=abc_decrement_i(c);
7036 c=converttype(c, type, (yyvsp[(1) - (2)].value).t);
7037 (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1);
7038 (yyval.value).t = (yyvsp[(1) - (2)].value).t;
7048 /* Line 1464 of skeleton.m4 */
7049 #line 2965 "parser.y"
7051 classinfo_t*type = (yyvsp[(2) - (2)].value).t;
7052 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7053 c=abc_increment_i(c);
7059 c=converttype(c, type, (yyvsp[(2) - (2)].value).t);
7060 (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0);
7061 (yyval.value).t = (yyvsp[(2) - (2)].value).t;
7071 /* Line 1464 of skeleton.m4 */
7072 #line 2979 "parser.y"
7074 classinfo_t*type = (yyvsp[(2) - (2)].value).t;
7075 if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
7076 c=abc_decrement_i(c);
7082 c=converttype(c, type, (yyvsp[(2) - (2)].value).t);
7083 (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0);
7084 (yyval.value).t = (yyvsp[(2) - (2)].value).t;
7094 /* Line 1464 of skeleton.m4 */
7095 #line 2994 "parser.y"
7096 { if(!state->cls->info)
7097 syntaxerror("super keyword not allowed outside a class");
7098 classinfo_t*t = state->cls->info->superclass;
7099 if(!t) t = TYPE_OBJECT;
7101 memberinfo_t*f = registry_findmember(t, (yyvsp[(3) - (3)].id), 1);
7102 namespace_t ns = flags2namespace(f->flags, "");
7103 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
7104 (yyval.value).c = 0;
7105 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7106 (yyval.value).c = abc_getsuper2((yyval.value).c, &m);
7107 (yyval.value).t = memberinfo_gettype(f);
7117 /* Line 1464 of skeleton.m4 */
7118 #line 3009 "parser.y"
7119 {(yyval.value).c = (yyvsp[(1) - (3)].value).c;
7120 classinfo_t*t = (yyvsp[(1) - (3)].value).t;
7122 if(TYPE_IS_CLASS(t) && t->cls) {
7127 memberinfo_t*f = registry_findmember(t, (yyvsp[(3) - (3)].id), 1);
7129 if(f && !is_static != !(f->flags&FLAG_STATIC))
7131 if(f && f->slot && !noslot) {
7132 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
7134 MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
7135 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7137 /* determine type */
7138 (yyval.value).t = memberinfo_gettype(f);
7139 if(!(yyval.value).t)
7140 (yyval.value).c = abc_coerce_a((yyval.value).c);
7142 /* when resolving a property on an unknown type, we do know the
7143 name of the property (and don't seem to need the package), but
7144 we need to make avm2 try out all access modes */
7145 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
7146 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7147 (yyval.value).c = abc_coerce_a((yyval.value).c);
7148 (yyval.value).t = registry_getanytype();
7159 /* Line 1464 of skeleton.m4 */
7160 #line 3042 "parser.y"
7162 (yyval.value).t = 0;
7163 (yyval.value).c = 0;
7168 /* look at variables */
7169 if((v = find_variable((yyvsp[(1) - (1)].id)))) {
7170 // $1 is a local variable
7171 (yyval.value).c = abc_getlocal((yyval.value).c, v->index);
7172 (yyval.value).t = v->type;
7176 int i_am_static = (state->method && state->method->info)?(state->method->info->flags&FLAG_STATIC):FLAG_STATIC;
7178 /* look at current class' members */
7179 if(state->cls && (f = registry_findmember(state->cls->info, (yyvsp[(1) - (1)].id), 1)) &&
7180 (f->flags&FLAG_STATIC) >= i_am_static) {
7181 // $1 is a function in this class
7182 int var_is_static = (f->flags&FLAG_STATIC);
7184 if(f->kind == MEMBER_METHOD) {
7185 (yyval.value).t = TYPE_FUNCTION(f);
7187 (yyval.value).t = f->type;
7189 if(var_is_static && !i_am_static) {
7190 /* access to a static member from a non-static location.
7191 do this via findpropstrict:
7192 there doesn't seem to be any non-lookup way to access
7193 static properties of a class */
7194 state->method->late_binding = 1;
7195 (yyval.value).t = f->type;
7196 namespace_t ns = {flags2access(f->flags), ""};
7197 multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)};
7198 (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
7199 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7201 } else if(f->slot>0) {
7202 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7203 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
7206 namespace_t ns = {flags2access(f->flags), ""};
7207 multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)};
7208 (yyval.value).c = abc_getlocal_0((yyval.value).c);
7209 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7214 /* look at actual classes, in the current package and imported */
7215 if((a = find_class((yyvsp[(1) - (1)].id)))) {
7216 if(a->flags & FLAG_METHOD) {
7218 (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
7219 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7220 if(a->function->kind == MEMBER_METHOD) {
7221 (yyval.value).t = TYPE_FUNCTION(a->function);
7223 (yyval.value).t = a->function->type;
7227 (yyval.value).c = abc_getglobalscope((yyval.value).c);
7228 (yyval.value).c = abc_getslot((yyval.value).c, a->slot);
7231 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
7233 (yyval.value).t = TYPE_CLASS(a);
7238 /* unknown object, let the avm2 resolve it */
7240 as3_softwarning("Couldn't resolve '%s', doing late binding", (yyvsp[(1) - (1)].id));
7241 state->method->late_binding = 1;
7243 multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(1) - (1)].id)};
7245 (yyval.value).t = 0;
7246 (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
7247 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
7258 /* Line 1464 of skeleton.m4 */
7259 #line 3139 "parser.y"
7269 /* Line 1464 of skeleton.m4 */
7270 #line 3140 "parser.y"
7280 /* Line 1464 of skeleton.m4 */
7281 #line 3141 "parser.y"
7291 /* Line 1464 of skeleton.m4 */
7292 #line 3143 "parser.y"
7300 /* Line 1464 of skeleton.m4 */
7301 #line 7302 "parser.tab.c"
7304 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
7308 YY_STACK_PRINT (yyss, yyssp);
7312 /* Now `shift' the result of the reduction. Determine what state
7313 that goes to, based on the state we popped back to and the rule
7314 number reduced by. */
7318 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
7319 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
7320 yystate = yytable[yystate];
7322 yystate = yydefgoto[yyn - YYNTOKENS];
7327 /*------------------------------------.
7328 | yyerrlab -- here on detecting error |
7329 `------------------------------------*/
7331 /* If not already recovering from an error, report this error. */
7335 #if ! YYERROR_VERBOSE
7336 yyerror (YY_("syntax error"));
7339 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
7340 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
7342 YYSIZE_T yyalloc = 2 * yysize;
7343 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
7344 yyalloc = YYSTACK_ALLOC_MAXIMUM;
7345 if (yymsg != yymsgbuf)
7346 YYSTACK_FREE (yymsg);
7347 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
7349 yymsg_alloc = yyalloc;
7353 yymsg_alloc = sizeof yymsgbuf;
7357 if (0 < yysize && yysize <= yymsg_alloc)
7359 (void) yysyntax_error (yymsg, yystate, yychar);
7364 yyerror (YY_("syntax error"));
7366 goto yyexhaustedlab;
7374 if (yyerrstatus == 3)
7376 /* If just tried and failed to reuse lookahead token after an
7377 error, discard it. */
7379 if (yychar <= YYEOF)
7381 /* Return failure if at end of input. */
7382 if (yychar == YYEOF)
7387 yydestruct ("Error: discarding",
7393 /* Else will try to reuse lookahead token after shifting the error
7398 /*---------------------------------------------------.
7399 | yyerrorlab -- error raised explicitly by YYERROR. |
7400 `---------------------------------------------------*/
7403 /* Pacify compilers like GCC when the user code never invokes
7404 YYERROR and the label yyerrorlab therefore never appears in user
7406 if (/*CONSTCOND*/ 0)
7409 /* Do not reclaim the symbols of the rule which action triggered
7413 YY_STACK_PRINT (yyss, yyssp);
7418 /*-------------------------------------------------------------.
7419 | yyerrlab1 -- common code for both syntax error and YYERROR. |
7420 `-------------------------------------------------------------*/
7422 yyerrstatus = 3; /* Each real token shifted decrements this. */
7426 yyn = yypact[yystate];
7427 if (yyn != YYPACT_NINF)
7430 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
7438 /* Pop the current state because it cannot handle the error token. */
7443 yydestruct ("Error: popping",
7444 yystos[yystate], yyvsp);
7447 YY_STACK_PRINT (yyss, yyssp);
7453 /* Shift the error token. */
7454 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
7460 /*-------------------------------------.
7461 | yyacceptlab -- YYACCEPT comes here. |
7462 `-------------------------------------*/
7467 /*-----------------------------------.
7468 | yyabortlab -- YYABORT comes here. |
7469 `-----------------------------------*/
7474 #if !defined(yyoverflow) || YYERROR_VERBOSE
7475 /*-------------------------------------------------.
7476 | yyexhaustedlab -- memory exhaustion comes here. |
7477 `-------------------------------------------------*/
7479 yyerror (YY_("memory exhausted"));
7485 if (yychar != YYEMPTY)
7486 yydestruct ("Cleanup: discarding lookahead",
7488 /* Do not reclaim the symbols of the rule which action triggered
7489 this YYABORT or YYACCEPT. */
7491 YY_STACK_PRINT (yyss, yyssp);
7492 while (yyssp != yyss)
7494 yydestruct ("Cleanup: popping",
7495 yystos[*yyssp], yyvsp);
7500 YYSTACK_FREE (yyss);
7503 if (yymsg != yymsgbuf)
7504 YYSTACK_FREE (yymsg);
7506 /* Make sure YYID is used. */
7507 return YYID (yyresult);