new test case ok/hide.as
[swftools.git] / lib / as3 / parser.tab.c
1
2 /* A Bison parser, made by GNU Bison 2.4.  */
3
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
5    
6       Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7    Free Software Foundation, Inc.
8    
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.
13    
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.
18    
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/>.  */
21
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.
31    
32    This special exception was added by the Free Software Foundation in
33    version 2.2 of Bison.  */
34
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36    simplifying the original so-called "semantic" parser.  */
37
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.  */
44
45 /* Identify Bison output.  */
46 #define YYBISON 1
47
48 /* Bison version.  */
49 #define YYBISON_VERSION "2.4"
50
51 /* Skeleton name.  */
52 #define YYSKELETON_NAME "yacc.c"
53
54 /* Pure parsers.  */
55 #define YYPURE 0
56
57 /* Push parsers.  */
58 #define YYPUSH 0
59
60 /* Pull parsers.  */
61 #define YYPULL 1
62
63 /* Using locations.  */
64 #define YYLSP_NEEDED 0
65
66 /* Substitute the variable and function names.  */
67 #define yyparse         avm2_parse
68 #define yylex           avm2_lex
69 #define yyerror         avm2_error
70 #define yylval          avm2_lval
71 #define yychar          avm2_char
72 #define yydebug         avm2_debug
73 #define yynerrs         avm2_nerrs
74
75
76 /* Copy the first part of user declarations.  */
77
78 /* Line 189 of yacc.c  */
79 #line 23 "parser.y"
80
81 #include <stdlib.h>
82 #include <stdio.h>
83 #include <memory.h>
84 #include "abc.h"
85 #include "pool.h"
86 #include "files.h"
87 #include "tokenizer.h"
88 #include "registry.h"
89 #include "code.h"
90 #include "opcodes.h"
91
92
93
94 /* Line 189 of yacc.c  */
95 #line 96 "parser.tab.c"
96
97 /* Enabling traces.  */
98 #ifndef YYDEBUG
99 # define YYDEBUG 0
100 #endif
101
102 /* Enabling verbose error messages.  */
103 #ifdef YYERROR_VERBOSE
104 # undef YYERROR_VERBOSE
105 # define YYERROR_VERBOSE 1
106 #else
107 # define YYERROR_VERBOSE 1
108 #endif
109
110 /* Enabling the token table.  */
111 #ifndef YYTOKEN_TABLE
112 # define YYTOKEN_TABLE 0
113 #endif
114
115
116 /* Tokens.  */
117 #ifndef YYTOKENTYPE
118 # define YYTOKENTYPE
119    /* Put the tokens into the symbol table, so that GDB and other debuggers
120       know about them.  */
121    enum yytokentype {
122      T_IDENTIFIER = 258,
123      T_STRING = 259,
124      T_REGEXP = 260,
125      T_EMPTY = 261,
126      T_INT = 262,
127      T_UINT = 263,
128      T_BYTE = 264,
129      T_SHORT = 265,
130      T_FLOAT = 266,
131      T_FOR = 267,
132      T_WHILE = 268,
133      T_DO = 269,
134      T_SWITCH = 270,
135      KW_IMPLEMENTS = 271,
136      KW_NAMESPACE = 272,
137      KW_PACKAGE = 273,
138      KW_PROTECTED = 274,
139      KW_PUBLIC = 275,
140      KW_PRIVATE = 276,
141      KW_USE = 277,
142      KW_INTERNAL = 278,
143      KW_NEW = 279,
144      KW_NATIVE = 280,
145      KW_FUNCTION = 281,
146      KW_FINALLY = 282,
147      KW_UNDEFINED = 283,
148      KW_CONTINUE = 284,
149      KW_CLASS = 285,
150      KW_CONST = 286,
151      KW_CATCH = 287,
152      KW_CASE = 288,
153      KW_SET = 289,
154      KW_VOID = 290,
155      KW_THROW = 291,
156      KW_STATIC = 292,
157      KW_WITH = 293,
158      KW_INSTANCEOF = 294,
159      KW_IMPORT = 295,
160      KW_RETURN = 296,
161      KW_TYPEOF = 297,
162      KW_INTERFACE = 298,
163      KW_NULL = 299,
164      KW_VAR = 300,
165      KW_DYNAMIC = 301,
166      KW_OVERRIDE = 302,
167      KW_FINAL = 303,
168      KW_EACH = 304,
169      KW_GET = 305,
170      KW_TRY = 306,
171      KW_SUPER = 307,
172      KW_EXTENDS = 308,
173      KW_FALSE = 309,
174      KW_TRUE = 310,
175      KW_BOOLEAN = 311,
176      KW_UINT = 312,
177      KW_INT = 313,
178      KW_NUMBER = 314,
179      KW_STRING = 315,
180      KW_DEFAULT = 316,
181      KW_DELETE = 317,
182      KW_IF = 318,
183      KW_ELSE = 319,
184      KW_BREAK = 320,
185      KW_IS = 321,
186      KW_IN = 322,
187      KW_AS = 323,
188      T_EQEQ = 324,
189      T_EQEQEQ = 325,
190      T_NE = 326,
191      T_NEE = 327,
192      T_LE = 328,
193      T_GE = 329,
194      T_ORBY = 330,
195      T_DIVBY = 331,
196      T_MODBY = 332,
197      T_MULBY = 333,
198      T_PLUSBY = 334,
199      T_MINUSBY = 335,
200      T_SHRBY = 336,
201      T_SHLBY = 337,
202      T_USHRBY = 338,
203      T_OROR = 339,
204      T_ANDAND = 340,
205      T_COLONCOLON = 341,
206      T_MINUSMINUS = 342,
207      T_PLUSPLUS = 343,
208      T_DOTDOT = 344,
209      T_DOTDOTDOT = 345,
210      T_SHL = 346,
211      T_USHR = 347,
212      T_SHR = 348,
213      prec_none = 349,
214      below_semicolon = 350,
215      below_assignment = 351,
216      below_minus = 354,
217      minusminus_prefix = 355,
218      plusplus_prefix = 356,
219      below_curly = 357,
220      above_identifier = 358,
221      below_else = 359,
222      above_function = 360
223    };
224 #endif
225
226
227
228 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
229 typedef union 
230 /* Line 214 of yacc.c  */
231 #line 41 "parser.y"
232 tokenunion
233 {
234
235 /* Line 214 of yacc.c  */
236 #line 41 "parser.y"
237
238     enum yytokentype token;
239     int flags;
240
241     classinfo_t*classinfo;
242     classinfo_list_t*classinfo_list;
243
244     int number_int;
245     unsigned int number_uint;
246     double number_float;
247     code_t*code;
248     typedcode_t value;
249     //typedcode_list_t*value_list;
250     codeandnumber_t value_list;
251     param_t* param;
252     params_t params;
253     string_t str;
254     char*id;
255     constant_t*constant;
256     for_start_t for_start;
257     abc_exception_t *exception;
258     regexp_t regexp;
259     struct {
260         abc_exception_list_t *l;
261         code_t*finally;
262     } catch_list;
263
264
265
266 /* Line 214 of yacc.c  */
267 #line 268 "parser.tab.c"
268 } YYSTYPE;
269 # define YYSTYPE_IS_TRIVIAL 1
270 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
271 # define YYSTYPE_IS_DECLARED 1
272 #endif
273
274
275 /* Copy the second part of user declarations.  */
276
277 /* Line 264 of yacc.c  */
278 #line 251 "parser.y"
279
280
281 static int yyerror(char*s)
282 {
283    syntaxerror("%s", s); 
284    return 0; //make gcc happy
285 }
286
287 static char* concat2(const char* t1, const char* t2)
288 {
289     int l1 = strlen(t1);
290     int l2 = strlen(t2);
291     char*text = malloc(l1+l2+1);
292     memcpy(text   , t1, l1);
293     memcpy(text+l1, t2, l2);
294     text[l1+l2] = 0;
295     return text;
296 }
297 static char* concat3(const char* t1, const char* t2, const char* t3)
298 {
299     int l1 = strlen(t1);
300     int l2 = strlen(t2);
301     int l3 = strlen(t3);
302     char*text = malloc(l1+l2+l3+1);
303     memcpy(text   , t1, l1);
304     memcpy(text+l1, t2, l2);
305     memcpy(text+l1+l2, t3, l3);
306     text[l1+l2+l3] = 0;
307     return text;
308 }
309
310 typedef struct _import {
311     char*package;
312 } import_t;
313
314 DECLARE_LIST(import);
315
316 typedef struct _classstate {
317     /* class data */
318     classinfo_t*info;
319     abc_class_t*abc;
320     code_t*init;
321     code_t*static_init;
322     char has_constructor;
323 } classstate_t;
324
325 typedef struct _methodstate {
326     /* method data */
327     memberinfo_t*info;
328     char late_binding;
329     char is_constructor;
330     char has_super;
331     char is_global;
332     abc_exception_list_t*exceptions;
333 } methodstate_t;
334
335 typedef struct _state {
336     struct _state*old;
337     int level;
338     
339     char*package;     
340     import_list_t*wildcard_imports;
341     dict_t*imports;
342     char has_own_imports;
343   
344     classstate_t*cls;   
345     methodstate_t*method;
346
347     char*exception_name;
348     
349     dict_t*vars;
350 } state_t;
351
352 typedef struct _global {
353     abc_file_t*file;
354     abc_script_t*init;
355
356     int variable_count;
357 } global_t;
358
359 static global_t*global = 0;
360 static state_t* state = 0;
361
362 DECLARE_LIST(state);
363
364 #define MULTINAME(m,x) \
365     multiname_t m;\
366     namespace_t m##_ns;\
367     registry_fill_multiname(&m, &m##_ns, x);
368                     
369 #define MEMBER_MULTINAME(m,f,n) \
370     multiname_t m;\
371     namespace_t m##_ns;\
372     if(f) { \
373         m##_ns = flags2namespace(f->flags, ""); \
374         m.type = QNAME; \
375         m.ns = &m##_ns; \
376         m.namespace_set = 0; \
377         m.name = f->name; \
378     } else { \
379         m.type = MULTINAME; \
380         m.ns =0; \
381         m.namespace_set = &nopackage_namespace_set; \
382         m.name = n; \
383     }
384
385 /* warning: list length of namespace set is undefined */
386 #define MULTINAME_LATE(m, access, package) \
387     namespace_t m##_ns = {access, package}; \
388     namespace_set_t m##_nsset; \
389     namespace_list_t m##_l;m##_l.next = 0; \
390     m##_nsset.namespaces = &m##_l; \
391     m##_nsset = m##_nsset; \
392     m##_l.namespace = &m##_ns; \
393     multiname_t m = {MULTINAMEL, 0, &m##_nsset, 0};
394
395 static namespace_t ns1 = {ACCESS_PRIVATE, ""};
396 static namespace_t ns2 = {ACCESS_PROTECTED, ""};
397 static namespace_t ns3 = {ACCESS_PACKAGEINTERNAL, ""};
398 static namespace_t ns4 = {ACCESS_PACKAGE, ""};
399 static namespace_list_t nl4 = {&ns4,0};
400 static namespace_list_t nl3 = {&ns3,&nl4};
401 static namespace_list_t nl2 = {&ns2,&nl3};
402 static namespace_list_t nl1 = {&ns1,&nl2};
403 static namespace_set_t nopackage_namespace_set = {&nl1};
404
405 static void new_state()
406 {
407     NEW(state_t, s);
408     state_t*oldstate = state;
409     if(state)
410         memcpy(s, state, sizeof(state_t)); //shallow copy
411     if(!s->imports) {
412         s->imports = dict_new();
413     }
414     state = s;
415     state->level++;
416     state->has_own_imports = 0;    
417     state->vars = dict_new(); 
418     state->old = oldstate;
419 }
420 static void state_has_imports()
421 {
422     state->wildcard_imports = list_clone(state->wildcard_imports);
423     state->imports = dict_clone(state->imports);
424     state->has_own_imports = 1;
425 }
426
427 static void state_destroy(state_t*state)
428 {
429     if(state->has_own_imports) {
430         list_free(state->wildcard_imports);
431         dict_destroy(state->imports);state->imports=0;
432     }
433     if(state->imports && (!state->old || state->old->imports!=state->imports)) {
434         dict_destroy(state->imports);state->imports=0;
435     }
436     if(state->vars) {
437         int t;
438         for(t=0;t<state->vars->hashsize;t++) {
439             dictentry_t*e =state->vars->slots[t];
440             while(e) {
441                 free(e->data);e->data=0;
442                 e = e->next;
443             }
444         }
445         dict_destroy(state->vars);state->vars=0;
446     }
447     
448     free(state);
449 }
450
451 static void old_state()
452 {
453     if(!state || !state->old)
454         syntaxerror("invalid nesting");
455     state_t*leaving = state;
456     
457     state = state->old;
458     state_destroy(leaving);
459 }
460
461 void initialize_parser()
462 {
463     global = rfx_calloc(sizeof(global_t));
464     global->file = abc_file_new();
465     global->file->flags &= ~ABCFILE_LAZY;
466     global->variable_count = 1;
467     global->init = abc_initscript(global->file);
468     code_t*c = global->init->method->body->code;
469     c = abc_getlocal_0(c);
470     c = abc_pushscope(c);
471     /*c = abc_findpropstrict(c, "[package]::trace");
472     c = abc_pushstring(c, "[entering global init function]");
473     c = abc_callpropvoid(c, "[package]::trace", 1);*/
474     global->init->method->body->code = c;
475 }
476
477 void initialize_file(char*filename)
478 {
479     new_state();
480     state->package = filename;
481     // needed for state->method->late_binding:
482     state->method = rfx_calloc(sizeof(methodstate_t));
483 }
484 void finish_file()
485 {
486     if(!state || state->level!=1) {
487         syntaxerror("unexpected end of file");
488     }
489     state_destroy(state);state=0;
490 }
491
492 void* finish_parser()
493 {
494     code_t*c = global->init->method->body->code;
495     /*c = abc_findpropstrict(c, "[package]::trace");
496       c = abc_pushstring(c, "[leaving global init function]");
497       c = abc_callpropvoid(c, "[package]::trace", 1);*/
498     c = abc_returnvoid(c);
499     global->init->method->body->code = c;
500     return global->file;
501 }
502
503
504 static void xx_scopetest() 
505 {
506     /* findpropstrict doesn't just return a scope object- it
507        also makes it "active" somehow. Push local_0 on the
508        scope stack and read it back with findpropstrict, it'll
509        contain properties like "trace". Trying to find the same
510        property on a "vanilla" local_0 yields only a "undefined" */
511     //c = abc_findpropstrict(c, "[package]::trace");
512     
513     /*c = abc_getlocal_0(c);
514     c = abc_findpropstrict(c, "[package]::trace");
515     c = abc_coerce_a(c);
516     c = abc_setlocal_1(c);
517
518     c = abc_pushbyte(c, 0);
519     c = abc_setlocal_2(c);
520    
521     code_t*xx = c = abc_label(c);
522     c = abc_findpropstrict(c, "[package]::trace");
523     c = abc_pushstring(c, "prop:");
524     c = abc_hasnext2(c, 1, 2);
525     c = abc_dup(c);
526     c = abc_setlocal_3(c);
527     c = abc_callpropvoid(c, "[package]::trace", 2);
528     c = abc_getlocal_3(c);
529     c = abc_kill(c, 3);
530     c = abc_iftrue(c,xx);*/
531 }
532
533
534 typedef struct _variable {
535     int index;
536     classinfo_t*type;
537     char init;
538 } variable_t;
539
540 static variable_t* find_variable(char*name)
541 {
542     state_t* s = state;
543     while(s) {
544         variable_t*v = 0;
545         if(s->method)
546             v = dict_lookup(s->vars, name);
547         if(v) {
548             return v;
549         }
550         s = s->old;
551     }
552     return 0;
553
554 static variable_t* find_variable_safe(char*name)
555 {
556     variable_t* v = find_variable(name);
557     if(!v)
558         syntaxerror("undefined variable: %s", name);
559     return v;
560 }
561 static char variable_exists(char*name) 
562 {
563     return dict_lookup(state->vars, name)!=0;
564 }
565 code_t*defaultvalue(code_t*c, classinfo_t*type);
566 static int new_variable(char*name, classinfo_t*type, char init)
567 {
568     NEW(variable_t, v);
569     v->index = global->variable_count;
570     v->type = type;
571     v->init = init;
572     
573     dict_put(state->vars, name, v);
574
575     return global->variable_count++;
576 }
577 #define TEMPVARNAME "__as3_temp__"
578 static int gettempvar()
579 {
580     variable_t*v = find_variable(TEMPVARNAME);
581     if(v) 
582         return v->index;
583     return new_variable(TEMPVARNAME, 0, 0);
584 }
585
586 code_t* var_block(code_t*body) 
587 {
588     code_t*c = 0;
589     code_t*k = 0;
590     int t;
591     int num=0;
592     for(t=0;t<state->vars->hashsize;t++) {
593         dictentry_t*e = state->vars->slots[t];
594         while(e) {
595             variable_t*v = (variable_t*)e->data;
596             if(v->type && v->init) {
597                 c = defaultvalue(c, v->type);
598                 c = abc_setlocal(c, v->index);
599                 k = abc_kill(k, v->index); 
600                 num++;
601             }
602             e = e->next;
603         }
604     }
605
606     if(k) {
607         code_t*x = body;
608         while(x) {
609             if(x->opcode== OPCODE___BREAK__ ||
610                x->opcode== OPCODE___CONTINUE__) {
611                /* link kill code before break/continue */
612                 code_t*e = code_dup(k);
613                 code_t*s = code_start(e);
614                 s->prev = x->prev;
615                 if(x->prev) {
616                     x->prev->next = s;
617                 }
618                 e->next = x;
619                 x->prev = e;
620             }
621             x = x->prev;
622         }
623     }
624     
625     c = code_append(c, body);
626     c = code_append(c, k);
627     return c;
628 }
629
630 static code_t* wrap_function(code_t*c,code_t*header, code_t*body)
631 {
632     c = code_append(c, header);
633     c = code_append(c, var_block(body));
634     /* append return if necessary */
635     if(!c || (c->opcode != OPCODE_RETURNVOID && 
636               c->opcode != OPCODE_RETURNVALUE)) {
637         c = abc_returnvoid(c);
638     }
639     return c;
640 }
641
642
643 static void startpackage(char*name)
644 {
645     new_state();
646     /*printf("entering package \"%s\"\n", name);*/
647     state->package = strdup(name);
648     global->variable_count = 1;
649 }
650 static void endpackage()
651 {
652     /*printf("leaving package \"%s\"\n", state->package);*/
653
654     //used e.g. in classinfo_register:
655     //free(state->package);state->package=0;
656
657     old_state();
658 }
659
660 char*as3_globalclass=0;
661 static void startclass(int flags, char*classname, classinfo_t*extends, classinfo_list_t*implements, char interface)
662 {
663     if(state->cls) {
664         syntaxerror("inner classes now allowed"); 
665     }
666     new_state();
667     global->variable_count = 1;
668     state->cls = rfx_calloc(sizeof(classstate_t));
669     state->method = rfx_calloc(sizeof(methodstate_t)); // method state, for static constructor
670
671     token_list_t*t=0;
672     classinfo_list_t*mlist=0;
673
674     if(flags&~(FLAG_PACKAGEINTERNAL|FLAG_PUBLIC|FLAG_FINAL|FLAG_DYNAMIC))
675         syntaxerror("invalid modifier(s)");
676
677     if((flags&(FLAG_PUBLIC|FLAG_PACKAGEINTERNAL)) == (FLAG_PUBLIC|FLAG_PACKAGEINTERNAL))
678         syntaxerror("public and internal not supported at the same time.");
679
680     /* create the class name, together with the proper attributes */
681     int access=0;
682     char*package=0;
683
684     if(!(flags&FLAG_PUBLIC) && !state->package) {
685         access = ACCESS_PRIVATE; package = current_filename;
686     } else if(!(flags&FLAG_PUBLIC) && state->package) {
687         access = ACCESS_PACKAGEINTERNAL; package = state->package;
688     } else if(state->package) {
689         access = ACCESS_PACKAGE; package = state->package;
690     } else {
691         syntaxerror("public classes only allowed inside a package");
692     }
693
694     if(registry_findclass(package, classname)) {
695         syntaxerror("Package \"%s\" already contains a class called \"%s\"", package, classname);
696     }
697    
698
699     /* build info struct */
700     int num_interfaces = (list_length(implements));
701     state->cls->info = classinfo_register(access, package, classname, num_interfaces);
702     state->cls->info->superclass = extends?extends:TYPE_OBJECT;
703     int pos = 0;
704     classinfo_list_t*l = implements;
705     for(l=implements;l;l=l->next) {
706         state->cls->info->interfaces[pos++] = l->classinfo;
707     }
708     
709     multiname_t*extends2 = sig2mname(extends);
710
711     MULTINAME(classname2,state->cls->info);
712
713     /*if(extends) {
714         state->cls_init = abc_getlocal_0(state->cls_init);
715         state->cls_init = abc_constructsuper(state->cls_init, 0);
716     }*/
717
718     state->cls->abc = abc_class_new(global->file, &classname2, extends2);
719     if(flags&FLAG_FINAL) abc_class_final(state->cls->abc);
720     if(!(flags&FLAG_DYNAMIC)) abc_class_sealed(state->cls->abc);
721     if(interface) {
722         state->cls->info->flags |= CLASS_INTERFACE;
723         abc_class_interface(state->cls->abc);
724     }
725
726     abc_class_protectedNS(state->cls->abc, classname);
727
728     for(mlist=implements;mlist;mlist=mlist->next) {
729         MULTINAME(m, mlist->classinfo);
730         abc_class_add_interface(state->cls->abc, &m);
731     }
732
733     /* now write the construction code for this class */
734     int slotindex = abc_initscript_addClassTrait(global->init, &classname2, state->cls->abc);
735
736     abc_method_body_t*m = global->init->method->body;
737     __ getglobalscope(m);
738     classinfo_t*s = extends;
739
740     int count=0;
741     
742     while(s) {
743         //TODO: take a look at the current scope stack, maybe 
744         //      we can re-use something
745         s = s->superclass;
746         if(!s) 
747         break;
748        
749         multiname_t*s2 = sig2mname(s);
750         __ getlex2(m, s2);
751         multiname_destroy(s2);
752
753         __ pushscope(m); count++;
754         m->code = m->code->prev->prev; // invert
755     }
756     /* continue appending after last op end */
757     while(m->code && m->code->next) m->code = m->code->next; 
758
759     /* TODO: if this is one of *our* classes, we can also 
760              do a getglobalscope/getslot <nr> (which references
761              the init function's slots) */
762     if(extends2) {
763         __ getlex2(m, extends2);
764         __ dup(m);
765         /* notice: we get a Verify Error #1107 if the top elemnt on the scope
766            stack is not the superclass */
767         __ pushscope(m);count++;
768     } else {
769         __ pushnull(m);
770         /* notice: we get a verify error #1107 if the top element on the scope 
771            stack is not the global object */
772         __ getlocal_0(m);
773         __ pushscope(m);count++;
774     }
775     __ newclass(m,state->cls->abc);
776     while(count--) {
777         __ popscope(m);
778     }
779     __ setslot(m, slotindex);
780
781     /* flash.display.MovieClip handling */
782     if(!as3_globalclass && (flags&FLAG_PUBLIC) && classinfo_equals(registry_getMovieClip(),extends)) {
783         if(state->package && state->package[0]) {
784             as3_globalclass = concat3(state->package, ".", classname);
785         } else {
786             as3_globalclass = strdup(classname);
787         }
788     }
789     multiname_destroy(extends2);
790 }
791
792 static void endclass()
793 {
794     if(!state->cls->has_constructor && !(state->cls->info->flags&CLASS_INTERFACE)) {
795         code_t*c = 0;
796         c = abc_getlocal_0(c);
797         c = abc_constructsuper(c, 0);
798         state->cls->init = code_append(state->cls->init, c);
799     }
800     if(!state->method->late_binding) {
801         // class initialization code uses late binding
802         code_t*c = 0;
803         c = abc_getlocal_0(c);
804         c = abc_pushscope(c);
805         state->cls->static_init = code_append(c, state->cls->static_init);
806     }
807
808     if(state->cls->init) {
809         abc_method_t*m = abc_class_getconstructor(state->cls->abc, 0);
810         m->body->code = wrap_function(0, state->cls->init, m->body->code);
811     }
812     if(state->cls->static_init) {
813         abc_method_t*m = abc_class_getstaticconstructor(state->cls->abc, 0);
814         m->body->code = wrap_function(0, state->cls->static_init, m->body->code);
815     }
816
817     free(state->cls);state->cls=0;
818     free(state->method);state->method=0;
819     old_state();
820 }
821
822 void check_code_for_break(code_t*c)
823 {
824     while(c) {
825         if(c->opcode == OPCODE___BREAK__) {
826             char*name = string_cstr(c->data[0]);
827             syntaxerror("Unresolved \"break %s\"", name);
828         }
829         if(c->opcode == OPCODE___CONTINUE__) {
830             char*name = string_cstr(c->data[0]);
831             syntaxerror("Unresolved \"continue %s\"", name);
832         }
833         c=c->prev;
834     }
835 }
836
837
838 static void check_constant_against_type(classinfo_t*t, constant_t*c)
839 {
840 #define xassert(b) if(!(b)) syntaxerror("Invalid default value %s for type '%s'", constant_tostring(c), t->name)
841    if(TYPE_IS_NUMBER(t)) {
842         xassert(c->type == CONSTANT_FLOAT
843              || c->type == CONSTANT_INT
844              || c->type == CONSTANT_UINT);
845    } else if(TYPE_IS_UINT(t)) {
846         xassert(c->type == CONSTANT_UINT ||
847                (c->type == CONSTANT_INT && c->i>0));
848    } else if(TYPE_IS_INT(t)) {
849         xassert(c->type == CONSTANT_INT);
850    } else if(TYPE_IS_BOOLEAN(t)) {
851         xassert(c->type == CONSTANT_TRUE
852              || c->type == CONSTANT_FALSE);
853    }
854 }
855
856
857 static int flags2access(int flags)
858 {
859     int access = 0;
860     if(flags&FLAG_PUBLIC)  {
861         if(access&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL)) 
862             syntaxerror("invalid combination of access levels");
863         access = ACCESS_PACKAGE;
864     } else if(flags&FLAG_PRIVATE) {
865         if(access&(FLAG_PUBLIC|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL)) 
866             syntaxerror("invalid combination of access levels");
867         access = ACCESS_PRIVATE;
868     } else if(flags&FLAG_PROTECTED) {
869         if(access&(FLAG_PUBLIC|FLAG_PRIVATE|FLAG_PACKAGEINTERNAL)) 
870             syntaxerror("invalid combination of access levels");
871         access = ACCESS_PROTECTED;
872     } else {
873         access = ACCESS_PACKAGEINTERNAL;
874     }
875     return access;
876 }
877
878
879 static memberinfo_t*registerfunction(enum yytokentype getset, int flags, char*name, params_t*params, classinfo_t*return_type, int slot)
880 {
881     memberinfo_t*minfo = 0;
882     if(!state->cls) {
883         //package method
884         minfo = memberinfo_register_global(flags2access(flags), state->package, name, MEMBER_METHOD);
885         minfo->return_type = return_type;
886     } else if(getset != KW_GET && getset != KW_SET) {
887         //class method
888         if((minfo = registry_findmember(state->cls->info, name, 0))) {
889             if(minfo->parent == state->cls->info) {
890                 syntaxerror("class already contains a member/method called '%s'", name);
891             } else if(!minfo->parent) {
892                 syntaxerror("internal error: overriding method %s, which doesn't have parent", name);
893             } else {
894                 if(!(minfo->flags&(FLAG_STATIC|FLAG_PRIVATE)))
895                     syntaxerror("function %s already exists in superclass. Did you forget the 'override' keyword?");
896             }
897         }
898         minfo = memberinfo_register(state->cls->info, name, MEMBER_METHOD);
899         minfo->return_type = return_type;
900         // getslot on a member slot only returns "undefined", so no need
901         // to actually store these
902         //state->minfo->slot = state->method->abc->method->trait->slot_id;
903     } else {
904         //class getter/setter
905         int gs = getset==KW_GET?MEMBER_GET:MEMBER_SET;
906         classinfo_t*type=0;
907         if(getset == KW_GET)
908             type = return_type;
909         else if(params->list)
910             type = params->list->param->type;
911         // not sure wether to look into superclasses here, too
912         if((minfo=registry_findmember(state->cls->info, name, 0))) {
913             if(minfo->kind & ~(MEMBER_GET|MEMBER_SET))
914                 syntaxerror("class already contains a member or method called '%s'", name);
915             if(minfo->kind & gs)
916                 syntaxerror("getter/setter for '%s' already defined", name);
917             /* make a setter or getter into a getset */
918             minfo->kind |= gs;
919             if(!minfo->type) 
920                 minfo->type = type;
921             else
922                 if(type && minfo->type != type)
923                     syntaxerror("different type in getter and setter");
924         } else {
925             minfo = memberinfo_register(state->cls->info, name, gs);
926             minfo->type = type;
927         }
928         /* can't assign a slot as getter and setter might have different slots */
929         //minfo->slot = slot;
930     }
931     if(flags&FLAG_STATIC) minfo->flags |= FLAG_STATIC;
932     if(flags&FLAG_PUBLIC) minfo->flags |= FLAG_PUBLIC;
933     if(flags&FLAG_PRIVATE) minfo->flags |= FLAG_PRIVATE;
934     if(flags&FLAG_PROTECTED) minfo->flags |= FLAG_PROTECTED;
935     if(flags&FLAG_PACKAGEINTERNAL) minfo->flags |= FLAG_PACKAGEINTERNAL;
936     if(flags&FLAG_OVERRIDE) minfo->flags |= FLAG_OVERRIDE;
937     return minfo;
938 }
939
940 static void startfunction(token_t*ns, int flags, enum yytokentype getset, char*name,
941                           params_t*params, classinfo_t*return_type)
942 {
943     if(state->method && state->method->info) {
944         syntaxerror("not able to start another method scope");
945     }
946     new_state();
947     global->variable_count = 0;
948     state->method = rfx_calloc(sizeof(methodstate_t));
949     state->method->has_super = 0;
950
951     if(state->cls) {
952         state->method->is_constructor = !strcmp(state->cls->info->name,name);
953         state->cls->has_constructor |= state->method->is_constructor;
954         
955         new_variable((flags&FLAG_STATIC)?"class":"this", state->cls->info, 0);
956     } else {
957         state->method->is_global = 1;
958         state->method->late_binding = 1; // for global methods, always push local_0 on the scope stack
959
960         new_variable("globalscope", 0, 0);
961     }
962
963     /* state->vars is initialized by state_new */
964
965     param_list_t*p=0;
966     for(p=params->list;p;p=p->next) {
967         new_variable(p->param->name, p->param->type, 0);
968     }
969     if(state->method->is_constructor)
970         name = "__as3_constructor__";
971     state->method->info = registerfunction(getset, flags, name, params, return_type, 0);
972 }
973
974 static void endfunction(token_t*ns, int flags, enum yytokentype getset, char*name,
975                           params_t*params, classinfo_t*return_type, code_t*body)
976 {
977     abc_method_t*f = 0;
978
979     multiname_t*type2 = sig2mname(return_type);
980     int slot = 0;
981     if(state->method->is_constructor) {
982         f = abc_class_getconstructor(state->cls->abc, type2);
983     } else if(!state->method->is_global) {
984         namespace_t mname_ns = flags2namespace(flags, "");
985         multiname_t mname = {QNAME, &mname_ns, 0, name};
986
987         if(flags&FLAG_STATIC)
988             f = abc_class_staticmethod(state->cls->abc, type2, &mname);
989         else
990             f = abc_class_method(state->cls->abc, type2, &mname);
991         slot = f->trait->slot_id;
992     } else {
993         namespace_t mname_ns = flags2namespace(flags, state->package);
994         multiname_t mname = {QNAME, &mname_ns, 0, name};
995
996         f = abc_method_new(global->file, type2, 1);
997         trait_t*t = trait_new_method(&global->init->traits, multiname_clone(&mname), f);
998         //abc_code_t*c = global->init->method->body->code;
999     }
1000     //flash doesn't seem to allow us to access function slots
1001     //state->method->info->slot = slot;
1002
1003     if(flags&FLAG_OVERRIDE) f->trait->attributes |= TRAIT_ATTR_OVERRIDE;
1004     if(getset == KW_GET) f->trait->kind = TRAIT_GETTER;
1005     if(getset == KW_SET) f->trait->kind = TRAIT_SETTER;
1006     if(params->varargs) f->flags |= METHOD_NEED_REST;
1007
1008     char opt=0;
1009     param_list_t*p=0;
1010     for(p=params->list;p;p=p->next) {
1011         if(params->varargs && !p->next) {
1012             break; //varargs: omit last parameter in function signature
1013         }
1014         multiname_t*m = sig2mname(p->param->type);
1015         list_append(f->parameters, m);
1016         if(p->param->value) {
1017             check_constant_against_type(p->param->type, p->param->value);
1018             opt=1;list_append(f->optional_parameters, p->param->value);
1019         } else if(opt) {
1020             syntaxerror("non-optional parameter not allowed after optional parameters");
1021         }
1022     }
1023     check_code_for_break(body);
1024
1025     if(f->body) {
1026         f->body->code = body;
1027         f->body->exceptions = state->method->exceptions;
1028     } else { //interface
1029         if(body)
1030             syntaxerror("interface methods can't have a method body");
1031     }
1032        
1033     free(state->method);state->method=0;
1034     old_state();
1035 }
1036
1037
1038
1039 char is_subtype_of(classinfo_t*type, classinfo_t*supertype)
1040 {
1041     return 1; // FIXME
1042 }
1043
1044 void breakjumpsto(code_t*c, char*name, code_t*jump) 
1045 {
1046     while(c) {
1047         if(c->opcode == OPCODE___BREAK__) {
1048             string_t*name2 = c->data[0];
1049             if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1050                 c->opcode = OPCODE_JUMP;
1051                 c->branch = jump;
1052             }
1053         }
1054         c=c->prev;
1055     }
1056 }
1057 void continuejumpsto(code_t*c, char*name, code_t*jump) 
1058 {
1059     while(c) {
1060         if(c->opcode == OPCODE___CONTINUE__) {
1061             string_t*name2 = c->data[0];
1062             if(!name2->len || !strncmp(name2->str, name, name2->len)) {
1063                 c->opcode = OPCODE_JUMP;
1064                 c->branch = jump;
1065             }
1066         }
1067         c = c->prev;
1068     }
1069 }
1070
1071 #define IS_INT(a) (TYPE_IS_INT((a)) || TYPE_IS_UINT((a)))
1072 #define IS_NUMBER_OR_INT(a) (TYPE_IS_INT((a)) || TYPE_IS_UINT((a)) || TYPE_IS_NUMBER((a)))
1073 #define BOTH_INT(a,b) (IS_INT(a) && IS_INT(b))
1074
1075 classinfo_t*join_types(classinfo_t*type1, classinfo_t*type2, char op)
1076 {
1077     if(!type1 || !type2) 
1078         return registry_getanytype();
1079     if(TYPE_IS_ANY(type1) || TYPE_IS_ANY(type2))
1080         return registry_getanytype();
1081
1082     if(op=='+') {
1083         if(IS_NUMBER_OR_INT(type1) && IS_NUMBER_OR_INT(type2)) {
1084             return TYPE_NUMBER;
1085         } else {
1086             return TYPE_ANY;
1087         }
1088     }
1089
1090     if(type1 == type2)
1091         return type1;
1092     return registry_getanytype();
1093 }
1094 code_t*converttype(code_t*c, classinfo_t*from, classinfo_t*to)
1095 {
1096     if(from==to)
1097         return c;
1098     if(!to) {
1099         return abc_coerce_a(c);
1100     }
1101     MULTINAME(m, to);
1102     if(!from) {
1103         // cast an "any" type to a specific type. subject to
1104         // runtime exceptions
1105         return abc_coerce2(c, &m);
1106     }
1107     
1108     if((TYPE_IS_NUMBER(from) || TYPE_IS_UINT(from) || TYPE_IS_INT(from)) &&
1109        (TYPE_IS_NUMBER(to) || TYPE_IS_UINT(to) || TYPE_IS_INT(to))) {
1110         // allow conversion between number types
1111         return abc_coerce2(c, &m);
1112     }
1113     //printf("%s.%s\n", from.package, from.name);
1114     //printf("%s.%s\n", to.package, to.name);
1115
1116     classinfo_t*supertype = from;
1117     while(supertype) {
1118         if(supertype == to) {
1119              // target type is one of from's superclasses
1120              return abc_coerce2(c, &m);
1121         }
1122         int t=0;
1123         while(supertype->interfaces[t]) {
1124             if(supertype->interfaces[t]==to) {
1125                 // target type is one of from's interfaces
1126                 return abc_coerce2(c, &m);
1127             }
1128             t++;
1129         }
1130         supertype = supertype->superclass;
1131     }
1132     if(TYPE_IS_FUNCTION(from) && TYPE_IS_FUNCTION(to))
1133         return c;
1134     if(TYPE_IS_CLASS(from) && TYPE_IS_CLASS(to))
1135         return c;
1136     syntaxerror("can't convert type %s to %s", from->name, to->name);
1137     return 0; // make gcc happy
1138 }
1139
1140 code_t*defaultvalue(code_t*c, classinfo_t*type)
1141 {
1142     if(TYPE_IS_INT(type)) {
1143        c = abc_pushbyte(c, 0);
1144     } else if(TYPE_IS_UINT(type)) {
1145        c = abc_pushuint(c, 0);
1146     } else if(TYPE_IS_FLOAT(type)) {
1147        c = abc_pushnan(c);
1148     } else if(TYPE_IS_BOOLEAN(type)) {
1149        c = abc_pushfalse(c);
1150     } else if(!type) {
1151        //c = abc_pushundefined(c);
1152     } else {
1153        c = abc_pushnull(c);
1154        MULTINAME(m, type);
1155        c = abc_coerce2(c, &m);
1156     }
1157     return c;
1158 }
1159
1160 char is_pushundefined(code_t*c)
1161 {
1162     return (c && !c->prev && !c->next && c->opcode == OPCODE_PUSHUNDEFINED);
1163 }
1164
1165 void parserassert(int b)
1166 {
1167     if(!b) syntaxerror("internal error: assertion failed");
1168 }
1169
1170 static classinfo_t* find_class(char*name)
1171 {
1172     classinfo_t*c=0;
1173
1174     c = registry_findclass(state->package, name);
1175     if(c) return c;
1176
1177     /* try explicit imports */
1178     dictentry_t* e = dict_get_slot(state->imports, name);
1179     if(c) return c;
1180     while(e) {
1181         if(!strcmp(e->key, name)) {
1182             c = (classinfo_t*)e->data;
1183             if(c) return c;
1184         }
1185         e = e->next;
1186     }
1187
1188     /* try package.* imports */
1189     import_list_t*l = state->wildcard_imports;
1190     while(l) {
1191         //printf("does package %s contain a class %s?\n", l->import->package, name);
1192         c = registry_findclass(l->import->package, name);
1193         if(c) return c;
1194         l = l->next;
1195     }
1196
1197     /* try global package */
1198     c = registry_findclass("", name);
1199     if(c) return c;
1200    
1201     /* try local "filename" package */
1202     c = registry_findclass(current_filename, name);
1203     if(c) return c;
1204
1205     return 0;
1206 }
1207
1208 static char is_getlocal(code_t*c)
1209 {
1210     if(!c || c->prev || c->next)
1211         return 0;
1212     return(c->opcode == OPCODE_GETLOCAL
1213         || c->opcode == OPCODE_GETLOCAL_0
1214         || c->opcode == OPCODE_GETLOCAL_1
1215         || c->opcode == OPCODE_GETLOCAL_2
1216         || c->opcode == OPCODE_GETLOCAL_3);
1217 }
1218 static int getlocalnr(code_t*c)
1219 {
1220     if(c->opcode == OPCODE_GETLOCAL) {return (ptroff_t)c->data[0];}
1221     else if(c->opcode == OPCODE_GETLOCAL_0) {return 0;}
1222     else if(c->opcode == OPCODE_GETLOCAL_1) {return 1;}
1223     else if(c->opcode == OPCODE_GETLOCAL_2) {return 2;}
1224     else if(c->opcode == OPCODE_GETLOCAL_3) {return 3;}
1225     else syntaxerror("Internal error: opcode %02x is not a getlocal call", c->opcode);
1226     return 0;
1227 }
1228
1229 static code_t* toreadwrite(code_t*in, code_t*middlepart, char justassign, char readbefore)
1230 {
1231     /* converts this:
1232
1233        [prefix code] [read instruction]
1234
1235        to this:
1236
1237        [prefix code] ([dup]) [read instruction] [middlepart] [setvar] [write instruction] [getvar]
1238     */
1239     
1240     if(in && in->opcode == OPCODE_COERCE_A) {
1241         in = code_cutlast(in);
1242     }
1243     if(in->next)
1244         syntaxerror("internal error");
1245
1246     /* chop off read instruction */
1247     code_t*prefix = in;
1248     code_t*r = in;
1249     if(r->prev) {
1250         prefix = r->prev;r->prev = 0;
1251         prefix->next=0;
1252     } else {
1253         prefix = 0;
1254     }
1255
1256     char use_temp_var = readbefore;
1257
1258     /* generate the write instruction, and maybe append a dup to the prefix code */
1259     code_t* write = abc_nop(0);
1260     if(r->opcode == OPCODE_GETPROPERTY) {
1261         write->opcode = OPCODE_SETPROPERTY;
1262         multiname_t*m = (multiname_t*)r->data[0];
1263         write->data[0] = multiname_clone(m);
1264         if(m->type == QNAME || m->type == MULTINAME) {
1265             if(!justassign) {
1266                 prefix = abc_dup(prefix); // we need the object, too
1267             }
1268             use_temp_var = 1;
1269         } else if(m->type == MULTINAMEL) {
1270             if(!justassign) {
1271                 /* dupping two values on the stack requires 5 operations and one register- 
1272                    couldn't adobe just have given us a dup2? */
1273                 int temp = gettempvar();
1274                 prefix = abc_setlocal(prefix, temp);
1275                 prefix = abc_dup(prefix);
1276                 prefix = abc_getlocal(prefix, temp);
1277                 prefix = abc_swap(prefix);
1278                 prefix = abc_getlocal(prefix, temp);
1279                 if(!use_temp_var);
1280                     prefix = abc_kill(prefix, temp);
1281             }
1282             use_temp_var = 1;
1283         } else {
1284             syntaxerror("illegal lvalue: can't assign a value to this expression (not a qname/multiname)");
1285         }
1286     } else if(r->opcode == OPCODE_GETSLOT) {
1287         write->opcode = OPCODE_SETSLOT;
1288         write->data[0] = r->data[0];
1289         if(!justassign) {
1290             prefix = abc_dup(prefix); // we need the object, too
1291         }
1292         use_temp_var = 1;
1293     } else if(r->opcode == OPCODE_GETLOCAL) { 
1294         write->opcode = OPCODE_SETLOCAL;
1295         write->data[0] = r->data[0];
1296     } else if(r->opcode == OPCODE_GETLOCAL_0) { 
1297         write->opcode = OPCODE_SETLOCAL_0;
1298     } else if(r->opcode == OPCODE_GETLOCAL_1) { 
1299         write->opcode = OPCODE_SETLOCAL_1;
1300     } else if(r->opcode == OPCODE_GETLOCAL_2) { 
1301         write->opcode = OPCODE_SETLOCAL_2;
1302     } else if(r->opcode == OPCODE_GETLOCAL_3) { 
1303         write->opcode = OPCODE_SETLOCAL_3;
1304     } else {
1305         code_dump(r);
1306         syntaxerror("illegal lvalue: can't assign a value to this expression");
1307     }
1308     code_t* c = 0;
1309     
1310     int temp = -1;
1311     if(!justassign) {
1312         if(use_temp_var) {
1313             /* with getproperty/getslot, we have to be extra careful not
1314                to execute the read code twice, as it might have side-effects
1315                (e.g. if the property is in fact a setter/getter combination)
1316
1317                So read the value, modify it, and write it again,
1318                using prefix only once and making sure (by using a temporary
1319                register) that the return value is what we just wrote */
1320             temp = gettempvar();
1321             c = code_append(c, prefix);
1322             c = code_append(c, r);
1323             if(readbefore) {
1324                 c = abc_dup(c);
1325                 c = abc_setlocal(c, temp);
1326             }
1327             c = code_append(c, middlepart);
1328             if(!readbefore) {
1329                 c = abc_dup(c);
1330                 c = abc_setlocal(c, temp);
1331             }
1332             c = code_append(c, write);
1333             c = abc_getlocal(c, temp);
1334             c = abc_kill(c, temp);
1335         } else {
1336             /* if we're allowed to execute the read code twice *and*
1337                the middlepart doesn't modify the code, things are easier.
1338             */
1339             code_t* r2 = code_dup(r);
1340             //c = code_append(c, prefix);
1341             parserassert(!prefix);
1342             c = code_append(c, r);
1343             c = code_append(c, middlepart);
1344             c = code_append(c, write);
1345             c = code_append(c, r2);
1346         }
1347     } else {
1348         /* even smaller version: overwrite the value without reading
1349            it out first */
1350         if(!use_temp_var) {
1351             if(prefix) {
1352                 c = code_append(c, prefix);
1353                 c = abc_dup(c);
1354             }
1355             c = code_append(c, middlepart);
1356             c = code_append(c, write);
1357             c = code_append(c, r);
1358         } else {
1359             temp = gettempvar();
1360             if(prefix) {
1361                 c = code_append(c, prefix);
1362             }
1363             c = code_append(c, middlepart);
1364             c = abc_dup(c);
1365             c = abc_setlocal(c, temp);
1366             c = code_append(c, write);
1367             c = abc_getlocal(c, temp);
1368             c = abc_kill(c, temp);
1369         }
1370     }
1371     return c;
1372 }
1373
1374 char is_break_or_jump(code_t*c)
1375 {
1376     if(!c)
1377         return 0;
1378     if(c->opcode == OPCODE_JUMP ||
1379        c->opcode == OPCODE___BREAK__ ||
1380        c->opcode == OPCODE___CONTINUE__ ||
1381        c->opcode == OPCODE_THROW ||
1382        c->opcode == OPCODE_RETURNVOID ||
1383        c->opcode == OPCODE_RETURNVALUE) {
1384        return 1;
1385     }
1386     return 0;
1387 }
1388
1389
1390 #define IS_FINALLY_TARGET(op) \
1391         ((op) == OPCODE___CONTINUE__ || \
1392          (op) == OPCODE___BREAK__ || \
1393          (op) == OPCODE_RETURNVOID || \
1394          (op) == OPCODE_RETURNVALUE || \
1395          (op) == OPCODE___RETHROW__)
1396
1397 static code_t* insert_finally_lookup(code_t*c, code_t*finally, int tempvar)
1398 {
1399 #define NEED_EXTRA_STACK_ARG
1400     code_t*finally_label = abc_nop(0);
1401     NEW(lookupswitch_t, l);
1402     //_lookupswitch
1403
1404     code_t*i = c;
1405     int count=0;
1406     while(i) {
1407         code_t*prev = i->prev;
1408         if(IS_FINALLY_TARGET(i->opcode)) {
1409            code_t*p = prev;
1410            char needvalue=0;
1411            if(i->opcode == OPCODE___RETHROW__ ||
1412               i->opcode == OPCODE_RETURNVALUE) {
1413                if(i->opcode == OPCODE___RETHROW__)
1414                  i->opcode = OPCODE_THROW;
1415                needvalue=1;
1416                p = abc_coerce_a(p);
1417                p = abc_setlocal(p, tempvar);
1418            }
1419            p = abc_pushbyte(p, count++);
1420            p = abc_jump(p, finally_label);
1421            code_t*target = p = abc_label(p);
1422 #ifdef NEED_EXTRA_STACK_ARG
1423            p = abc_pop(p);
1424 #endif
1425            if(needvalue) {
1426                p = abc_getlocal(p, tempvar);
1427            }
1428
1429            p->next = i;i->prev = p;
1430            list_append(l->targets, target);
1431         }
1432         i = prev;
1433     }
1434
1435     code_t*j,*f;
1436     c = abc_pushbyte(c, -1);
1437     c = code_append(c, finally_label);
1438     c = code_append(c, finally);
1439
1440 #ifdef NEED_EXTRA_STACK_ARG
1441     c = abc_dup(c);
1442 #endif
1443     c = abc_lookupswitch(c, l);
1444     c = l->def = abc_label(c);
1445 #ifdef NEED_EXTRA_STACK_ARG
1446     c = abc_pop(c);
1447 #endif
1448
1449     return c;
1450 }
1451
1452 static code_t* insert_finally_simple(code_t*c, code_t*finally, int tempvar)
1453 {
1454     code_t*i = c;
1455     while(i) {
1456         code_t*prev = i->prev;
1457         if(IS_FINALLY_TARGET(i->opcode)) {
1458            if(i->opcode == OPCODE___RETHROW__)
1459                 i->opcode = OPCODE_THROW;
1460            code_t*end = code_dup(finally);
1461            code_t*start = code_start(end);
1462            if(prev) prev->next = start;
1463            start->prev = prev;
1464            i->prev = end;
1465            end->next = i;
1466         }
1467         i = prev;
1468     }
1469     return code_append(c, finally);
1470 }
1471
1472 code_t* insert_finally(code_t*c, code_t*finally, int tempvar)
1473 {
1474     if(!finally)
1475         return c;
1476     code_t*i = c;
1477     char cantdup=0;
1478     int num_insertion_points=0;
1479     while(i) {
1480         if(IS_FINALLY_TARGET(i->opcode))
1481             num_insertion_points++;
1482         i = i->prev;
1483     }
1484     i = finally;
1485     int code_size=0;
1486     while(i) {
1487         code_size++;
1488         if(i->branch || i->opcode == OPCODE_LOOKUPSWITCH) {
1489             cantdup=1;
1490         }
1491         i = i->prev;
1492     }
1493     int simple_version_cost = (1+num_insertion_points)*code_size;
1494     int lookup_version_cost = 4*num_insertion_points + 5;
1495
1496     if(cantdup || simple_version_cost > lookup_version_cost) {
1497         printf("lookup %d > *%d*\n", simple_version_cost, lookup_version_cost);
1498         return insert_finally_lookup(c, finally, tempvar);
1499     } else {
1500         printf("simple *%d* < %d\n", simple_version_cost, lookup_version_cost);
1501         return insert_finally_simple(c, finally, tempvar);
1502     }
1503 }
1504
1505
1506
1507 /* Line 264 of yacc.c  */
1508 #line 1509 "parser.tab.c"
1509
1510 #ifdef short
1511 # undef short
1512 #endif
1513
1514 #ifdef YYTYPE_UINT8
1515 typedef YYTYPE_UINT8 yytype_uint8;
1516 #else
1517 typedef unsigned char yytype_uint8;
1518 #endif
1519
1520 #ifdef YYTYPE_INT8
1521 typedef YYTYPE_INT8 yytype_int8;
1522 #elif (defined __STDC__ || defined __C99__FUNC__ \
1523      || defined __cplusplus || defined _MSC_VER)
1524 typedef signed char yytype_int8;
1525 #else
1526 typedef short int yytype_int8;
1527 #endif
1528
1529 #ifdef YYTYPE_UINT16
1530 typedef YYTYPE_UINT16 yytype_uint16;
1531 #else
1532 typedef unsigned short int yytype_uint16;
1533 #endif
1534
1535 #ifdef YYTYPE_INT16
1536 typedef YYTYPE_INT16 yytype_int16;
1537 #else
1538 typedef short int yytype_int16;
1539 #endif
1540
1541 #ifndef YYSIZE_T
1542 # ifdef __SIZE_TYPE__
1543 #  define YYSIZE_T __SIZE_TYPE__
1544 # elif defined size_t
1545 #  define YYSIZE_T size_t
1546 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
1547      || defined __cplusplus || defined _MSC_VER)
1548 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1549 #  define YYSIZE_T size_t
1550 # else
1551 #  define YYSIZE_T unsigned int
1552 # endif
1553 #endif
1554
1555 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
1556
1557 #ifndef YY_
1558 # if YYENABLE_NLS
1559 #  if ENABLE_NLS
1560 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1561 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
1562 #  endif
1563 # endif
1564 # ifndef YY_
1565 #  define YY_(msgid) msgid
1566 # endif
1567 #endif
1568
1569 /* Suppress unused-variable warnings by "using" E.  */
1570 #if ! defined lint || defined __GNUC__
1571 # define YYUSE(e) ((void) (e))
1572 #else
1573 # define YYUSE(e) /* empty */
1574 #endif
1575
1576 /* Identity function, used to suppress warnings about constant conditions.  */
1577 #ifndef lint
1578 # define YYID(n) (n)
1579 #else
1580 #if (defined __STDC__ || defined __C99__FUNC__ \
1581      || defined __cplusplus || defined _MSC_VER)
1582 static int
1583 YYID (int yyi)
1584 #else
1585 static int
1586 YYID (yyi)
1587     int yyi;
1588 #endif
1589 {
1590   return yyi;
1591 }
1592 #endif
1593
1594 #if ! defined yyoverflow || YYERROR_VERBOSE
1595
1596 /* The parser invokes alloca or malloc; define the necessary symbols.  */
1597
1598 # ifdef YYSTACK_USE_ALLOCA
1599 #  if YYSTACK_USE_ALLOCA
1600 #   ifdef __GNUC__
1601 #    define YYSTACK_ALLOC __builtin_alloca
1602 #   elif defined __BUILTIN_VA_ARG_INCR
1603 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1604 #   elif defined _AIX
1605 #    define YYSTACK_ALLOC __alloca
1606 #   elif defined _MSC_VER
1607 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1608 #    define alloca _alloca
1609 #   else
1610 #    define YYSTACK_ALLOC alloca
1611 #    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1612      || defined __cplusplus || defined _MSC_VER)
1613 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1614 #     ifndef _STDLIB_H
1615 #      define _STDLIB_H 1
1616 #     endif
1617 #    endif
1618 #   endif
1619 #  endif
1620 # endif
1621
1622 # ifdef YYSTACK_ALLOC
1623    /* Pacify GCC's `empty if-body' warning.  */
1624 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
1625 #  ifndef YYSTACK_ALLOC_MAXIMUM
1626     /* The OS might guarantee only one guard page at the bottom of the stack,
1627        and a page size can be as small as 4096 bytes.  So we cannot safely
1628        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
1629        to allow for a few compiler-allocated temporary stack slots.  */
1630 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1631 #  endif
1632 # else
1633 #  define YYSTACK_ALLOC YYMALLOC
1634 #  define YYSTACK_FREE YYFREE
1635 #  ifndef YYSTACK_ALLOC_MAXIMUM
1636 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1637 #  endif
1638 #  if (defined __cplusplus && ! defined _STDLIB_H \
1639        && ! ((defined YYMALLOC || defined malloc) \
1640              && (defined YYFREE || defined free)))
1641 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1642 #   ifndef _STDLIB_H
1643 #    define _STDLIB_H 1
1644 #   endif
1645 #  endif
1646 #  ifndef YYMALLOC
1647 #   define YYMALLOC malloc
1648 #   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1649      || defined __cplusplus || defined _MSC_VER)
1650 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1651 #   endif
1652 #  endif
1653 #  ifndef YYFREE
1654 #   define YYFREE free
1655 #   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1656      || defined __cplusplus || defined _MSC_VER)
1657 void free (void *); /* INFRINGES ON USER NAME SPACE */
1658 #   endif
1659 #  endif
1660 # endif
1661 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1662
1663
1664 #if (! defined yyoverflow \
1665      && (! defined __cplusplus \
1666          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1667
1668 /* A type that is properly aligned for any stack member.  */
1669 union yyalloc
1670 {
1671   yytype_int16 yyss_alloc;
1672   YYSTYPE yyvs_alloc;
1673 };
1674
1675 /* The size of the maximum gap between one aligned stack and the next.  */
1676 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1677
1678 /* The size of an array large to enough to hold all stacks, each with
1679    N elements.  */
1680 # define YYSTACK_BYTES(N) \
1681      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1682       + YYSTACK_GAP_MAXIMUM)
1683
1684 /* Copy COUNT objects from FROM to TO.  The source and destination do
1685    not overlap.  */
1686 # ifndef YYCOPY
1687 #  if defined __GNUC__ && 1 < __GNUC__
1688 #   define YYCOPY(To, From, Count) \
1689       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1690 #  else
1691 #   define YYCOPY(To, From, Count)              \
1692       do                                        \
1693         {                                       \
1694           YYSIZE_T yyi;                         \
1695           for (yyi = 0; yyi < (Count); yyi++)   \
1696             (To)[yyi] = (From)[yyi];            \
1697         }                                       \
1698       while (YYID (0))
1699 #  endif
1700 # endif
1701
1702 /* Relocate STACK from its old location to the new one.  The
1703    local variables YYSIZE and YYSTACKSIZE give the old and new number of
1704    elements in the stack, and YYPTR gives the new location of the
1705    stack.  Advance YYPTR to a properly aligned location for the next
1706    stack.  */
1707 # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
1708     do                                                                  \
1709       {                                                                 \
1710         YYSIZE_T yynewbytes;                                            \
1711         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
1712         Stack = &yyptr->Stack_alloc;                                    \
1713         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1714         yyptr += yynewbytes / sizeof (*yyptr);                          \
1715       }                                                                 \
1716     while (YYID (0))
1717
1718 #endif
1719
1720 /* YYFINAL -- State number of the termination state.  */
1721 #define YYFINAL  119
1722 /* YYLAST -- Last index in YYTABLE.  */
1723 #define YYLAST   2463
1724
1725 /* YYNTOKENS -- Number of terminals.  */
1726 #define YYNTOKENS  130
1727 /* YYNNTS -- Number of nonterminals.  */
1728 #define YYNNTS  105
1729 /* YYNRULES -- Number of rules.  */
1730 #define YYNRULES  285
1731 /* YYNRULES -- Number of states.  */
1732 #define YYNSTATES  478
1733
1734 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
1735 #define YYUNDEFTOK  2
1736 #define YYMAXUTOK   360
1737
1738 #define YYTRANSLATE(YYX)                                                \
1739   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1740
1741 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
1742 static const yytype_uint8 yytranslate[] =
1743 {
1744        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1745        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1746        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1747        2,     2,     2,   116,     2,     2,     2,   114,   106,     2,
1748      126,   129,   113,   111,    97,   110,   123,   112,     2,     2,
1749        2,     2,     2,     2,     2,     2,     2,     2,   103,    96,
1750      107,    99,   108,   102,     2,     2,     2,     2,     2,     2,
1751        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1752        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1753        2,   120,     2,   121,   105,     2,     2,     2,     2,     2,
1754        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1755        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1756        2,     2,     2,   122,   104,   128,   115,     2,     2,     2,
1757        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1758        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1759        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1760        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1761        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1762        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1763        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1764        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1765        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1766        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1767        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1768        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
1769        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
1770        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
1771       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
1772       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
1773       35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
1774       45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
1775       55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
1776       65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
1777       75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
1778       85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
1779       95,    98,   100,   101,   109,   117,   118,   119,   124,   125,
1780      127
1781 };
1782
1783 #if YYDEBUG
1784 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1785    YYRHS.  */
1786 static const yytype_uint16 yyprhs[] =
1787 {
1788        0,     0,     3,     5,     6,     8,    10,    13,    15,    17,
1789       19,    21,    23,    25,    27,    28,    30,    32,    35,    37,
1790       39,    41,    43,    45,    47,    49,    50,    53,    55,    57,
1791       59,    61,    63,    65,    67,    69,    71,    73,    75,    77,
1792       79,    81,    83,    85,    87,    89,    91,    93,    97,   100,
1793      103,   105,   107,   110,   111,   114,   117,   119,   123,   127,
1794      128,   131,   132,   140,   141,   143,   145,   149,   151,   154,
1795      158,   167,   174,   175,   182,   183,   191,   193,   196,   198,
1796      201,   202,   204,   206,   209,   211,   214,   219,   223,   224,
1797      233,   234,   244,   245,   251,   253,   256,   258,   261,   263,
1798      264,   271,   274,   276,   282,   284,   286,   290,   292,   293,
1799      300,   301,   307,   310,   315,   316,   318,   320,   323,   325,
1800      327,   329,   331,   333,   335,   337,   339,   341,   342,   345,
1801      346,   349,   350,   353,   354,   364,   365,   374,   375,   377,
1802      379,   382,   384,   386,   388,   390,   391,   393,   395,   398,
1803      400,   403,   412,   414,   416,   422,   423,   426,   428,   430,
1804      432,   434,   436,   438,   440,   442,   443,   445,   448,   453,
1805      457,   459,   464,   467,   469,   471,   472,   473,   486,   488,
1806      489,   499,   501,   505,   507,   509,   511,   515,   517,   519,
1807      521,   524,   525,   526,   530,   531,   533,   535,   539,   543,
1808      548,   553,   556,   558,   561,   563,   565,   569,   571,   573,
1809      575,   577,   579,   581,   583,   585,   587,   589,   591,   593,
1810      595,   597,   599,   601,   603,   605,   609,   613,   617,   621,
1811      625,   629,   633,   637,   641,   645,   648,   651,   655,   659,
1812      663,   667,   671,   675,   679,   683,   687,   691,   695,   699,
1813      703,   707,   711,   716,   719,   721,   725,   728,   733,   737,
1814      738,   740,   744,   750,   754,   758,   762,   766,   770,   774,
1815      778,   782,   786,   790,   794,   800,   803,   806,   809,   812,
1816      816,   820,   822,   826,   832,   838
1817 };
1818
1819 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
1820 static const yytype_int16 yyrhs[] =
1821 {
1822      131,     0,    -1,   132,    -1,    -1,   133,    -1,   134,    -1,
1823      133,   134,    -1,   180,    -1,   192,    -1,   190,    -1,   208,
1824       -1,   201,    -1,   143,    -1,    96,    -1,    -1,   136,    -1,
1825      137,    -1,   136,   137,    -1,   192,    -1,   190,    -1,   208,
1826       -1,   201,    -1,   143,    -1,    96,    -1,   139,    -1,    -1,
1827      139,   141,    -1,   141,    -1,   183,    -1,   154,    -1,   155,
1828       -1,   156,    -1,   158,    -1,   166,    -1,   149,    -1,   177,
1829       -1,   174,    -1,   227,    -1,    96,    -1,   140,    -1,   145,
1830       -1,   160,    -1,   161,    -1,   224,    -1,   176,    -1,   233,
1831       -1,   234,    -1,   122,   139,   128,    -1,   122,   128,    -1,
1832      141,    96,    -1,   141,    -1,   140,    -1,    99,   225,    -1,
1833       -1,    45,   146,    -1,    31,   146,    -1,   147,    -1,   146,
1834       97,   147,    -1,     3,   217,   144,    -1,    -1,    64,   142,
1835       -1,    -1,    63,   126,   150,   226,   129,   142,   148,    -1,
1836       -1,   145,    -1,   227,    -1,    45,     3,   217,    -1,     3,
1837       -1,    12,   126,    -1,    12,    49,   126,    -1,   153,   151,
1838       96,   226,    96,   227,   129,   142,    -1,   153,   152,    67,
1839      226,   129,   142,    -1,    -1,    13,   126,   157,   226,   129,
1840      142,    -1,    -1,    14,   159,   142,    13,   126,   226,   129,
1841       -1,    65,    -1,    65,     3,    -1,    29,    -1,    29,     3,
1842       -1,    -1,   163,    -1,   165,    -1,   163,   165,    -1,   164,
1843       -1,   163,   164,    -1,    33,   228,   103,   138,    -1,    61,
1844      103,   138,    -1,    -1,    15,   126,   167,   228,   129,   122,
1845      162,   128,    -1,    -1,    32,   126,     3,   217,   129,   169,
1846      122,   138,   128,    -1,    -1,    27,   122,   171,   138,   128,
1847       -1,   168,    -1,   172,   168,    -1,   172,    -1,   172,   170,
1848       -1,   170,    -1,    -1,    51,   122,   175,   138,   128,   173,
1849       -1,    36,   226,    -1,    36,    -1,    38,   126,   226,   129,
1850      142,    -1,     3,    -1,    18,    -1,   179,   123,   178,    -1,
1851      178,    -1,    -1,    18,   179,   122,   181,   135,   128,    -1,
1852       -1,    18,   122,   182,   135,   128,    -1,    40,   214,    -1,
1853       40,   179,   123,   113,    -1,    -1,   185,    -1,   186,    -1,
1854      185,   186,    -1,    20,    -1,    21,    -1,    19,    -1,    37,
1855       -1,    46,    -1,    48,    -1,    47,    -1,    25,    -1,    23,
1856       -1,    -1,    53,   214,    -1,    -1,    53,   215,    -1,    -1,
1857       16,   215,    -1,    -1,   184,    30,     3,   187,   189,   122,
1858      191,   194,   128,    -1,    -1,   184,    43,     3,   188,   122,
1859      193,   197,   128,    -1,    -1,   195,    -1,   196,    -1,   195,
1860      196,    -1,    96,    -1,   201,    -1,   208,    -1,   140,    -1,
1861       -1,   198,    -1,   199,    -1,   198,   199,    -1,    96,    -1,
1862       45,     3,    -1,   184,    26,   207,     3,   126,   204,   129,
1863      217,    -1,    45,    -1,    31,    -1,   184,   200,     3,   217,
1864      144,    -1,    -1,    99,   203,    -1,     9,    -1,     7,    -1,
1865        8,    -1,    11,    -1,     4,    -1,    55,    -1,    54,    -1,
1866       44,    -1,    -1,   205,    -1,    90,   206,    -1,   205,    97,
1867       90,   206,    -1,   205,    97,   206,    -1,   206,    -1,     3,
1868      103,   216,   202,    -1,     3,   202,    -1,    50,    -1,    34,
1869       -1,    -1,    -1,   184,    26,   207,     3,   126,   204,   129,
1870      217,   122,   209,   138,   128,    -1,     3,    -1,    -1,    26,
1871      210,   126,   204,   129,   217,   122,   138,   128,    -1,     3,
1872       -1,   179,   123,     3,    -1,   213,    -1,   212,    -1,   214,
1873       -1,   215,    97,   214,    -1,   214,    -1,   113,    -1,    35,
1874       -1,   103,   216,    -1,    -1,    -1,   126,   219,   129,    -1,
1875       -1,   220,    -1,   225,    -1,   220,    97,   225,    -1,    24,
1876      212,   218,    -1,   228,   126,   219,   129,    -1,    52,   126,
1877      219,   129,    -1,    62,   228,    -1,    41,    -1,    41,   226,
1878       -1,   228,    -1,   228,    -1,   226,    97,   228,    -1,   226,
1879       -1,   211,    -1,   229,    -1,   232,    -1,   221,    -1,   223,
1880       -1,     5,    -1,     9,    -1,    10,    -1,     7,    -1,     8,
1881       -1,    11,    -1,     4,    -1,    28,    -1,    55,    -1,    54,
1882       -1,    44,    -1,   222,    -1,   228,   107,   228,    -1,   228,
1883      108,   228,    -1,   228,    73,   228,    -1,   228,    74,   228,
1884       -1,   228,    69,   228,    -1,   228,    70,   228,    -1,   228,
1885       72,   228,    -1,   228,    71,   228,    -1,   228,    84,   228,
1886       -1,   228,    85,   228,    -1,   116,   228,    -1,   115,   228,
1887       -1,   228,   106,   228,    -1,   228,   105,   228,    -1,   228,
1888      104,   228,    -1,   228,    93,   228,    -1,   228,    92,   228,
1889       -1,   228,    91,   228,    -1,   228,   112,   228,    -1,   228,
1890      114,   228,    -1,   228,   111,   228,    -1,   228,   110,   228,
1891       -1,   228,   113,   228,    -1,   228,    67,   228,    -1,   228,
1892       68,   228,    -1,   228,    39,   228,    -1,   228,    66,   228,
1893       -1,    42,   126,   228,   129,    -1,    35,   228,    -1,    35,
1894       -1,   126,   226,   129,    -1,   110,   228,    -1,   228,   120,
1895      228,   121,    -1,   120,   219,   121,    -1,    -1,   231,    -1,
1896      225,   103,   225,    -1,   231,    97,   225,   103,   225,    -1,
1897      122,   230,   128,    -1,   228,    78,   228,    -1,   228,    77,
1898      228,    -1,   228,    82,   228,    -1,   228,    81,   228,    -1,
1899      228,    83,   228,    -1,   228,    76,   228,    -1,   228,    75,
1900      228,    -1,   228,    79,   228,    -1,   228,    80,   228,    -1,
1901      228,    99,   228,    -1,   228,   102,   228,   103,   228,    -1,
1902      228,    88,    -1,   228,    87,    -1,    88,   228,    -1,    87,
1903      228,    -1,    52,   123,     3,    -1,   228,   123,     3,    -1,
1904        3,    -1,   184,    17,     3,    -1,   184,    17,     3,    99,
1905        3,    -1,   184,    17,     3,    99,     4,    -1,    22,    17,
1906        3,    -1
1907 };
1908
1909 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
1910 static const yytype_uint16 yyrline[] =
1911 {
1912        0,  1484,  1484,  1486,  1486,  1487,  1488,  1490,  1491,  1492,
1913     1493,  1494,  1495,  1496,  1498,  1498,  1499,  1500,  1502,  1503,
1914     1504,  1505,  1506,  1507,  1509,  1510,  1512,  1513,  1516,  1517,
1915     1518,  1519,  1520,  1521,  1522,  1523,  1524,  1525,  1528,  1529,
1916     1530,  1531,  1532,  1533,  1534,  1536,  1537,  1539,  1540,  1541,
1917     1542,  1546,  1553,  1554,  1558,  1559,  1561,  1562,  1564,  1605,
1918     1606,  1609,  1609,  1628,  1629,  1630,  1633,  1636,  1640,  1641,
1919     1643,  1663,  1706,  1706,  1725,  1725,  1740,  1743,  1746,  1749,
1920     1753,  1754,  1755,  1756,  1757,  1758,  1760,  1771,  1774,  1774,
1921     1803,  1803,  1823,  1823,  1840,  1841,  1842,  1843,  1851,  1860,
1922     1860,  1905,  1909,  1920,  1929,  1930,  1932,  1933,  1935,  1935,
1923     1936,  1936,  1938,  1946,  1956,  1957,  1958,  1959,  1961,  1962,
1924     1963,  1964,  1965,  1966,  1967,  1968,  1969,  1971,  1972,  1974,
1925     1975,  1977,  1978,  1982,  1980,  1988,  1986,  1994,  1995,  1996,
1926     1997,  1998,  1999,  2000,  2002,  2008,  2009,  2010,  2011,  2012,
1927     2013,  2016,  2027,  2027,  2029,  2087,  2088,  2090,  2091,  2092,
1928     2093,  2094,  2096,  2097,  2098,  2103,  2106,  2111,  2116,  2123,
1929     2127,  2132,  2138,  2144,  2145,  2146,  2149,  2148,  2166,  2167,
1930     2168,  2176,  2183,  2189,  2190,  2192,  2193,  2195,  2196,  2197,
1931     2206,  2207,  2211,  2212,  2214,  2215,  2216,  2219,  2224,  2248,
1932     2296,  2316,  2337,  2340,  2347,  2348,  2349,  2355,  2361,  2363,
1933     2365,  2367,  2369,  2371,  2388,  2393,  2396,  2399,  2402,  2405,
1934     2408,  2411,  2414,  2417,  2421,  2422,  2425,  2428,  2431,  2434,
1935     2437,  2440,  2443,  2447,  2458,  2476,  2481,  2486,  2491,  2496,
1936     2501,  2505,  2509,  2514,  2518,  2522,  2531,  2540,  2550,  2555,
1937     2567,  2573,  2578,  2584,  2590,  2594,  2596,  2607,  2616,  2623,
1938     2624,  2626,  2632,  2641,  2648,  2660,  2666,  2672,  2678,  2684,
1939     2690,  2696,  2709,  2720,  2727,  2740,  2767,  2781,  2795,  2809,
1940     2824,  2858,  2956,  2957,  2958,  2960
1941 };
1942 #endif
1943
1944 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1945 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1946    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
1947 static const char *const yytname[] =
1948 {
1949   "$end", "error", "$undefined", "T_IDENTIFIER", "T_STRING", "T_REGEXP",
1950   "T_EMPTY", "T_INT", "T_UINT", "T_BYTE", "T_SHORT", "T_FLOAT", "\"for\"",
1951   "\"while\"", "\"do\"", "\"switch\"", "\"implements\"", "\"namespace\"",
1952   "\"package\"", "\"protected\"", "\"public\"", "\"private\"", "\"use\"",
1953   "\"internal\"", "\"new\"", "\"native\"", "\"function\"", "\"finally\"",
1954   "\"undefined\"", "\"continue\"", "\"class\"", "\"const\"", "\"catch\"",
1955   "\"case\"", "\"set\"", "\"void\"", "\"throw\"", "\"static\"", "\"with\"",
1956   "\"instanceof\"", "\"import\"", "\"return\"", "\"typeof\"",
1957   "\"interface\"", "\"null\"", "\"var\"", "\"dynamic\"", "\"override\"",
1958   "\"final\"", "\"each\"", "\"get\"", "\"try\"", "\"super\"",
1959   "\"extends\"", "\"false\"", "\"true\"", "\"Boolean\"", "\"uint\"",
1960   "\"int\"", "\"Number\"", "\"String\"", "\"default\"", "\"delete\"",
1961   "\"if\"", "\"else\"", "\"break\"", "\"is\"", "\"in\"", "\"as\"",
1962   "\"==\"", "\"===\"", "\"!=\"", "\"!==\"", "\"<=\"", "\">=\"", "\"|=\"",
1963   "\"/=\"", "\"%=\"", "\"*=\"", "\"+=\"", "\"-=\"", "\">>=\"", "\"<<=\"",
1964   "\">>>=\"", "\"||\"", "\"&&\"", "\"::\"", "\"--\"", "\"++\"", "\"..\"",
1965   "\"...\"", "\"<<\"", "\">>>\"", "\">>\"", "prec_none", "below_semicolon",
1966   "';'", "','", "below_assignment", "'='", "\"&=\"", "\"^=\"", "'?'",
1967   "':'", "'|'", "'^'", "'&'", "'<'", "'>'", "below_minus", "'-'", "'+'",
1968   "'/'", "'*'", "'%'", "'~'", "'!'", "minusminus_prefix",
1969   "plusplus_prefix", "below_curly", "'['", "']'", "'{'", "'.'",
1970   "above_identifier", "below_else", "'('", "above_function", "'}'", "')'",
1971   "$accept", "PROGRAM", "MAYBE_PROGRAM_CODE_LIST", "PROGRAM_CODE_LIST",
1972   "PROGRAM_CODE", "MAYBE_INPACKAGE_CODE_LIST", "INPACKAGE_CODE_LIST",
1973   "INPACKAGE_CODE", "MAYBECODE", "CODE", "CODE_STATEMENT", "CODEPIECE",
1974   "CODEBLOCK", "PACKAGE_INITCODE", "MAYBEEXPRESSION",
1975   "VARIABLE_DECLARATION", "VARIABLE_LIST", "ONE_VARIABLE", "MAYBEELSE",
1976   "IF", "$@1", "FOR_INIT", "FOR_IN_INIT", "FOR_START", "FOR", "FOR_IN",
1977   "WHILE", "$@2", "DO_WHILE", "$@3", "BREAK", "CONTINUE",
1978   "MAYBE_CASE_LIST", "CASE_LIST", "CASE", "DEFAULT", "SWITCH", "$@4",
1979   "CATCH", "$@5", "FINALLY", "$@6", "CATCH_LIST", "CATCH_FINALLY_LIST",
1980   "TRY", "$@7", "THROW", "WITH", "X_IDENTIFIER", "PACKAGE",
1981   "PACKAGE_DECLARATION", "$@8", "$@9", "IMPORT", "MAYBE_MODIFIERS",
1982   "MODIFIER_LIST", "MODIFIER", "EXTENDS", "EXTENDS_LIST",
1983   "IMPLEMENTS_LIST", "CLASS_DECLARATION", "$@10", "INTERFACE_DECLARATION",
1984   "$@11", "MAYBE_CLASS_BODY", "CLASS_BODY", "CLASS_BODY_ITEM",
1985   "MAYBE_INTERFACE_BODY", "INTERFACE_BODY", "IDECLARATION", "VARCONST",
1986   "SLOT_DECLARATION", "MAYBESTATICCONSTANT", "STATICCONSTANT",
1987   "MAYBE_PARAM_LIST", "PARAM_LIST", "PARAM", "GETSET",
1988   "FUNCTION_DECLARATION", "$@12", "MAYBE_IDENTIFIER", "INNERFUNCTION",
1989   "CLASS", "PACKAGEANDCLASS", "QNAME", "QNAME_LIST", "TYPE", "MAYBETYPE",
1990   "MAYBE_PARAM_VALUES", "MAYBE_EXPRESSION_LIST", "EXPRESSION_LIST", "NEW",
1991   "FUNCTIONCALL", "DELETE", "RETURN", "NONCOMMAEXPRESSION", "EXPRESSION",
1992   "VOIDEXPRESSION", "E", "CONSTANT", "MAYBE_EXPRPAIR_LIST",
1993   "EXPRPAIR_LIST", "VAR_READ", "NAMESPACE_DECLARATION", "USE_NAMESPACE", 0
1994 };
1995 #endif
1996
1997 # ifdef YYPRINT
1998 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1999    token YYLEX-NUM.  */
2000 static const yytype_uint16 yytoknum[] =
2001 {
2002        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
2003      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
2004      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
2005      285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
2006      295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
2007      305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
2008      315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
2009      325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
2010      335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
2011      345,   346,   347,   348,   349,   350,    59,    44,   351,    61,
2012      352,   353,    63,    58,   124,    94,    38,    60,    62,   354,
2013       45,    43,    47,    42,    37,   126,    33,   355,   356,   357,
2014       91,    93,   123,    46,   358,   359,    40,   360,   125,    41
2015 };
2016 # endif
2017
2018 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
2019 static const yytype_uint8 yyr1[] =
2020 {
2021        0,   130,   131,   132,   132,   133,   133,   134,   134,   134,
2022      134,   134,   134,   134,   135,   135,   136,   136,   137,   137,
2023      137,   137,   137,   137,   138,   138,   139,   139,   140,   140,
2024      140,   140,   140,   140,   140,   140,   140,   140,   141,   141,
2025      141,   141,   141,   141,   141,   141,   141,   142,   142,   142,
2026      142,   143,   144,   144,   145,   145,   146,   146,   147,   148,
2027      148,   150,   149,   151,   151,   151,   152,   152,   153,   153,
2028      154,   155,   157,   156,   159,   158,   160,   160,   161,   161,
2029      162,   162,   162,   162,   163,   163,   164,   165,   167,   166,
2030      169,   168,   171,   170,   172,   172,   173,   173,   173,   175,
2031      174,   176,   176,   177,   178,   178,   179,   179,   181,   180,
2032      182,   180,   183,   183,   184,   184,   185,   185,   186,   186,
2033      186,   186,   186,   186,   186,   186,   186,   187,   187,   188,
2034      188,   189,   189,   191,   190,   193,   192,   194,   194,   195,
2035      195,   196,   196,   196,   196,   197,   197,   198,   198,   199,
2036      199,   199,   200,   200,   201,   202,   202,   203,   203,   203,
2037      203,   203,   203,   203,   203,   204,   204,   204,   204,   205,
2038      205,   206,   206,   207,   207,   207,   209,   208,   210,   210,
2039      211,   212,   213,   214,   214,   215,   215,   216,   216,   216,
2040      217,   217,   218,   218,   219,   219,   220,   220,   221,   222,
2041      222,   223,   224,   224,   225,   226,   226,   227,   228,   228,
2042      228,   228,   228,   228,   229,   229,   229,   229,   229,   229,
2043      229,   229,   229,   229,   228,   228,   228,   228,   228,   228,
2044      228,   228,   228,   228,   228,   228,   228,   228,   228,   228,
2045      228,   228,   228,   228,   228,   228,   228,   228,   228,   228,
2046      228,   228,   228,   228,   228,   228,   228,   228,   228,   230,
2047      230,   231,   231,   228,   228,   228,   228,   228,   228,   228,
2048      228,   228,   228,   228,   228,   228,   228,   228,   228,   228,
2049      228,   232,   233,   233,   233,   234
2050 };
2051
2052 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
2053 static const yytype_uint8 yyr2[] =
2054 {
2055        0,     2,     1,     0,     1,     1,     2,     1,     1,     1,
2056        1,     1,     1,     1,     0,     1,     1,     2,     1,     1,
2057        1,     1,     1,     1,     1,     0,     2,     1,     1,     1,
2058        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
2059        1,     1,     1,     1,     1,     1,     1,     3,     2,     2,
2060        1,     1,     2,     0,     2,     2,     1,     3,     3,     0,
2061        2,     0,     7,     0,     1,     1,     3,     1,     2,     3,
2062        8,     6,     0,     6,     0,     7,     1,     2,     1,     2,
2063        0,     1,     1,     2,     1,     2,     4,     3,     0,     8,
2064        0,     9,     0,     5,     1,     2,     1,     2,     1,     0,
2065        6,     2,     1,     5,     1,     1,     3,     1,     0,     6,
2066        0,     5,     2,     4,     0,     1,     1,     2,     1,     1,
2067        1,     1,     1,     1,     1,     1,     1,     0,     2,     0,
2068        2,     0,     2,     0,     9,     0,     8,     0,     1,     1,
2069        2,     1,     1,     1,     1,     0,     1,     1,     2,     1,
2070        2,     8,     1,     1,     5,     0,     2,     1,     1,     1,
2071        1,     1,     1,     1,     1,     0,     1,     2,     4,     3,
2072        1,     4,     2,     1,     1,     0,     0,    12,     1,     0,
2073        9,     1,     3,     1,     1,     1,     3,     1,     1,     1,
2074        2,     0,     0,     3,     0,     1,     1,     3,     3,     4,
2075        4,     2,     1,     2,     1,     1,     3,     1,     1,     1,
2076        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
2077        1,     1,     1,     1,     1,     3,     3,     3,     3,     3,
2078        3,     3,     3,     3,     3,     2,     2,     3,     3,     3,
2079        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
2080        3,     3,     4,     2,     1,     3,     2,     4,     3,     0,
2081        1,     3,     5,     3,     3,     3,     3,     3,     3,     3,
2082        3,     3,     3,     3,     5,     2,     2,     2,     2,     3,
2083        3,     1,     3,     5,     5,     3
2084 };
2085
2086 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2087    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
2088    means the default is an error.  */
2089 static const yytype_uint16 yydefact[] =
2090 {
2091      114,   281,   219,   213,   216,   217,   214,   215,   218,     0,
2092        0,    74,     0,     0,   120,   118,   119,   126,     0,   125,
2093      179,   220,   254,   121,     0,     0,     0,   223,   122,   124,
2094      123,     0,     0,   222,   221,     0,     0,     0,     0,    13,
2095        0,     0,     0,   194,   259,     0,     0,     2,   114,     5,
2096       51,    12,    34,    63,    29,    30,    31,    32,    33,    36,
2097       35,     7,    28,     0,   115,   116,     9,     8,    11,    10,
2098      208,   211,   224,   212,   207,    37,   205,   209,   210,     0,
2099       68,    72,   114,    88,   104,   105,   110,   107,     0,   181,
2100      192,   178,     0,   253,     0,   181,     0,   184,   183,   112,
2101        0,    99,     0,   194,   201,    61,   278,   277,   256,   236,
2102      235,     0,   195,   196,   204,     0,     0,   260,     0,     1,
2103        6,   281,     0,     0,    64,     0,     0,    65,   175,     0,
2104      153,     0,   152,     0,   117,     0,     0,     0,     0,     0,
2105        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2106        0,     0,     0,     0,     0,     0,     0,   276,   275,     0,
2107        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2108        0,     0,     0,     0,     0,     0,   194,    69,     0,     0,
2109       78,   102,   202,     0,    76,    38,   114,    39,    50,     0,
2110       40,    41,    42,    44,     0,    43,    45,    46,     0,   114,
2111      108,     0,   194,   198,   165,     0,     0,     0,    25,   279,
2112        0,     0,   258,     0,     0,   263,     0,   255,   191,    55,
2113       56,   191,    54,     0,     0,   174,   173,     0,   127,   129,
2114      191,   206,   250,   251,   248,   249,   229,   230,   232,   231,
2115      227,   228,   270,   269,   265,   264,   271,   272,   267,   266,
2116      268,   233,   234,   242,   241,   240,   273,     0,   239,   238,
2117      237,   225,   226,   246,   245,   243,   247,   244,     0,   280,
2118        0,     0,     0,    79,   101,   203,    77,    48,   114,    27,
2119      205,    49,     0,     0,     0,    23,     0,   114,    16,    22,
2120       19,    18,    21,    20,   114,   106,     0,   155,     0,     0,
2121      166,   170,   114,   182,   113,   252,     0,    24,   200,     0,
2122      197,   261,     0,     0,    53,     0,    53,     0,     0,     0,
2123        0,   131,     0,     0,    53,     0,   257,   199,   114,   285,
2124       47,    26,     0,   282,     0,   111,    17,     0,   193,     0,
2125        0,   172,   167,   191,     0,   103,     0,   114,     0,   189,
2126      188,     0,   187,   190,     0,    58,    57,     0,   114,   165,
2127      128,     0,     0,   185,   130,   135,   154,   274,    73,     0,
2128        0,    80,   109,   161,   158,   159,   157,   160,   164,   163,
2129      162,   156,   155,     0,     0,   169,     0,     0,    94,    98,
2130       96,   100,    59,   262,     0,    52,     0,    71,     0,   132,
2131      133,     0,   114,    75,   283,   284,     0,     0,     0,    81,
2132       84,    82,   171,    25,   168,    92,     0,    95,    97,   114,
2133       62,   114,   191,   114,   186,     0,   149,     0,     0,   114,
2134      147,     0,    25,    89,    85,    83,     0,    25,   191,    60,
2135       70,     0,   141,   144,     0,     0,   114,   139,   142,   143,
2136      150,   175,   136,   148,    25,    87,   180,     0,     0,   176,
2137      134,   140,     0,    86,    93,    90,    25,     0,     0,     0,
2138      165,    25,   177,     0,     0,   191,    91,   151
2139 };
2140
2141 /* YYDEFGOTO[NTERM-NUM].  */
2142 static const yytype_int16 yydefgoto[] =
2143 {
2144       -1,    46,    47,    48,    49,   286,   287,   288,   306,   307,
2145      187,   279,   189,   289,   355,   190,   222,   220,   420,    52,
2146      211,   125,   126,    53,    54,    55,    56,   178,    57,    82,
2147      191,   192,   408,   409,   410,   411,    58,   198,   388,   468,
2148      389,   437,   390,   391,    59,   208,   193,    60,    87,   351,
2149       61,   294,   199,    62,   194,    64,    65,   321,   323,   362,
2150      290,   423,   291,   402,   445,   446,   447,   428,   429,   430,
2151      133,   292,   341,   381,   299,   300,   301,   227,   293,   466,
2152       92,    70,    97,    98,   352,   364,   353,   314,   203,   111,
2153      112,    71,    72,    73,   195,   113,    74,    75,    76,    77,
2154      116,   117,    78,   196,   197
2155 };
2156
2157 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2158    STATE-NUM.  */
2159 #define YYPACT_NINF -308
2160 static const yytype_int16 yypact[] =
2161 {
2162      349,  -308,  -308,  -308,  -308,  -308,  -308,  -308,  -308,   -38,
2163      -86,  -308,   -72,    35,  -308,  -308,  -308,  -308,    30,  -308,
2164       97,  -308,    52,  -308,   -14,    18,    36,  -308,  -308,  -308,
2165     -308,    57,    44,  -308,  -308,  1538,    40,  1538,  1538,  -308,
2166     1538,  1538,  1538,  1538,  1538,  1538,   102,  -308,   473,  -308,
2167     -308,  -308,  -308,   211,  -308,  -308,  -308,  -308,  -308,  -308,
2168     -308,  -308,  -308,   275,   640,  -308,  -308,  -308,  -308,  -308,
2169     -308,  -308,  -308,  -308,    96,  -308,  1971,  -308,  -308,    82,
2170     -308,  -308,  1469,  -308,  -308,  -308,  -308,  -308,   -32,  -308,
2171       83,  -308,    84,   104,  1538,    88,    89,  -308,  -308,  -308,
2172     1538,  -308,   186,  1538,   104,  -308,   104,   104,   163,   104,
2173      104,   108,   116,  -308,  1971,   114,   105,   128,   -88,  -308,
2174     -308,   165,   231,   233,  -308,   144,   174,  -308,    -5,   240,
2175     -308,   241,  -308,   244,  -308,  1538,  1538,  1538,  1538,  1538,
2176     1538,  1538,  1538,  1538,  1538,  1538,  1538,  1538,  1538,  1538,
2177     1538,  1538,  1538,  1538,  1538,  1538,  1538,  -308,  -308,  1538,
2178     1538,  1538,  1538,  1538,  1538,  1538,  1538,  1538,  1538,  1538,
2179     1538,  1538,  1538,  1538,  1538,   245,  1538,  -308,  1538,   232,
2180      255,  1538,  1538,   231,   256,  -308,   593,  -308,   164,   248,
2181     -308,  -308,  -308,  -308,   247,  -308,  -308,  -308,  1538,   845,
2182     -308,    90,  1538,  -308,     9,   -82,    68,  1599,  1349,  -308,
2183      138,  1538,  -308,  1538,  1538,  -308,  1538,  -308,   166,   171,
2184     -308,   166,   171,  1538,  1538,  -308,  -308,   267,   219,   221,
2185      166,  1971,   962,   836,   836,   836,  2337,  2337,  2337,  2337,
2186      962,   962,  1971,  1971,  1971,  1971,  1971,  1971,  1971,  1971,
2187     1971,  2032,  2093,   340,   340,   340,  1971,  1727,  2154,  2215,
2188     2276,   962,   962,   163,   163,   104,   104,   104,  1788,  -308,
2189      149,   -62,   276,  -308,    96,    96,  -308,  -308,   719,  -308,
2190     1849,  -308,   154,   278,  1663,  -308,   156,   971,  -308,  -308,
2191     -308,  -308,  -308,  -308,   845,  -308,   161,   -69,   282,   167,
2192      195,  -308,  1469,    88,  -308,  -308,   169,  1349,  -308,   -55,
2193     -308,  -308,   190,    63,   204,   231,   -24,    86,    74,   178,
2194       18,   292,    18,   187,   204,  1538,  -308,  -308,  1469,  -308,
2195     -308,  -308,  1538,   213,   188,  -308,  -308,   185,  -308,    61,
2196       63,  -308,  -308,   166,    11,  -308,    62,  1469,  1538,  -308,
2197     -308,   191,  -308,  -308,  1538,  -308,  -308,  1538,  1469,     9,
2198     -308,    18,   194,  -308,   220,  -308,  -308,  1971,  -308,    76,
2199      182,   136,  -308,  -308,  -308,  -308,  -308,  -308,  -308,  -308,
2200     -308,  -308,   224,   197,   282,  -308,   202,   199,  -308,  -308,
2201       62,  -308,   265,  -308,    92,  -308,   203,  -308,   205,   220,
2202     -308,    18,   394,  -308,  -308,  -308,  1538,   235,   207,   136,
2203     -308,  -308,  -308,  1349,  -308,  -308,   336,  -308,  -308,  1469,
2204     -308,  1469,   166,  1097,  -308,   337,  -308,   316,   216,   529,
2205     -308,  1910,  1349,  -308,  -308,  -308,   218,  1349,   166,  -308,
2206     -308,   225,  -308,  -308,    66,   222,  1223,  -308,  -308,  -308,
2207     -308,    -5,  -308,  -308,  1349,  -308,  -308,   223,   226,  -308,
2208     -308,  -308,   345,  -308,  -308,  -308,  1349,   239,   249,   238,
2209        9,  1349,  -308,   246,   250,   166,  -308,  -308
2210 };
2211
2212 /* YYPGOTO[NTERM-NUM].  */
2213 static const yytype_int16 yypgoto[] =
2214 {
2215     -308,  -308,  -308,  -308,   328,    85,  -308,    93,  -209,   196,
2216        1,   -76,  -244,    16,    59,   332,   268,    77,  -308,  -308,
2217     -308,  -308,  -308,  -308,  -308,  -308,  -308,  -308,  -308,  -308,
2218     -308,  -308,  -308,  -308,   -15,   -11,  -308,  -308,    15,  -308,
2219       17,  -308,  -308,  -308,  -308,  -308,  -308,  -308,  -193,    19,
2220     -308,  -308,  -308,  -308,     0,  -308,   335,  -308,  -308,  -308,
2221       31,  -308,    39,  -308,  -308,  -308,   -40,  -308,  -308,   -21,
2222     -308,     2,    27,  -308,  -307,  -308,  -271,   -41,     3,  -308,
2223     -308,  -308,   398,  -308,   -20,    60,    78,  -184,  -308,   -93,
2224     -308,  -308,  -308,  -308,  -308,   -26,   -17,   -46,   -18,  -308,
2225     -308,  -308,  -308,  -308,  -308
2226 };
2227
2228 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
2229    positive, shift that token.  If negative, reduce the rule which
2230    number is the opposite.  If zero, do what YYDEFACT says.
2231    If YYTABLE_NINF, syntax error.  */
2232 #define YYTABLE_NINF -205
2233 static const yytype_int16 yytable[] =
2234 {
2235       63,    50,    68,    69,    93,    99,   188,   127,   295,   135,
2236      210,    79,   297,   295,   297,   135,    51,   104,   115,   106,
2237      107,    95,   108,   109,   110,   114,   114,   342,   118,   225,
2238      339,    66,    88,    89,   340,   135,    85,   316,    84,    67,
2239       81,   217,   135,   -66,    96,   226,   324,   302,    63,    50,
2240       68,    69,   398,    85,    83,     1,     2,     3,   345,     4,
2241        5,     6,     7,     8,    51,   373,    95,   328,   374,   375,
2242      376,   303,   377,   385,   347,   354,    18,   205,    20,    66,
2243       21,    85,   207,   270,   368,   114,    85,    67,    80,   386,
2244      200,   201,   128,    84,   387,   303,    27,   130,   349,   298,
2245       91,   384,   119,   392,    32,   378,    33,    34,    85,   296,
2246       85,   132,    94,   414,   397,   379,   380,   231,   232,   233,
2247      234,   235,   236,   237,   238,   239,   240,   241,   242,   243,
2248      244,   245,   246,   247,   248,   249,   250,   251,   252,    37,
2249       38,   253,   254,   255,   256,   257,   258,   259,   260,   261,
2250      262,   263,   264,   265,   266,   267,   268,    86,   114,   383,
2251      115,   271,   100,   473,   274,   275,   105,   102,   280,   406,
2252      103,   135,    43,   135,    44,   439,   350,   440,    45,   101,
2253      284,   304,   357,   135,   114,   404,   405,   310,   311,   209,
2254      312,   157,   158,   135,   309,   114,   114,   407,   114,    63,
2255       50,   295,   331,   358,   436,   403,   317,   318,   177,   202,
2256      204,  -104,   206,   213,   121,     2,     3,   214,     4,     5,
2257        6,     7,     8,   455,   174,   216,   188,   175,   457,   212,
2258      176,   331,   -67,   215,   218,    18,   221,    20,   441,    21,
2259      223,   224,   122,   228,   229,   463,    22,   230,   269,   272,
2260      157,   158,   188,    26,   458,    27,   123,   469,   273,   276,
2261      281,   282,   474,    32,   283,    33,    34,   308,   315,   313,
2262      319,   188,   320,    35,   322,   171,   172,   173,   327,   329,
2263      332,   333,   188,   174,   335,   297,   175,    63,    50,   176,
2264      338,   477,   344,   348,    63,    50,   343,   346,    37,    38,
2265      360,   128,   363,   354,   359,   129,   130,   367,   361,   365,
2266      371,   396,   370,   372,   394,   369,   400,   401,   131,   413,
2267      132,    40,   393,   339,   415,   416,    41,    42,   395,   419,
2268      114,    43,   421,    44,   422,   433,   114,    45,   432,   438,
2269      450,   363,   451,   188,   452,   188,   456,   459,   467,    -3,
2270      460,   464,     1,     2,     3,   465,     4,     5,     6,     7,
2271        8,     9,    10,    11,    12,   470,   472,    13,    14,    15,
2272       16,   471,    17,    18,    19,   475,   120,    21,   476,   337,
2273      336,   424,   278,   366,    22,   124,    23,    24,   431,    25,
2274      219,    26,   356,    27,   434,    28,    29,    30,   435,   134,
2275       31,    32,   427,    33,    34,   417,   461,   418,   453,   412,
2276      462,    35,    36,    14,    15,    16,    90,    17,   382,    19,
2277        0,   399,     0,   444,   443,   448,   449,   157,   158,   427,
2278        0,    23,     0,     0,     0,     0,    37,    38,     0,   425,
2279       28,    29,    30,     0,     0,    39,   444,   443,   448,   449,
2280      169,   170,   171,   172,   173,     0,     0,     0,     0,    40,
2281      174,     0,     0,   175,    41,    42,   176,     0,     0,    43,
2282        0,    44,     0,    -4,     0,    45,     1,     2,     3,     0,
2283        4,     5,     6,     7,     8,     9,    10,    11,    12,     0,
2284      426,    13,    14,    15,    16,     0,    17,    18,    19,     0,
2285        0,    21,     0,     0,     0,     0,     0,     0,    22,     0,
2286       23,    24,     0,    25,     0,    26,     0,    27,     0,    28,
2287       29,    30,  -145,     0,    31,    32,     0,    33,    34,     0,
2288        0,     0,     0,     0,     0,    35,    36,     0,     0,     0,
2289        0,     0,     0,     0,     0,     0,     0,     0,    14,    15,
2290       16,     0,    17,     0,    19,     0,     0,     0,     0,     0,
2291       37,    38,     0,     0,     0,     0,    23,     0,     0,    39,
2292        0,     0,     0,     0,   425,    28,    29,    30,     0,     0,
2293        0,     0,     0,    40,     0,     0,     0,     0,    41,    42,
2294        0,     0,     0,    43,     0,    44,     1,     2,     3,    45,
2295        4,     5,     6,     7,     8,     9,    10,    11,    12,     0,
2296        0,     0,    14,    15,    16,   179,    17,    18,    19,    20,
2297        0,    21,   180,     0,   122,   426,     0,     0,    22,   181,
2298       23,    24,     0,    25,   182,    26,     0,    27,   183,    28,
2299       29,    30,     0,     0,    31,    32,     0,    33,    34,     0,
2300        0,     0,     0,     0,     0,    35,    36,  -146,   184,    14,
2301       15,    16,     0,    17,     0,    19,     0,     0,     0,     0,
2302        0,     0,     0,     0,     0,     0,     0,    23,     0,     0,
2303       37,    38,     0,     0,     0,     0,    28,    29,    30,   185,
2304        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2305        0,     0,     0,    40,     0,     0,     0,     0,    41,    42,
2306        0,     0,     0,    43,     0,    44,     0,     0,     0,    45,
2307        0,   277,     1,     2,     3,     0,     4,     5,     6,     7,
2308        8,     9,    10,    11,    12,     0,     0,     0,    14,    15,
2309       16,   179,    17,    18,    19,    20,     0,    21,   180,     0,
2310      122,     0,     0,     0,    22,   181,    23,    24,     0,    25,
2311      182,    26,     0,    27,   183,    28,    29,    30,     0,     0,
2312       31,    32,     0,    33,    34,     0,     0,     0,     0,     0,
2313        0,    35,    36,     0,   184,     0,     0,     0,     0,     0,
2314        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2315        0,     0,     0,     0,     0,     0,    37,    38,     0,     0,
2316        0,     0,     0,     0,     0,   185,     0,     0,     0,     0,
2317        0,     0,     0,     0,     0,     0,     0,     0,     0,    40,
2318        0,     0,     0,     0,    41,    42,     0,     0,     0,    43,
2319        0,    44,     0,     0,     0,    45,     0,   330,     1,     2,
2320        3,     0,     4,     5,     6,     7,     8,     9,    10,    11,
2321       12,     0,     0,     0,    14,    15,    16,     0,    17,    18,
2322       19,     0,     0,    21,     0,   136,     0,     0,     0,     0,
2323       22,     0,    23,    24,     0,    25,     0,    26,     0,    27,
2324        0,    28,    29,    30,     0,     0,    31,    32,     0,    33,
2325       34,     0,  -205,  -205,  -205,     0,     0,    35,    36,   144,
2326      145,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2327        0,     0,     0,   157,   158,     0,     0,   159,   160,   161,
2328        0,     0,    37,    38,     0,     0,     0,     0,     0,     0,
2329        0,   285,     0,   167,   168,     0,   169,   170,   171,   172,
2330      173,     0,     0,     0,     0,    40,   174,     0,     0,   175,
2331       41,    42,   176,     0,     0,    43,     0,    44,     0,     0,
2332        0,    45,     0,   -14,     1,     2,     3,     0,     4,     5,
2333        6,     7,     8,     9,    10,    11,    12,     0,     0,     0,
2334       14,    15,    16,     0,    17,    18,    19,     0,     0,    21,
2335        0,  -205,     0,     0,     0,     0,    22,     0,    23,    24,
2336        0,    25,     0,    26,     0,    27,     0,    28,    29,    30,
2337        0,     0,    31,    32,     0,    33,    34,     0,     0,     0,
2338        0,     0,     0,    35,    36,  -205,  -205,     0,     0,     0,
2339        0,     0,     0,     0,     0,     0,     0,     0,     0,   157,
2340      158,     0,     0,   159,   160,   161,     0,     0,    37,    38,
2341        0,     0,     0,     0,     0,     0,     0,   285,     0,  -205,
2342     -205,     0,   169,   170,   171,   172,   173,     0,     0,     0,
2343        0,    40,   174,     0,     0,   175,    41,    42,   176,     0,
2344        0,    43,     0,    44,     0,     0,     0,    45,     0,   -15,
2345        1,     2,     3,     0,     4,     5,     6,     7,     8,     9,
2346       10,    11,    12,     0,     0,     0,    14,    15,    16,     0,
2347       17,    18,    19,     0,     0,    21,     0,     0,     0,     0,
2348        0,     0,    22,     0,    23,    24,     0,    25,     0,    26,
2349        0,    27,     0,    28,    29,    30,     0,     0,    31,    32,
2350        0,    33,    34,     0,     0,     0,     0,     0,     0,    35,
2351       36,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2352        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2353        0,     0,     0,     0,    37,    38,     0,     0,     0,     0,
2354        0,     0,     0,   442,     0,     0,     0,     0,     0,     0,
2355        0,     0,     0,     0,     0,     0,     0,    40,     0,     0,
2356        0,     0,    41,    42,     0,     0,     0,    43,     0,    44,
2357        0,     0,     0,    45,     0,  -137,     1,     2,     3,     0,
2358        4,     5,     6,     7,     8,     9,    10,    11,    12,     0,
2359        0,     0,    14,    15,    16,     0,    17,    18,    19,     0,
2360        0,    21,     0,     0,     0,     0,     0,     0,    22,     0,
2361       23,    24,     0,    25,     0,    26,     0,    27,     0,    28,
2362       29,    30,     0,     0,    31,    32,     0,    33,    34,     0,
2363        0,     0,     0,     0,     0,    35,    36,     0,     0,     0,
2364        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2365        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2366       37,    38,     0,     0,     0,     0,     0,     0,     0,   442,
2367        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2368        0,     0,     0,    40,     0,     0,     0,     0,    41,    42,
2369        0,     0,     0,    43,     0,    44,     0,     0,     0,    45,
2370        0,  -138,     1,     2,     3,     0,     4,     5,     6,     7,
2371        8,     9,    10,    11,    12,     0,  -114,     0,    14,    15,
2372       16,   179,    17,    18,    19,    20,     0,    21,   180,     0,
2373      122,     0,     0,     0,    22,   181,    23,    24,     0,    25,
2374      182,    26,     0,    27,   183,    28,    29,    30,     0,     0,
2375       31,    32,     0,    33,    34,     0,     0,     0,     0,     0,
2376        0,    35,    36,     0,   184,     0,     0,     0,     0,     0,
2377        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2378        0,     0,     0,     0,     0,     0,    37,    38,     0,     0,
2379        0,     0,     0,     0,     0,   185,     0,     0,     0,     0,
2380        0,     0,     0,     0,     0,     0,     0,     0,     0,    40,
2381        0,     0,     0,     0,    41,    42,     0,     0,     0,    43,
2382        0,    44,     1,     2,     3,    45,     4,     5,     6,     7,
2383        8,     9,    10,    11,    12,     0,     0,     0,    14,    15,
2384       16,   179,    17,    18,    19,    20,     0,    21,   180,     0,
2385      122,     0,     0,     0,    22,   181,    23,    24,     0,    25,
2386      182,    26,     0,    27,   183,    28,    29,    30,     0,     0,
2387       31,    32,     0,    33,    34,     0,     0,     0,     0,     0,
2388        0,    35,    36,     0,   184,     0,     0,     0,     0,     0,
2389        0,     1,     2,     3,     0,     4,     5,     6,     7,     8,
2390        0,     0,     0,     0,     0,     0,    37,    38,     0,     0,
2391        0,     0,    18,     0,    20,   185,    21,     0,     0,     0,
2392        0,     0,     0,    22,     0,     0,     0,     0,     0,    40,
2393       26,     0,    27,     0,    41,    42,     0,     0,     0,    43,
2394       32,   186,    33,    34,     0,    45,     0,     0,     0,     0,
2395       35,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2396        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2397        0,     0,     0,     0,     0,    37,    38,     0,     0,     0,
2398        0,     0,     0,     0,     0,     0,     0,     0,   136,     0,
2399        0,     0,     0,     0,     0,     0,     0,     0,    40,     0,
2400        0,     0,     0,    41,    42,     0,     0,     0,    43,     0,
2401       44,     0,     0,     0,    45,   137,   138,   139,   140,   141,
2402      142,   143,   144,   145,   146,   147,   148,   149,   150,   151,
2403      152,   153,   154,   155,   156,     0,   157,   158,     0,     0,
2404      159,   160,   161,     0,     0,     0,     0,     0,   162,     0,
2405        0,   163,   136,   164,   165,   166,   167,   168,     0,   169,
2406      170,   171,   172,   173,     0,     0,     0,     0,     0,   174,
2407        0,     0,   175,     0,     0,   176,     0,     0,   305,   137,
2408      138,   139,   140,   141,   142,   143,   144,   145,   146,   147,
2409      148,   149,   150,   151,   152,   153,   154,   155,   156,     0,
2410      157,   158,     0,     0,   159,   160,   161,     0,     0,     0,
2411        0,     0,   162,     0,     0,   163,   136,   164,   165,   166,
2412      167,   168,     0,   169,   170,   171,   172,   173,     0,     0,
2413        0,     0,     0,   174,     0,     0,   175,     0,     0,   176,
2414        0,     0,   334,   137,   138,   139,   140,   141,   142,   143,
2415      144,   145,   146,   147,   148,   149,   150,   151,   152,   153,
2416      154,   155,   156,     0,   157,   158,     0,     0,   159,   160,
2417      161,     0,     0,     0,     0,     0,   162,   136,     0,   163,
2418      325,   164,   165,   166,   167,   168,     0,   169,   170,   171,
2419      172,   173,     0,     0,     0,     0,     0,   174,     0,     0,
2420      175,     0,     0,   176,   137,   138,   139,   140,   141,   142,
2421      143,   144,   145,   146,   147,   148,   149,   150,   151,   152,
2422      153,   154,   155,   156,     0,   157,   158,     0,     0,   159,
2423      160,   161,     0,     0,     0,     0,     0,   162,   136,     0,
2424      163,     0,   164,   165,   166,   167,   168,     0,   169,   170,
2425      171,   172,   173,     0,     0,     0,     0,     0,   174,   326,
2426        0,   175,     0,     0,   176,   137,   138,   139,   140,   141,
2427      142,   143,   144,   145,   146,   147,   148,   149,   150,   151,
2428      152,   153,   154,   155,   156,     0,   157,   158,     0,     0,
2429      159,   160,   161,     0,     0,     0,     0,     0,   162,   136,
2430        0,   163,  -204,   164,   165,   166,   167,   168,     0,   169,
2431      170,   171,   172,   173,     0,     0,     0,     0,     0,   174,
2432        0,     0,   175,     0,     0,   176,   137,   138,   139,   140,
2433      141,   142,   143,   144,   145,   146,   147,   148,   149,   150,
2434      151,   152,   153,   154,   155,   156,     0,   157,   158,     0,
2435        0,   159,   160,   161,     0,     0,     0,     0,     0,   162,
2436      136,     0,   163,   454,   164,   165,   166,   167,   168,     0,
2437      169,   170,   171,   172,   173,     0,     0,     0,     0,     0,
2438      174,     0,     0,   175,     0,     0,   176,   137,   138,   139,
2439      140,   141,   142,   143,   144,   145,   146,   147,   148,   149,
2440      150,   151,   152,   153,   154,   155,   156,     0,   157,   158,
2441        0,     0,   159,   160,   161,     0,     0,     0,     0,     0,
2442      162,   136,     0,   163,     0,   164,   165,   166,   167,   168,
2443        0,   169,   170,   171,   172,   173,     0,     0,     0,     0,
2444        0,   174,     0,     0,   175,     0,     0,   176,   137,   138,
2445      139,   140,   141,   142,   143,   144,   145,     0,     0,     0,
2446        0,     0,     0,     0,     0,     0,     0,   156,     0,   157,
2447      158,     0,     0,   159,   160,   161,     0,     0,     0,     0,
2448        0,     0,   136,     0,     0,     0,   164,   165,   166,   167,
2449      168,     0,   169,   170,   171,   172,   173,     0,     0,     0,
2450        0,     0,   174,     0,     0,   175,     0,     0,   176,   137,
2451      138,   139,   140,   141,   142,   143,   144,   145,     0,     0,
2452        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2453      157,   158,     0,     0,   159,   160,   161,     0,     0,     0,
2454        0,     0,     0,   136,     0,     0,     0,   164,   165,   166,
2455      167,   168,     0,   169,   170,   171,   172,   173,     0,     0,
2456        0,     0,     0,   174,     0,     0,   175,     0,     0,   176,
2457      137,   138,   139,   140,   141,   142,   143,   144,   145,     0,
2458        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2459        0,   157,   158,     0,     0,   159,   160,   161,     0,     0,
2460        0,     0,     0,     0,   136,     0,     0,     0,     0,   165,
2461      166,   167,   168,     0,   169,   170,   171,   172,   173,     0,
2462        0,     0,     0,     0,   174,     0,     0,   175,     0,     0,
2463      176,   137,   138,   139,   140,   141,   142,   143,   144,   145,
2464        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2465        0,     0,   157,   158,     0,     0,   159,   160,   161,     0,
2466        0,     0,     0,     0,     0,   136,     0,     0,     0,     0,
2467        0,   166,   167,   168,     0,   169,   170,   171,   172,   173,
2468        0,     0,     0,     0,     0,   174,     0,     0,   175,     0,
2469        0,   176,   137,   138,   139,   140,   141,   142,   143,   144,
2470      145,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2471        0,     0,     0,   157,   158,     0,     0,   159,   160,   161,
2472        0,     0,     0,     0,     0,     0,   136,     0,     0,     0,
2473        0,     0,  -205,   167,   168,     0,   169,   170,   171,   172,
2474      173,     0,     0,     0,     0,     0,   174,     0,     0,   175,
2475        0,     0,   176,   137,   138,   139,  -205,  -205,  -205,  -205,
2476      144,   145,     0,     0,     0,     0,     0,     0,     0,     0,
2477        0,     0,     0,     0,   157,   158,     0,     0,   159,   160,
2478      161,     0,     0,     0,     0,     0,     0,     0,     0,     0,
2479        0,     0,     0,     0,   167,   168,     0,   169,   170,   171,
2480      172,   173,     0,     0,     0,     0,     0,   174,     0,     0,
2481      175,     0,     0,   176
2482 };
2483
2484 static const yytype_int16 yycheck[] =
2485 {
2486        0,     0,     0,     0,    22,    25,    82,    53,   201,    97,
2487      103,    49,     3,   206,     3,    97,     0,    35,    44,    37,
2488       38,     3,    40,    41,    42,    43,    44,   298,    45,    34,
2489       99,     0,    13,     3,   103,    97,    18,   221,     3,     0,
2490      126,   129,    97,    67,    25,    50,   230,   129,    48,    48,
2491       48,    48,   359,    18,   126,     3,     4,     5,   302,     7,
2492        8,     9,    10,    11,    48,     4,     3,   129,     7,     8,
2493        9,     3,    11,   344,   129,    99,    24,    94,    26,    48,
2494       28,    18,   100,   176,   328,   103,    18,    48,   126,    27,
2495      122,   123,    26,     3,    32,     3,    44,    31,    35,    90,
2496        3,    90,     0,   347,    52,    44,    54,    55,    18,   202,
2497       18,    45,   126,   384,   358,    54,    55,   135,   136,   137,
2498      138,   139,   140,   141,   142,   143,   144,   145,   146,   147,
2499      148,   149,   150,   151,   152,   153,   154,   155,   156,    87,
2500       88,   159,   160,   161,   162,   163,   164,   165,   166,   167,
2501      168,   169,   170,   171,   172,   173,   174,   122,   176,   343,
2502      186,   178,   126,   470,   181,   182,   126,   123,   186,    33,
2503      126,    97,   120,    97,   122,   419,   113,   421,   126,   122,
2504      198,   113,    96,    97,   202,     3,     4,   213,   214,     3,
2505      216,    87,    88,    97,   211,   213,   214,    61,   216,   199,
2506      199,   394,   278,   129,   413,   129,   223,   224,   126,   126,
2507      126,   123,   123,    97,     3,     4,     5,   103,     7,     8,
2508        9,    10,    11,   432,   120,    97,   302,   123,   437,   121,
2509      126,   307,    67,   128,     3,    24,     3,    26,   422,    28,
2510       96,    67,    31,     3,     3,   454,    35,     3,     3,    17,
2511       87,    88,   328,    42,   438,    44,    45,   466,     3,     3,
2512       96,    13,   471,    52,    17,    54,    55,   129,    97,   103,
2513        3,   347,    53,    62,    53,   112,   113,   114,   129,     3,
2514      126,     3,   358,   120,   128,     3,   123,   287,   287,   126,
2515      129,   475,    97,   103,   294,   294,   129,   128,    87,    88,
2516      320,    26,   322,    99,   126,    30,    31,   325,    16,   122,
2517      122,   357,    99,   128,   123,   332,   122,    97,    43,   122,
2518       45,   110,   348,    99,   122,   126,   115,   116,   354,    64,
2519      348,   120,   129,   122,   129,   128,   354,   126,   103,     3,
2520        3,   361,    26,   419,   128,   421,   128,   122,     3,     0,
2521      128,   128,     3,     4,     5,   129,     7,     8,     9,    10,
2522       11,    12,    13,    14,    15,   126,   128,    18,    19,    20,
2523       21,   122,    23,    24,    25,   129,    48,    28,   128,   294,
2524      287,   401,   186,   324,    35,    53,    37,    38,   406,    40,
2525      122,    42,   315,    44,   409,    46,    47,    48,   409,    64,
2526       51,    52,   402,    54,    55,   390,   446,   390,   429,   382,
2527      451,    62,    63,    19,    20,    21,    18,    23,   340,    25,
2528       -1,   361,    -1,   423,   423,   423,   423,    87,    88,   429,
2529       -1,    37,    -1,    -1,    -1,    -1,    87,    88,    -1,    45,
2530       46,    47,    48,    -1,    -1,    96,   446,   446,   446,   446,
2531      110,   111,   112,   113,   114,    -1,    -1,    -1,    -1,   110,
2532      120,    -1,    -1,   123,   115,   116,   126,    -1,    -1,   120,
2533       -1,   122,    -1,     0,    -1,   126,     3,     4,     5,    -1,
2534        7,     8,     9,    10,    11,    12,    13,    14,    15,    -1,
2535       96,    18,    19,    20,    21,    -1,    23,    24,    25,    -1,
2536       -1,    28,    -1,    -1,    -1,    -1,    -1,    -1,    35,    -1,
2537       37,    38,    -1,    40,    -1,    42,    -1,    44,    -1,    46,
2538       47,    48,   128,    -1,    51,    52,    -1,    54,    55,    -1,
2539       -1,    -1,    -1,    -1,    -1,    62,    63,    -1,    -1,    -1,
2540       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    19,    20,
2541       21,    -1,    23,    -1,    25,    -1,    -1,    -1,    -1,    -1,
2542       87,    88,    -1,    -1,    -1,    -1,    37,    -1,    -1,    96,
2543       -1,    -1,    -1,    -1,    45,    46,    47,    48,    -1,    -1,
2544       -1,    -1,    -1,   110,    -1,    -1,    -1,    -1,   115,   116,
2545       -1,    -1,    -1,   120,    -1,   122,     3,     4,     5,   126,
2546        7,     8,     9,    10,    11,    12,    13,    14,    15,    -1,
2547       -1,    -1,    19,    20,    21,    22,    23,    24,    25,    26,
2548       -1,    28,    29,    -1,    31,    96,    -1,    -1,    35,    36,
2549       37,    38,    -1,    40,    41,    42,    -1,    44,    45,    46,
2550       47,    48,    -1,    -1,    51,    52,    -1,    54,    55,    -1,
2551       -1,    -1,    -1,    -1,    -1,    62,    63,   128,    65,    19,
2552       20,    21,    -1,    23,    -1,    25,    -1,    -1,    -1,    -1,
2553       -1,    -1,    -1,    -1,    -1,    -1,    -1,    37,    -1,    -1,
2554       87,    88,    -1,    -1,    -1,    -1,    46,    47,    48,    96,
2555       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2556       -1,    -1,    -1,   110,    -1,    -1,    -1,    -1,   115,   116,
2557       -1,    -1,    -1,   120,    -1,   122,    -1,    -1,    -1,   126,
2558       -1,   128,     3,     4,     5,    -1,     7,     8,     9,    10,
2559       11,    12,    13,    14,    15,    -1,    -1,    -1,    19,    20,
2560       21,    22,    23,    24,    25,    26,    -1,    28,    29,    -1,
2561       31,    -1,    -1,    -1,    35,    36,    37,    38,    -1,    40,
2562       41,    42,    -1,    44,    45,    46,    47,    48,    -1,    -1,
2563       51,    52,    -1,    54,    55,    -1,    -1,    -1,    -1,    -1,
2564       -1,    62,    63,    -1,    65,    -1,    -1,    -1,    -1,    -1,
2565       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2566       -1,    -1,    -1,    -1,    -1,    -1,    87,    88,    -1,    -1,
2567       -1,    -1,    -1,    -1,    -1,    96,    -1,    -1,    -1,    -1,
2568       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   110,
2569       -1,    -1,    -1,    -1,   115,   116,    -1,    -1,    -1,   120,
2570       -1,   122,    -1,    -1,    -1,   126,    -1,   128,     3,     4,
2571        5,    -1,     7,     8,     9,    10,    11,    12,    13,    14,
2572       15,    -1,    -1,    -1,    19,    20,    21,    -1,    23,    24,
2573       25,    -1,    -1,    28,    -1,    39,    -1,    -1,    -1,    -1,
2574       35,    -1,    37,    38,    -1,    40,    -1,    42,    -1,    44,
2575       -1,    46,    47,    48,    -1,    -1,    51,    52,    -1,    54,
2576       55,    -1,    66,    67,    68,    -1,    -1,    62,    63,    73,
2577       74,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2578       -1,    -1,    -1,    87,    88,    -1,    -1,    91,    92,    93,
2579       -1,    -1,    87,    88,    -1,    -1,    -1,    -1,    -1,    -1,
2580       -1,    96,    -1,   107,   108,    -1,   110,   111,   112,   113,
2581      114,    -1,    -1,    -1,    -1,   110,   120,    -1,    -1,   123,
2582      115,   116,   126,    -1,    -1,   120,    -1,   122,    -1,    -1,
2583       -1,   126,    -1,   128,     3,     4,     5,    -1,     7,     8,
2584        9,    10,    11,    12,    13,    14,    15,    -1,    -1,    -1,
2585       19,    20,    21,    -1,    23,    24,    25,    -1,    -1,    28,
2586       -1,    39,    -1,    -1,    -1,    -1,    35,    -1,    37,    38,
2587       -1,    40,    -1,    42,    -1,    44,    -1,    46,    47,    48,
2588       -1,    -1,    51,    52,    -1,    54,    55,    -1,    -1,    -1,
2589       -1,    -1,    -1,    62,    63,    73,    74,    -1,    -1,    -1,
2590       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    87,
2591       88,    -1,    -1,    91,    92,    93,    -1,    -1,    87,    88,
2592       -1,    -1,    -1,    -1,    -1,    -1,    -1,    96,    -1,   107,
2593      108,    -1,   110,   111,   112,   113,   114,    -1,    -1,    -1,
2594       -1,   110,   120,    -1,    -1,   123,   115,   116,   126,    -1,
2595       -1,   120,    -1,   122,    -1,    -1,    -1,   126,    -1,   128,
2596        3,     4,     5,    -1,     7,     8,     9,    10,    11,    12,
2597       13,    14,    15,    -1,    -1,    -1,    19,    20,    21,    -1,
2598       23,    24,    25,    -1,    -1,    28,    -1,    -1,    -1,    -1,
2599       -1,    -1,    35,    -1,    37,    38,    -1,    40,    -1,    42,
2600       -1,    44,    -1,    46,    47,    48,    -1,    -1,    51,    52,
2601       -1,    54,    55,    -1,    -1,    -1,    -1,    -1,    -1,    62,
2602       63,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2603       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2604       -1,    -1,    -1,    -1,    87,    88,    -1,    -1,    -1,    -1,
2605       -1,    -1,    -1,    96,    -1,    -1,    -1,    -1,    -1,    -1,
2606       -1,    -1,    -1,    -1,    -1,    -1,    -1,   110,    -1,    -1,
2607       -1,    -1,   115,   116,    -1,    -1,    -1,   120,    -1,   122,
2608       -1,    -1,    -1,   126,    -1,   128,     3,     4,     5,    -1,
2609        7,     8,     9,    10,    11,    12,    13,    14,    15,    -1,
2610       -1,    -1,    19,    20,    21,    -1,    23,    24,    25,    -1,
2611       -1,    28,    -1,    -1,    -1,    -1,    -1,    -1,    35,    -1,
2612       37,    38,    -1,    40,    -1,    42,    -1,    44,    -1,    46,
2613       47,    48,    -1,    -1,    51,    52,    -1,    54,    55,    -1,
2614       -1,    -1,    -1,    -1,    -1,    62,    63,    -1,    -1,    -1,
2615       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2616       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2617       87,    88,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    96,
2618       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2619       -1,    -1,    -1,   110,    -1,    -1,    -1,    -1,   115,   116,
2620       -1,    -1,    -1,   120,    -1,   122,    -1,    -1,    -1,   126,
2621       -1,   128,     3,     4,     5,    -1,     7,     8,     9,    10,
2622       11,    12,    13,    14,    15,    -1,    17,    -1,    19,    20,
2623       21,    22,    23,    24,    25,    26,    -1,    28,    29,    -1,
2624       31,    -1,    -1,    -1,    35,    36,    37,    38,    -1,    40,
2625       41,    42,    -1,    44,    45,    46,    47,    48,    -1,    -1,
2626       51,    52,    -1,    54,    55,    -1,    -1,    -1,    -1,    -1,
2627       -1,    62,    63,    -1,    65,    -1,    -1,    -1,    -1,    -1,
2628       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2629       -1,    -1,    -1,    -1,    -1,    -1,    87,    88,    -1,    -1,
2630       -1,    -1,    -1,    -1,    -1,    96,    -1,    -1,    -1,    -1,
2631       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   110,
2632       -1,    -1,    -1,    -1,   115,   116,    -1,    -1,    -1,   120,
2633       -1,   122,     3,     4,     5,   126,     7,     8,     9,    10,
2634       11,    12,    13,    14,    15,    -1,    -1,    -1,    19,    20,
2635       21,    22,    23,    24,    25,    26,    -1,    28,    29,    -1,
2636       31,    -1,    -1,    -1,    35,    36,    37,    38,    -1,    40,
2637       41,    42,    -1,    44,    45,    46,    47,    48,    -1,    -1,
2638       51,    52,    -1,    54,    55,    -1,    -1,    -1,    -1,    -1,
2639       -1,    62,    63,    -1,    65,    -1,    -1,    -1,    -1,    -1,
2640       -1,     3,     4,     5,    -1,     7,     8,     9,    10,    11,
2641       -1,    -1,    -1,    -1,    -1,    -1,    87,    88,    -1,    -1,
2642       -1,    -1,    24,    -1,    26,    96,    28,    -1,    -1,    -1,
2643       -1,    -1,    -1,    35,    -1,    -1,    -1,    -1,    -1,   110,
2644       42,    -1,    44,    -1,   115,   116,    -1,    -1,    -1,   120,
2645       52,   122,    54,    55,    -1,   126,    -1,    -1,    -1,    -1,
2646       62,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2647       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2648       -1,    -1,    -1,    -1,    -1,    87,    88,    -1,    -1,    -1,
2649       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    39,    -1,
2650       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   110,    -1,
2651       -1,    -1,    -1,   115,   116,    -1,    -1,    -1,   120,    -1,
2652      122,    -1,    -1,    -1,   126,    66,    67,    68,    69,    70,
2653       71,    72,    73,    74,    75,    76,    77,    78,    79,    80,
2654       81,    82,    83,    84,    85,    -1,    87,    88,    -1,    -1,
2655       91,    92,    93,    -1,    -1,    -1,    -1,    -1,    99,    -1,
2656       -1,   102,    39,   104,   105,   106,   107,   108,    -1,   110,
2657      111,   112,   113,   114,    -1,    -1,    -1,    -1,    -1,   120,
2658       -1,    -1,   123,    -1,    -1,   126,    -1,    -1,   129,    66,
2659       67,    68,    69,    70,    71,    72,    73,    74,    75,    76,
2660       77,    78,    79,    80,    81,    82,    83,    84,    85,    -1,
2661       87,    88,    -1,    -1,    91,    92,    93,    -1,    -1,    -1,
2662       -1,    -1,    99,    -1,    -1,   102,    39,   104,   105,   106,
2663      107,   108,    -1,   110,   111,   112,   113,   114,    -1,    -1,
2664       -1,    -1,    -1,   120,    -1,    -1,   123,    -1,    -1,   126,
2665       -1,    -1,   129,    66,    67,    68,    69,    70,    71,    72,
2666       73,    74,    75,    76,    77,    78,    79,    80,    81,    82,
2667       83,    84,    85,    -1,    87,    88,    -1,    -1,    91,    92,
2668       93,    -1,    -1,    -1,    -1,    -1,    99,    39,    -1,   102,
2669      103,   104,   105,   106,   107,   108,    -1,   110,   111,   112,
2670      113,   114,    -1,    -1,    -1,    -1,    -1,   120,    -1,    -1,
2671      123,    -1,    -1,   126,    66,    67,    68,    69,    70,    71,
2672       72,    73,    74,    75,    76,    77,    78,    79,    80,    81,
2673       82,    83,    84,    85,    -1,    87,    88,    -1,    -1,    91,
2674       92,    93,    -1,    -1,    -1,    -1,    -1,    99,    39,    -1,
2675      102,    -1,   104,   105,   106,   107,   108,    -1,   110,   111,
2676      112,   113,   114,    -1,    -1,    -1,    -1,    -1,   120,   121,
2677       -1,   123,    -1,    -1,   126,    66,    67,    68,    69,    70,
2678       71,    72,    73,    74,    75,    76,    77,    78,    79,    80,
2679       81,    82,    83,    84,    85,    -1,    87,    88,    -1,    -1,
2680       91,    92,    93,    -1,    -1,    -1,    -1,    -1,    99,    39,
2681       -1,   102,   103,   104,   105,   106,   107,   108,    -1,   110,
2682      111,   112,   113,   114,    -1,    -1,    -1,    -1,    -1,   120,
2683       -1,    -1,   123,    -1,    -1,   126,    66,    67,    68,    69,
2684       70,    71,    72,    73,    74,    75,    76,    77,    78,    79,
2685       80,    81,    82,    83,    84,    85,    -1,    87,    88,    -1,
2686       -1,    91,    92,    93,    -1,    -1,    -1,    -1,    -1,    99,
2687       39,    -1,   102,   103,   104,   105,   106,   107,   108,    -1,
2688      110,   111,   112,   113,   114,    -1,    -1,    -1,    -1,    -1,
2689      120,    -1,    -1,   123,    -1,    -1,   126,    66,    67,    68,
2690       69,    70,    71,    72,    73,    74,    75,    76,    77,    78,
2691       79,    80,    81,    82,    83,    84,    85,    -1,    87,    88,
2692       -1,    -1,    91,    92,    93,    -1,    -1,    -1,    -1,    -1,
2693       99,    39,    -1,   102,    -1,   104,   105,   106,   107,   108,
2694       -1,   110,   111,   112,   113,   114,    -1,    -1,    -1,    -1,
2695       -1,   120,    -1,    -1,   123,    -1,    -1,   126,    66,    67,
2696       68,    69,    70,    71,    72,    73,    74,    -1,    -1,    -1,
2697       -1,    -1,    -1,    -1,    -1,    -1,    -1,    85,    -1,    87,
2698       88,    -1,    -1,    91,    92,    93,    -1,    -1,    -1,    -1,
2699       -1,    -1,    39,    -1,    -1,    -1,   104,   105,   106,   107,
2700      108,    -1,   110,   111,   112,   113,   114,    -1,    -1,    -1,
2701       -1,    -1,   120,    -1,    -1,   123,    -1,    -1,   126,    66,
2702       67,    68,    69,    70,    71,    72,    73,    74,    -1,    -1,
2703       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2704       87,    88,    -1,    -1,    91,    92,    93,    -1,    -1,    -1,
2705       -1,    -1,    -1,    39,    -1,    -1,    -1,   104,   105,   106,
2706      107,   108,    -1,   110,   111,   112,   113,   114,    -1,    -1,
2707       -1,    -1,    -1,   120,    -1,    -1,   123,    -1,    -1,   126,
2708       66,    67,    68,    69,    70,    71,    72,    73,    74,    -1,
2709       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2710       -1,    87,    88,    -1,    -1,    91,    92,    93,    -1,    -1,
2711       -1,    -1,    -1,    -1,    39,    -1,    -1,    -1,    -1,   105,
2712      106,   107,   108,    -1,   110,   111,   112,   113,   114,    -1,
2713       -1,    -1,    -1,    -1,   120,    -1,    -1,   123,    -1,    -1,
2714      126,    66,    67,    68,    69,    70,    71,    72,    73,    74,
2715       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2716       -1,    -1,    87,    88,    -1,    -1,    91,    92,    93,    -1,
2717       -1,    -1,    -1,    -1,    -1,    39,    -1,    -1,    -1,    -1,
2718       -1,   106,   107,   108,    -1,   110,   111,   112,   113,   114,
2719       -1,    -1,    -1,    -1,    -1,   120,    -1,    -1,   123,    -1,
2720       -1,   126,    66,    67,    68,    69,    70,    71,    72,    73,
2721       74,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2722       -1,    -1,    -1,    87,    88,    -1,    -1,    91,    92,    93,
2723       -1,    -1,    -1,    -1,    -1,    -1,    39,    -1,    -1,    -1,
2724       -1,    -1,   106,   107,   108,    -1,   110,   111,   112,   113,
2725      114,    -1,    -1,    -1,    -1,    -1,   120,    -1,    -1,   123,
2726       -1,    -1,   126,    66,    67,    68,    69,    70,    71,    72,
2727       73,    74,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2728       -1,    -1,    -1,    -1,    87,    88,    -1,    -1,    91,    92,
2729       93,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
2730       -1,    -1,    -1,    -1,   107,   108,    -1,   110,   111,   112,
2731      113,   114,    -1,    -1,    -1,    -1,    -1,   120,    -1,    -1,
2732      123,    -1,    -1,   126
2733 };
2734
2735 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2736    symbol of state STATE-NUM.  */
2737 static const yytype_uint8 yystos[] =
2738 {
2739        0,     3,     4,     5,     7,     8,     9,    10,    11,    12,
2740       13,    14,    15,    18,    19,    20,    21,    23,    24,    25,
2741       26,    28,    35,    37,    38,    40,    42,    44,    46,    47,
2742       48,    51,    52,    54,    55,    62,    63,    87,    88,    96,
2743      110,   115,   116,   120,   122,   126,   131,   132,   133,   134,
2744      140,   143,   149,   153,   154,   155,   156,   158,   166,   174,
2745      177,   180,   183,   184,   185,   186,   190,   192,   201,   208,
2746      211,   221,   222,   223,   226,   227,   228,   229,   232,    49,
2747      126,   126,   159,   126,     3,    18,   122,   178,   179,     3,
2748      212,     3,   210,   228,   126,     3,   179,   212,   213,   214,
2749      126,   122,   123,   126,   228,   126,   228,   228,   228,   228,
2750      228,   219,   220,   225,   228,   225,   230,   231,   226,     0,
2751      134,     3,    31,    45,   145,   151,   152,   227,    26,    30,
2752       31,    43,    45,   200,   186,    97,    39,    66,    67,    68,
2753       69,    70,    71,    72,    73,    74,    75,    76,    77,    78,
2754       79,    80,    81,    82,    83,    84,    85,    87,    88,    91,
2755       92,    93,    99,   102,   104,   105,   106,   107,   108,   110,
2756      111,   112,   113,   114,   120,   123,   126,   126,   157,    22,
2757       29,    36,    41,    45,    65,    96,   122,   140,   141,   142,
2758      145,   160,   161,   176,   184,   224,   233,   234,   167,   182,
2759      122,   123,   126,   218,   126,   226,   123,   228,   175,     3,
2760      219,   150,   121,    97,   103,   128,    97,   129,     3,   146,
2761      147,     3,   146,    96,    67,    34,    50,   207,     3,     3,
2762        3,   228,   228,   228,   228,   228,   228,   228,   228,   228,
2763      228,   228,   228,   228,   228,   228,   228,   228,   228,   228,
2764      228,   228,   228,   228,   228,   228,   228,   228,   228,   228,
2765      228,   228,   228,   228,   228,   228,   228,   228,   228,     3,
2766      219,   226,    17,     3,   226,   226,     3,   128,   139,   141,
2767      228,    96,    13,    17,   228,    96,   135,   136,   137,   143,
2768      190,   192,   201,   208,   181,   178,   219,     3,    90,   204,
2769      205,   206,   129,     3,   113,   129,   138,   139,   129,   226,
2770      225,   225,   225,   103,   217,    97,   217,   226,   226,     3,
2771       53,   187,    53,   188,   217,   103,   121,   129,   129,     3,
2772      128,   141,   126,     3,   129,   128,   137,   135,   129,    99,
2773      103,   202,   206,   129,    97,   142,   128,   129,   103,    35,
2774      113,   179,   214,   216,    99,   144,   147,    96,   129,   126,
2775      214,    16,   189,   214,   215,   122,   144,   228,   142,   226,
2776       99,   122,   128,     4,     7,     8,     9,    11,    44,    54,
2777       55,   203,   216,   217,    90,   206,    27,    32,   168,   170,
2778      172,   173,   142,   225,   123,   225,   227,   142,   204,   215,
2779      122,    97,   193,   129,     3,     4,    33,    61,   162,   163,
2780      164,   165,   202,   122,   206,   122,   126,   168,   170,    64,
2781      148,   129,   129,   191,   214,    45,    96,   184,   197,   198,
2782      199,   228,   103,   128,   164,   165,   138,   171,     3,   142,
2783      142,   217,    96,   140,   184,   194,   195,   196,   201,   208,
2784        3,    26,   128,   199,   103,   138,   128,   138,   217,   122,
2785      128,   196,   207,   138,   128,   129,   209,     3,   169,   138,
2786      126,   122,   128,   204,   138,   129,   128,   217
2787 };
2788
2789 #define yyerrok         (yyerrstatus = 0)
2790 #define yyclearin       (yychar = YYEMPTY)
2791 #define YYEMPTY         (-2)
2792 #define YYEOF           0
2793
2794 #define YYACCEPT        goto yyacceptlab
2795 #define YYABORT         goto yyabortlab
2796 #define YYERROR         goto yyerrorlab
2797
2798
2799 /* Like YYERROR except do call yyerror.  This remains here temporarily
2800    to ease the transition to the new meaning of YYERROR, for GCC.
2801    Once GCC version 2 has supplanted version 1, this can go.  */
2802
2803 #define YYFAIL          goto yyerrlab
2804
2805 #define YYRECOVERING()  (!!yyerrstatus)
2806
2807 #define YYBACKUP(Token, Value)                                  \
2808 do                                                              \
2809   if (yychar == YYEMPTY && yylen == 1)                          \
2810     {                                                           \
2811       yychar = (Token);                                         \
2812       yylval = (Value);                                         \
2813       yytoken = YYTRANSLATE (yychar);                           \
2814       YYPOPSTACK (1);                                           \
2815       goto yybackup;                                            \
2816     }                                                           \
2817   else                                                          \
2818     {                                                           \
2819       yyerror (YY_("syntax error: cannot back up")); \
2820       YYERROR;                                                  \
2821     }                                                           \
2822 while (YYID (0))
2823
2824
2825 #define YYTERROR        1
2826 #define YYERRCODE       256
2827
2828
2829 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2830    If N is 0, then set CURRENT to the empty location which ends
2831    the previous symbol: RHS[0] (always defined).  */
2832
2833 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2834 #ifndef YYLLOC_DEFAULT
2835 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
2836     do                                                                  \
2837       if (YYID (N))                                                    \
2838         {                                                               \
2839           (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
2840           (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
2841           (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
2842           (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
2843         }                                                               \
2844       else                                                              \
2845         {                                                               \
2846           (Current).first_line   = (Current).last_line   =              \
2847             YYRHSLOC (Rhs, 0).last_line;                                \
2848           (Current).first_column = (Current).last_column =              \
2849             YYRHSLOC (Rhs, 0).last_column;                              \
2850         }                                                               \
2851     while (YYID (0))
2852 #endif
2853
2854
2855 /* YY_LOCATION_PRINT -- Print the location on the stream.
2856    This macro was not mandated originally: define only if we know
2857    we won't break user code: when these are the locations we know.  */
2858
2859 #ifndef YY_LOCATION_PRINT
2860 # if YYLTYPE_IS_TRIVIAL
2861 #  define YY_LOCATION_PRINT(File, Loc)                  \
2862      fprintf (File, "%d.%d-%d.%d",                      \
2863               (Loc).first_line, (Loc).first_column,     \
2864               (Loc).last_line,  (Loc).last_column)
2865 # else
2866 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2867 # endif
2868 #endif
2869
2870
2871 /* YYLEX -- calling `yylex' with the right arguments.  */
2872
2873 #ifdef YYLEX_PARAM
2874 # define YYLEX yylex (YYLEX_PARAM)
2875 #else
2876 # define YYLEX yylex ()
2877 #endif
2878
2879 /* Enable debugging if requested.  */
2880 #if YYDEBUG
2881
2882 # ifndef YYFPRINTF
2883 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2884 #  define YYFPRINTF fprintf
2885 # endif
2886
2887 # define YYDPRINTF(Args)                        \
2888 do {                                            \
2889   if (yydebug)                                  \
2890     YYFPRINTF Args;                             \
2891 } while (YYID (0))
2892
2893 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
2894 do {                                                                      \
2895   if (yydebug)                                                            \
2896     {                                                                     \
2897       YYFPRINTF (stderr, "%s ", Title);                                   \
2898       yy_symbol_print (stderr,                                            \
2899                   Type, Value); \
2900       YYFPRINTF (stderr, "\n");                                           \
2901     }                                                                     \
2902 } while (YYID (0))
2903
2904
2905 /*--------------------------------.
2906 | Print this symbol on YYOUTPUT.  |
2907 `--------------------------------*/
2908
2909 /*ARGSUSED*/
2910 #if (defined __STDC__ || defined __C99__FUNC__ \
2911      || defined __cplusplus || defined _MSC_VER)
2912 static void
2913 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2914 #else
2915 static void
2916 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
2917     FILE *yyoutput;
2918     int yytype;
2919     YYSTYPE const * const yyvaluep;
2920 #endif
2921 {
2922   if (!yyvaluep)
2923     return;
2924 # ifdef YYPRINT
2925   if (yytype < YYNTOKENS)
2926     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2927 # else
2928   YYUSE (yyoutput);
2929 # endif
2930   switch (yytype)
2931     {
2932       default:
2933         break;
2934     }
2935 }
2936
2937
2938 /*--------------------------------.
2939 | Print this symbol on YYOUTPUT.  |
2940 `--------------------------------*/
2941
2942 #if (defined __STDC__ || defined __C99__FUNC__ \
2943      || defined __cplusplus || defined _MSC_VER)
2944 static void
2945 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2946 #else
2947 static void
2948 yy_symbol_print (yyoutput, yytype, yyvaluep)
2949     FILE *yyoutput;
2950     int yytype;
2951     YYSTYPE const * const yyvaluep;
2952 #endif
2953 {
2954   if (yytype < YYNTOKENS)
2955     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2956   else
2957     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2958
2959   yy_symbol_value_print (yyoutput, yytype, yyvaluep);
2960   YYFPRINTF (yyoutput, ")");
2961 }
2962
2963 /*------------------------------------------------------------------.
2964 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
2965 | TOP (included).                                                   |
2966 `------------------------------------------------------------------*/
2967
2968 #if (defined __STDC__ || defined __C99__FUNC__ \
2969      || defined __cplusplus || defined _MSC_VER)
2970 static void
2971 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
2972 #else
2973 static void
2974 yy_stack_print (yybottom, yytop)
2975     yytype_int16 *yybottom;
2976     yytype_int16 *yytop;
2977 #endif
2978 {
2979   YYFPRINTF (stderr, "Stack now");
2980   for (; yybottom <= yytop; yybottom++)
2981     {
2982       int yybot = *yybottom;
2983       YYFPRINTF (stderr, " %d", yybot);
2984     }
2985   YYFPRINTF (stderr, "\n");
2986 }
2987
2988 # define YY_STACK_PRINT(Bottom, Top)                            \
2989 do {                                                            \
2990   if (yydebug)                                                  \
2991     yy_stack_print ((Bottom), (Top));                           \
2992 } while (YYID (0))
2993
2994
2995 /*------------------------------------------------.
2996 | Report that the YYRULE is going to be reduced.  |
2997 `------------------------------------------------*/
2998
2999 #if (defined __STDC__ || defined __C99__FUNC__ \
3000      || defined __cplusplus || defined _MSC_VER)
3001 static void
3002 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3003 #else
3004 static void
3005 yy_reduce_print (yyvsp, yyrule)
3006     YYSTYPE *yyvsp;
3007     int yyrule;
3008 #endif
3009 {
3010   int yynrhs = yyr2[yyrule];
3011   int yyi;
3012   unsigned long int yylno = yyrline[yyrule];
3013   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3014              yyrule - 1, yylno);
3015   /* The symbols being reduced.  */
3016   for (yyi = 0; yyi < yynrhs; yyi++)
3017     {
3018       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
3019       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3020                        &(yyvsp[(yyi + 1) - (yynrhs)])
3021                                        );
3022       YYFPRINTF (stderr, "\n");
3023     }
3024 }
3025
3026 # define YY_REDUCE_PRINT(Rule)          \
3027 do {                                    \
3028   if (yydebug)                          \
3029     yy_reduce_print (yyvsp, Rule); \
3030 } while (YYID (0))
3031
3032 /* Nonzero means print parse trace.  It is left uninitialized so that
3033    multiple parsers can coexist.  */
3034 int yydebug;
3035 #else /* !YYDEBUG */
3036 # define YYDPRINTF(Args)
3037 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3038 # define YY_STACK_PRINT(Bottom, Top)
3039 # define YY_REDUCE_PRINT(Rule)
3040 #endif /* !YYDEBUG */
3041
3042
3043 /* YYINITDEPTH -- initial size of the parser's stacks.  */
3044 #ifndef YYINITDEPTH
3045 # define YYINITDEPTH 200
3046 #endif
3047
3048 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3049    if the built-in stack extension method is used).
3050
3051    Do not make this value too large; the results are undefined if
3052    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3053    evaluated with infinite-precision integer arithmetic.  */
3054
3055 #ifndef YYMAXDEPTH
3056 # define YYMAXDEPTH 10000
3057 #endif
3058
3059 \f
3060
3061 #if YYERROR_VERBOSE
3062
3063 # ifndef yystrlen
3064 #  if defined __GLIBC__ && defined _STRING_H
3065 #   define yystrlen strlen
3066 #  else
3067 /* Return the length of YYSTR.  */
3068 #if (defined __STDC__ || defined __C99__FUNC__ \
3069      || defined __cplusplus || defined _MSC_VER)
3070 static YYSIZE_T
3071 yystrlen (const char *yystr)
3072 #else
3073 static YYSIZE_T
3074 yystrlen (yystr)
3075     const char *yystr;
3076 #endif
3077 {
3078   YYSIZE_T yylen;
3079   for (yylen = 0; yystr[yylen]; yylen++)
3080     continue;
3081   return yylen;
3082 }
3083 #  endif
3084 # endif
3085
3086 # ifndef yystpcpy
3087 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3088 #   define yystpcpy stpcpy
3089 #  else
3090 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3091    YYDEST.  */
3092 #if (defined __STDC__ || defined __C99__FUNC__ \
3093      || defined __cplusplus || defined _MSC_VER)
3094 static char *
3095 yystpcpy (char *yydest, const char *yysrc)
3096 #else
3097 static char *
3098 yystpcpy (yydest, yysrc)
3099     char *yydest;
3100     const char *yysrc;
3101 #endif
3102 {
3103   char *yyd = yydest;
3104   const char *yys = yysrc;
3105
3106   while ((*yyd++ = *yys++) != '\0')
3107     continue;
3108
3109   return yyd - 1;
3110 }
3111 #  endif
3112 # endif
3113
3114 # ifndef yytnamerr
3115 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3116    quotes and backslashes, so that it's suitable for yyerror.  The
3117    heuristic is that double-quoting is unnecessary unless the string
3118    contains an apostrophe, a comma, or backslash (other than
3119    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
3120    null, do not copy; instead, return the length of what the result
3121    would have been.  */
3122 static YYSIZE_T
3123 yytnamerr (char *yyres, const char *yystr)
3124 {
3125   if (*yystr == '"')
3126     {
3127       YYSIZE_T yyn = 0;
3128       char const *yyp = yystr;
3129
3130       for (;;)
3131         switch (*++yyp)
3132           {
3133           case '\'':
3134           case ',':
3135             goto do_not_strip_quotes;
3136
3137           case '\\':
3138             if (*++yyp != '\\')
3139               goto do_not_strip_quotes;
3140             /* Fall through.  */
3141           default:
3142             if (yyres)
3143               yyres[yyn] = *yyp;
3144             yyn++;
3145             break;
3146
3147           case '"':
3148             if (yyres)
3149               yyres[yyn] = '\0';
3150             return yyn;
3151           }
3152     do_not_strip_quotes: ;
3153     }
3154
3155   if (! yyres)
3156     return yystrlen (yystr);
3157
3158   return yystpcpy (yyres, yystr) - yyres;
3159 }
3160 # endif
3161
3162 /* Copy into YYRESULT an error message about the unexpected token
3163    YYCHAR while in state YYSTATE.  Return the number of bytes copied,
3164    including the terminating null byte.  If YYRESULT is null, do not
3165    copy anything; just return the number of bytes that would be
3166    copied.  As a special case, return 0 if an ordinary "syntax error"
3167    message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
3168    size calculation.  */
3169 static YYSIZE_T
3170 yysyntax_error (char *yyresult, int yystate, int yychar)
3171 {
3172   int yyn = yypact[yystate];
3173
3174   if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3175     return 0;
3176   else
3177     {
3178       int yytype = YYTRANSLATE (yychar);
3179       YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3180       YYSIZE_T yysize = yysize0;
3181       YYSIZE_T yysize1;
3182       int yysize_overflow = 0;
3183       enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3184       char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3185       int yyx;
3186
3187 # if 0
3188       /* This is so xgettext sees the translatable formats that are
3189          constructed on the fly.  */
3190       YY_("syntax error, unexpected %s");
3191       YY_("syntax error, unexpected %s, expecting %s");
3192       YY_("syntax error, unexpected %s, expecting %s or %s");
3193       YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3194       YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3195 # endif
3196       char *yyfmt;
3197       char const *yyf;
3198       static char const yyunexpected[] = "syntax error, unexpected %s";
3199       static char const yyexpecting[] = ", expecting %s";
3200       static char const yyor[] = " or %s";
3201       char yyformat[sizeof yyunexpected
3202                     + sizeof yyexpecting - 1
3203                     + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3204                        * (sizeof yyor - 1))];
3205       char const *yyprefix = yyexpecting;
3206
3207       /* Start YYX at -YYN if negative to avoid negative indexes in
3208          YYCHECK.  */
3209       int yyxbegin = yyn < 0 ? -yyn : 0;
3210
3211       /* Stay within bounds of both yycheck and yytname.  */
3212       int yychecklim = YYLAST - yyn + 1;
3213       int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3214       int yycount = 1;
3215
3216       yyarg[0] = yytname[yytype];
3217       yyfmt = yystpcpy (yyformat, yyunexpected);
3218
3219       for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3220         if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3221           {
3222             if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3223               {
3224                 yycount = 1;
3225                 yysize = yysize0;
3226                 yyformat[sizeof yyunexpected - 1] = '\0';
3227                 break;
3228               }
3229             yyarg[yycount++] = yytname[yyx];
3230             yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3231             yysize_overflow |= (yysize1 < yysize);
3232             yysize = yysize1;
3233             yyfmt = yystpcpy (yyfmt, yyprefix);
3234             yyprefix = yyor;
3235           }
3236
3237       yyf = YY_(yyformat);
3238       yysize1 = yysize + yystrlen (yyf);
3239       yysize_overflow |= (yysize1 < yysize);
3240       yysize = yysize1;
3241
3242       if (yysize_overflow)
3243         return YYSIZE_MAXIMUM;
3244
3245       if (yyresult)
3246         {
3247           /* Avoid sprintf, as that infringes on the user's name space.
3248              Don't have undefined behavior even if the translation
3249              produced a string with the wrong number of "%s"s.  */
3250           char *yyp = yyresult;
3251           int yyi = 0;
3252           while ((*yyp = *yyf) != '\0')
3253             {
3254               if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3255                 {
3256                   yyp += yytnamerr (yyp, yyarg[yyi++]);
3257                   yyf += 2;
3258                 }
3259               else
3260                 {
3261                   yyp++;
3262                   yyf++;
3263                 }
3264             }
3265         }
3266       return yysize;
3267     }
3268 }
3269 #endif /* YYERROR_VERBOSE */
3270 \f
3271
3272 /*-----------------------------------------------.
3273 | Release the memory associated to this symbol.  |
3274 `-----------------------------------------------*/
3275
3276 /*ARGSUSED*/
3277 #if (defined __STDC__ || defined __C99__FUNC__ \
3278      || defined __cplusplus || defined _MSC_VER)
3279 static void
3280 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
3281 #else
3282 static void
3283 yydestruct (yymsg, yytype, yyvaluep)
3284     const char *yymsg;
3285     int yytype;
3286     YYSTYPE *yyvaluep;
3287 #endif
3288 {
3289   YYUSE (yyvaluep);
3290
3291   if (!yymsg)
3292     yymsg = "Deleting";
3293   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
3294
3295   switch (yytype)
3296     {
3297
3298       default:
3299         break;
3300     }
3301 }
3302
3303 /* Prevent warnings from -Wmissing-prototypes.  */
3304 #ifdef YYPARSE_PARAM
3305 #if defined __STDC__ || defined __cplusplus
3306 int yyparse (void *YYPARSE_PARAM);
3307 #else
3308 int yyparse ();
3309 #endif
3310 #else /* ! YYPARSE_PARAM */
3311 #if defined __STDC__ || defined __cplusplus
3312 int yyparse (void);
3313 #else
3314 int yyparse ();
3315 #endif
3316 #endif /* ! YYPARSE_PARAM */
3317
3318
3319 /* The lookahead symbol.  */
3320 int yychar;
3321
3322 /* The semantic value of the lookahead symbol.  */
3323 YYSTYPE yylval;
3324
3325 /* Number of syntax errors so far.  */
3326 int yynerrs;
3327
3328
3329
3330 /*-------------------------.
3331 | yyparse or yypush_parse.  |
3332 `-------------------------*/
3333
3334 #ifdef YYPARSE_PARAM
3335 #if (defined __STDC__ || defined __C99__FUNC__ \
3336      || defined __cplusplus || defined _MSC_VER)
3337 int
3338 yyparse (void *YYPARSE_PARAM)
3339 #else
3340 int
3341 yyparse (YYPARSE_PARAM)
3342     void *YYPARSE_PARAM;
3343 #endif
3344 #else /* ! YYPARSE_PARAM */
3345 #if (defined __STDC__ || defined __C99__FUNC__ \
3346      || defined __cplusplus || defined _MSC_VER)
3347 int
3348 yyparse (void)
3349 #else
3350 int
3351 yyparse ()
3352
3353 #endif
3354 #endif
3355 {
3356
3357
3358     int yystate;
3359     /* Number of tokens to shift before error messages enabled.  */
3360     int yyerrstatus;
3361
3362     /* The stacks and their tools:
3363        `yyss': related to states.
3364        `yyvs': related to semantic values.
3365
3366        Refer to the stacks thru separate pointers, to allow yyoverflow
3367        to reallocate them elsewhere.  */
3368
3369     /* The state stack.  */
3370     yytype_int16 yyssa[YYINITDEPTH];
3371     yytype_int16 *yyss;
3372     yytype_int16 *yyssp;
3373
3374     /* The semantic value stack.  */
3375     YYSTYPE yyvsa[YYINITDEPTH];
3376     YYSTYPE *yyvs;
3377     YYSTYPE *yyvsp;
3378
3379     YYSIZE_T yystacksize;
3380
3381   int yyn;
3382   int yyresult;
3383   /* Lookahead token as an internal (translated) token number.  */
3384   int yytoken;
3385   /* The variables used to return semantic value and location from the
3386      action routines.  */
3387   YYSTYPE yyval;
3388
3389 #if YYERROR_VERBOSE
3390   /* Buffer for error messages, and its allocated size.  */
3391   char yymsgbuf[128];
3392   char *yymsg = yymsgbuf;
3393   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
3394 #endif
3395
3396 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
3397
3398   /* The number of symbols on the RHS of the reduced rule.
3399      Keep to zero when no symbol should be popped.  */
3400   int yylen = 0;
3401
3402   yytoken = 0;
3403   yyss = yyssa;
3404   yyvs = yyvsa;
3405   yystacksize = YYINITDEPTH;
3406
3407   YYDPRINTF ((stderr, "Starting parse\n"));
3408
3409   yystate = 0;
3410   yyerrstatus = 0;
3411   yynerrs = 0;
3412   yychar = YYEMPTY; /* Cause a token to be read.  */
3413
3414   /* Initialize stack pointers.
3415      Waste one element of value and location stack
3416      so that they stay on the same level as the state stack.
3417      The wasted elements are never initialized.  */
3418   yyssp = yyss;
3419   yyvsp = yyvs;
3420
3421   goto yysetstate;
3422
3423 /*------------------------------------------------------------.
3424 | yynewstate -- Push a new state, which is found in yystate.  |
3425 `------------------------------------------------------------*/
3426  yynewstate:
3427   /* In all cases, when you get here, the value and location stacks
3428      have just been pushed.  So pushing a state here evens the stacks.  */
3429   yyssp++;
3430
3431  yysetstate:
3432   *yyssp = yystate;
3433
3434   if (yyss + yystacksize - 1 <= yyssp)
3435     {
3436       /* Get the current used size of the three stacks, in elements.  */
3437       YYSIZE_T yysize = yyssp - yyss + 1;
3438
3439 #ifdef yyoverflow
3440       {
3441         /* Give user a chance to reallocate the stack.  Use copies of
3442            these so that the &'s don't force the real ones into
3443            memory.  */
3444         YYSTYPE *yyvs1 = yyvs;
3445         yytype_int16 *yyss1 = yyss;
3446
3447         /* Each stack pointer address is followed by the size of the
3448            data in use in that stack, in bytes.  This used to be a
3449            conditional around just the two extra args, but that might
3450            be undefined if yyoverflow is a macro.  */
3451         yyoverflow (YY_("memory exhausted"),
3452                     &yyss1, yysize * sizeof (*yyssp),
3453                     &yyvs1, yysize * sizeof (*yyvsp),
3454                     &yystacksize);
3455
3456         yyss = yyss1;
3457         yyvs = yyvs1;
3458       }
3459 #else /* no yyoverflow */
3460 # ifndef YYSTACK_RELOCATE
3461       goto yyexhaustedlab;
3462 # else
3463       /* Extend the stack our own way.  */
3464       if (YYMAXDEPTH <= yystacksize)
3465         goto yyexhaustedlab;
3466       yystacksize *= 2;
3467       if (YYMAXDEPTH < yystacksize)
3468         yystacksize = YYMAXDEPTH;
3469
3470       {
3471         yytype_int16 *yyss1 = yyss;
3472         union yyalloc *yyptr =
3473           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
3474         if (! yyptr)
3475           goto yyexhaustedlab;
3476         YYSTACK_RELOCATE (yyss_alloc, yyss);
3477         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
3478 #  undef YYSTACK_RELOCATE
3479         if (yyss1 != yyssa)
3480           YYSTACK_FREE (yyss1);
3481       }
3482 # endif
3483 #endif /* no yyoverflow */
3484
3485       yyssp = yyss + yysize - 1;
3486       yyvsp = yyvs + yysize - 1;
3487
3488       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
3489                   (unsigned long int) yystacksize));
3490
3491       if (yyss + yystacksize - 1 <= yyssp)
3492         YYABORT;
3493     }
3494
3495   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3496
3497   if (yystate == YYFINAL)
3498     YYACCEPT;
3499
3500   goto yybackup;
3501
3502 /*-----------.
3503 | yybackup.  |
3504 `-----------*/
3505 yybackup:
3506
3507   /* Do appropriate processing given the current state.  Read a
3508      lookahead token if we need one and don't already have one.  */
3509
3510   /* First try to decide what to do without reference to lookahead token.  */
3511   yyn = yypact[yystate];
3512   if (yyn == YYPACT_NINF)
3513     goto yydefault;
3514
3515   /* Not known => get a lookahead token if don't already have one.  */
3516
3517   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
3518   if (yychar == YYEMPTY)
3519     {
3520       YYDPRINTF ((stderr, "Reading a token: "));
3521       yychar = YYLEX;
3522     }
3523
3524   if (yychar <= YYEOF)
3525     {
3526       yychar = yytoken = YYEOF;
3527       YYDPRINTF ((stderr, "Now at end of input.\n"));
3528     }
3529   else
3530     {
3531       yytoken = YYTRANSLATE (yychar);
3532       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3533     }
3534
3535   /* If the proper action on seeing token YYTOKEN is to reduce or to
3536      detect an error, take that action.  */
3537   yyn += yytoken;
3538   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3539     goto yydefault;
3540   yyn = yytable[yyn];
3541   if (yyn <= 0)
3542     {
3543       if (yyn == 0 || yyn == YYTABLE_NINF)
3544         goto yyerrlab;
3545       yyn = -yyn;
3546       goto yyreduce;
3547     }
3548
3549   /* Count tokens shifted since error; after three, turn off error
3550      status.  */
3551   if (yyerrstatus)
3552     yyerrstatus--;
3553
3554   /* Shift the lookahead token.  */
3555   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3556
3557   /* Discard the shifted token.  */
3558   yychar = YYEMPTY;
3559
3560   yystate = yyn;
3561   *++yyvsp = yylval;
3562
3563   goto yynewstate;
3564
3565
3566 /*-----------------------------------------------------------.
3567 | yydefault -- do the default action for the current state.  |
3568 `-----------------------------------------------------------*/
3569 yydefault:
3570   yyn = yydefact[yystate];
3571   if (yyn == 0)
3572     goto yyerrlab;
3573   goto yyreduce;
3574
3575
3576 /*-----------------------------.
3577 | yyreduce -- Do a reduction.  |
3578 `-----------------------------*/
3579 yyreduce:
3580   /* yyn is the number of a rule to reduce with.  */
3581   yylen = yyr2[yyn];
3582
3583   /* If YYLEN is nonzero, implement the default value of the action:
3584      `$$ = $1'.
3585
3586      Otherwise, the following line sets YYVAL to garbage.
3587      This behavior is undocumented and Bison
3588      users should not rely upon it.  Assigning to YYVAL
3589      unconditionally makes the parser a bit smaller, and it avoids a
3590      GCC warning that YYVAL may be used uninitialized.  */
3591   yyval = yyvsp[1-yylen];
3592
3593
3594   YY_REDUCE_PRINT (yyn);
3595   switch (yyn)
3596     {
3597         case 24:
3598
3599 /* Line 1455 of yacc.c  */
3600 #line 1509 "parser.y"
3601     {(yyval.code)=(yyvsp[(1) - (1)].code);;}
3602     break;
3603
3604   case 25:
3605
3606 /* Line 1455 of yacc.c  */
3607 #line 1510 "parser.y"
3608     {(yyval.code)=code_new();;}
3609     break;
3610
3611   case 26:
3612
3613 /* Line 1455 of yacc.c  */
3614 #line 1512 "parser.y"
3615     {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));;}
3616     break;
3617
3618   case 27:
3619
3620 /* Line 1455 of yacc.c  */
3621 #line 1513 "parser.y"
3622     {(yyval.code)=(yyvsp[(1) - (1)].code);;}
3623     break;
3624
3625   case 38:
3626
3627 /* Line 1455 of yacc.c  */
3628 #line 1528 "parser.y"
3629     {(yyval.code)=0;;}
3630     break;
3631
3632   case 45:
3633
3634 /* Line 1455 of yacc.c  */
3635 #line 1536 "parser.y"
3636     {/*TODO*/(yyval.code)=0;;}
3637     break;
3638
3639   case 46:
3640
3641 /* Line 1455 of yacc.c  */
3642 #line 1537 "parser.y"
3643     {/*TODO*/(yyval.code)=0;;}
3644     break;
3645
3646   case 47:
3647
3648 /* Line 1455 of yacc.c  */
3649 #line 1539 "parser.y"
3650     {(yyval.code)=(yyvsp[(2) - (3)].code);;}
3651     break;
3652
3653   case 48:
3654
3655 /* Line 1455 of yacc.c  */
3656 #line 1540 "parser.y"
3657     {(yyval.code)=0;;}
3658     break;
3659
3660   case 49:
3661
3662 /* Line 1455 of yacc.c  */
3663 #line 1541 "parser.y"
3664     {(yyval.code)=(yyvsp[(1) - (2)].code);;}
3665     break;
3666
3667   case 50:
3668
3669 /* Line 1455 of yacc.c  */
3670 #line 1542 "parser.y"
3671     {(yyval.code)=(yyvsp[(1) - (1)].code);;}
3672     break;
3673
3674   case 51:
3675
3676 /* Line 1455 of yacc.c  */
3677 #line 1546 "parser.y"
3678     {
3679     code_t**cc = &global->init->method->body->code;
3680     *cc = code_append(*cc, (yyvsp[(1) - (1)].code));
3681 ;}
3682     break;
3683
3684   case 52:
3685
3686 /* Line 1455 of yacc.c  */
3687 #line 1553 "parser.y"
3688     {(yyval.value)=(yyvsp[(2) - (2)].value);;}
3689     break;
3690
3691   case 53:
3692
3693 /* Line 1455 of yacc.c  */
3694 #line 1554 "parser.y"
3695     {(yyval.value).c=abc_pushundefined(0);
3696                                   (yyval.value).t=TYPE_ANY;
3697                                  ;}
3698     break;
3699
3700   case 54:
3701
3702 /* Line 1455 of yacc.c  */
3703 #line 1558 "parser.y"
3704     {(yyval.code)=(yyvsp[(2) - (2)].code);;}
3705     break;
3706
3707   case 55:
3708
3709 /* Line 1455 of yacc.c  */
3710 #line 1559 "parser.y"
3711     {(yyval.code)=(yyvsp[(2) - (2)].code);;}
3712     break;
3713
3714   case 56:
3715
3716 /* Line 1455 of yacc.c  */
3717 #line 1561 "parser.y"
3718     {(yyval.code) = (yyvsp[(1) - (1)].code);;}
3719     break;
3720
3721   case 57:
3722
3723 /* Line 1455 of yacc.c  */
3724 #line 1562 "parser.y"
3725     {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));;}
3726     break;
3727
3728   case 58:
3729
3730 /* Line 1455 of yacc.c  */
3731 #line 1565 "parser.y"
3732     {
3733     if(variable_exists((yyvsp[(1) - (3)].id)))
3734         syntaxerror("Variable %s already defined", (yyvsp[(1) - (3)].id));
3735    
3736     if(!is_subtype_of((yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo))) {
3737         syntaxerror("Can't convert %s to %s", (yyvsp[(3) - (3)].value).t->name, 
3738                                               (yyvsp[(2) - (3)].classinfo)->name);
3739     }
3740
3741     int index = new_variable((yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].classinfo), 1);
3742     
3743     if((yyvsp[(2) - (3)].classinfo)) {
3744         if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) {
3745             (yyval.code) = (yyvsp[(3) - (3)].value).c;
3746             (yyval.code) = converttype((yyval.code), (yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo));
3747             (yyval.code) = abc_setlocal((yyval.code), index);
3748         } else {
3749             (yyval.code) = defaultvalue(0, (yyvsp[(2) - (3)].classinfo));
3750             (yyval.code) = abc_setlocal((yyval.code), index);
3751         }
3752     } else {
3753         if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) {
3754             (yyval.code) = (yyvsp[(3) - (3)].value).c;
3755             (yyval.code) = abc_coerce_a((yyval.code));
3756             (yyval.code) = abc_setlocal((yyval.code), index);
3757         } else {
3758             (yyval.code) = code_new();
3759         }
3760     }
3761     
3762     /* that's the default for a local register, anyway
3763         else {
3764         state->method->initcode = abc_pushundefined(state->method->initcode);
3765         state->method->initcode = abc_setlocal(state->method->initcode, index);
3766     }*/
3767     //printf("variable %s -> %d (%s)\n", $2->text, index, $4.t?$4.t->name:"");
3768 ;}
3769     break;
3770
3771   case 59:
3772
3773 /* Line 1455 of yacc.c  */
3774 #line 1605 "parser.y"
3775     {(yyval.code) = code_new();;}
3776     break;
3777
3778   case 60:
3779
3780 /* Line 1455 of yacc.c  */
3781 #line 1606 "parser.y"
3782     {(yyval.code)=(yyvsp[(2) - (2)].code);;}
3783     break;
3784
3785   case 61:
3786
3787 /* Line 1455 of yacc.c  */
3788 #line 1609 "parser.y"
3789     {new_state();;}
3790     break;
3791
3792   case 62:
3793
3794 /* Line 1455 of yacc.c  */
3795 #line 1609 "parser.y"
3796     {
3797      
3798     (yyval.code) = code_new();
3799     (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (7)].value).c);
3800     code_t*myjmp,*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
3801    
3802     (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].code));
3803     if((yyvsp[(7) - (7)].code)) {
3804         myjmp = (yyval.code) = abc_jump((yyval.code), 0);
3805     }
3806     myif->branch = (yyval.code) = abc_nop((yyval.code));
3807     if((yyvsp[(7) - (7)].code)) {
3808         (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (7)].code));
3809         myjmp->branch = (yyval.code) = abc_nop((yyval.code));
3810     }
3811     (yyval.code) = var_block((yyval.code));
3812     old_state();
3813 ;}
3814     break;
3815
3816   case 63:
3817
3818 /* Line 1455 of yacc.c  */
3819 #line 1628 "parser.y"
3820     {(yyval.code)=code_new();;}
3821     break;
3822
3823   case 66:
3824
3825 /* Line 1455 of yacc.c  */
3826 #line 1633 "parser.y"
3827     {
3828     (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1);
3829 ;}
3830     break;
3831
3832   case 67:
3833
3834 /* Line 1455 of yacc.c  */
3835 #line 1636 "parser.y"
3836     {
3837     (yyval.id)=(yyvsp[(1) - (1)].id);
3838 ;}
3839     break;
3840
3841   case 68:
3842
3843 /* Line 1455 of yacc.c  */
3844 #line 1640 "parser.y"
3845     {new_state();(yyval.for_start).name=(yyvsp[(1) - (2)].id);(yyval.for_start).each=0;;}
3846     break;
3847
3848   case 69:
3849
3850 /* Line 1455 of yacc.c  */
3851 #line 1641 "parser.y"
3852     {new_state();(yyval.for_start).name=(yyvsp[(1) - (3)].id);(yyval.for_start).each=1;;}
3853     break;
3854
3855   case 70:
3856
3857 /* Line 1455 of yacc.c  */
3858 #line 1643 "parser.y"
3859     {
3860     if((yyvsp[(1) - (8)].for_start).each) syntaxerror("invalid syntax: ; not allowed in for each statement");
3861     (yyval.code) = code_new();
3862     (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (8)].code));
3863     code_t*loopstart = (yyval.code) = abc_label((yyval.code));
3864     (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (8)].value).c);
3865     code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
3866     (yyval.code) = code_append((yyval.code), (yyvsp[(8) - (8)].code));
3867     code_t*cont = (yyval.code) = abc_nop((yyval.code));
3868     (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (8)].code));
3869     (yyval.code) = abc_jump((yyval.code), loopstart);
3870     code_t*out = (yyval.code) = abc_nop((yyval.code));
3871     breakjumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, out);
3872     continuejumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, cont);
3873     myif->branch = out;
3874
3875     (yyval.code) = var_block((yyval.code));
3876     old_state();
3877 ;}
3878     break;
3879
3880   case 71:
3881
3882 /* Line 1455 of yacc.c  */
3883 #line 1663 "parser.y"
3884     {
3885     variable_t*var = find_variable((yyvsp[(2) - (6)].id));
3886     char*tmp1name = concat2((yyvsp[(2) - (6)].id), "__tmp1__");
3887     int it = new_variable(tmp1name, TYPE_INT, 0);
3888     char*tmp2name = concat2((yyvsp[(2) - (6)].id), "__array__");
3889     int array = new_variable(tmp1name, 0, 0);
3890
3891     (yyval.code) = code_new();
3892     (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
3893     (yyval.code) = abc_coerce_a((yyval.code));
3894     (yyval.code) = abc_setlocal((yyval.code), array);
3895     (yyval.code) = abc_pushbyte((yyval.code), 0);
3896     (yyval.code) = abc_setlocal((yyval.code), it);
3897
3898     code_t*loopstart = (yyval.code) = abc_label((yyval.code));
3899     
3900     (yyval.code) = abc_hasnext2((yyval.code), array, it);
3901     code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
3902     (yyval.code) = abc_getlocal((yyval.code), array);
3903     (yyval.code) = abc_getlocal((yyval.code), it);
3904     if(!(yyvsp[(1) - (6)].for_start).each)
3905         (yyval.code) = abc_nextname((yyval.code));
3906     else
3907         (yyval.code) = abc_nextvalue((yyval.code));
3908     (yyval.code) = converttype((yyval.code), 0, var->type);
3909     (yyval.code) = abc_setlocal((yyval.code), var->index);
3910
3911     (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
3912     (yyval.code) = abc_jump((yyval.code), loopstart);
3913     
3914     code_t*out = (yyval.code) = abc_nop((yyval.code));
3915     breakjumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, out);
3916     continuejumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, loopstart);
3917     
3918     myif->branch = out;
3919
3920     (yyval.code) = var_block((yyval.code));
3921     old_state();
3922
3923     free(tmp1name);
3924     free(tmp2name);
3925 ;}
3926     break;
3927
3928   case 72:
3929
3930 /* Line 1455 of yacc.c  */
3931 #line 1706 "parser.y"
3932     {new_state();;}
3933     break;
3934
3935   case 73:
3936
3937 /* Line 1455 of yacc.c  */
3938 #line 1706 "parser.y"
3939     {
3940
3941     (yyval.code) = code_new();
3942
3943     code_t*myjmp = (yyval.code) = abc_jump((yyval.code), 0);
3944     code_t*loopstart = (yyval.code) = abc_label((yyval.code));
3945     (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
3946     code_t*cont = (yyval.code) = abc_nop((yyval.code));
3947     myjmp->branch = cont;
3948     (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
3949     (yyval.code) = abc_iftrue((yyval.code), loopstart);
3950     code_t*out = (yyval.code) = abc_nop((yyval.code));
3951     breakjumpsto((yyval.code), (yyvsp[(1) - (6)].id), out);
3952     continuejumpsto((yyval.code), (yyvsp[(1) - (6)].id), cont);
3953
3954     (yyval.code) = var_block((yyval.code));
3955     old_state();
3956 ;}
3957     break;
3958
3959   case 74:
3960
3961 /* Line 1455 of yacc.c  */
3962 #line 1725 "parser.y"
3963     {new_state();;}
3964     break;
3965
3966   case 75:
3967
3968 /* Line 1455 of yacc.c  */
3969 #line 1725 "parser.y"
3970     {
3971     (yyval.code) = code_new();
3972     code_t*loopstart = (yyval.code) = abc_label((yyval.code));
3973     (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (7)].code));
3974     code_t*cont = (yyval.code) = abc_nop((yyval.code));
3975     (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].value).c);
3976     (yyval.code) = abc_iftrue((yyval.code), loopstart);
3977     code_t*out = (yyval.code) = abc_nop((yyval.code));
3978     breakjumpsto((yyval.code), (yyvsp[(1) - (7)].id), out);
3979     continuejumpsto((yyval.code), (yyvsp[(1) - (7)].id), cont);
3980     
3981     (yyval.code) = var_block((yyval.code));
3982     old_state();
3983 ;}
3984     break;
3985
3986   case 76:
3987
3988 /* Line 1455 of yacc.c  */
3989 #line 1740 "parser.y"
3990     {
3991     (yyval.code) = abc___break__(0, "");
3992 ;}
3993     break;
3994
3995   case 77:
3996
3997 /* Line 1455 of yacc.c  */
3998 #line 1743 "parser.y"
3999     {
4000     (yyval.code) = abc___break__(0, (yyvsp[(2) - (2)].id));
4001 ;}
4002     break;
4003
4004   case 78:
4005
4006 /* Line 1455 of yacc.c  */
4007 #line 1746 "parser.y"
4008     {
4009     (yyval.code) = abc___continue__(0, "");
4010 ;}
4011     break;
4012
4013   case 79:
4014
4015 /* Line 1455 of yacc.c  */
4016 #line 1749 "parser.y"
4017     {
4018     (yyval.code) = abc___continue__(0, (yyvsp[(2) - (2)].id));
4019 ;}
4020     break;
4021
4022   case 80:
4023
4024 /* Line 1455 of yacc.c  */
4025 #line 1753 "parser.y"
4026     {(yyval.code)=0;;}
4027     break;
4028
4029   case 81:
4030
4031 /* Line 1455 of yacc.c  */
4032 #line 1754 "parser.y"
4033     {(yyval.code)=(yyvsp[(1) - (1)].code);;}
4034     break;
4035
4036   case 82:
4037
4038 /* Line 1455 of yacc.c  */
4039 #line 1755 "parser.y"
4040     {(yyval.code)=(yyvsp[(1) - (1)].code);;}
4041     break;
4042
4043   case 83:
4044
4045 /* Line 1455 of yacc.c  */
4046 #line 1756 "parser.y"
4047     {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));;}
4048     break;
4049
4050   case 84:
4051
4052 /* Line 1455 of yacc.c  */
4053 #line 1757 "parser.y"
4054     {(yyval.code)=(yyvsp[(1) - (1)].code);}
4055     break;
4056
4057   case 85:
4058
4059 /* Line 1455 of yacc.c  */
4060 #line 1758 "parser.y"
4061     {(yyval.code)=code_append((yyval.code),(yyvsp[(2) - (2)].code));;}
4062     break;
4063
4064   case 86:
4065
4066 /* Line 1455 of yacc.c  */
4067 #line 1760 "parser.y"
4068     {
4069     (yyval.code) = abc_dup(0);
4070     (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (4)].value).c);
4071     code_t*j = (yyval.code) = abc_ifne((yyval.code), 0);
4072     (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (4)].code));
4073     if((yyval.code)->opcode != OPCODE___BREAK__) {
4074         (yyval.code) = abc___fallthrough__((yyval.code), "");
4075     }
4076     code_t*e = (yyval.code) = abc_nop((yyval.code));
4077     j->branch = e;
4078 ;}
4079     break;
4080
4081   case 87:
4082
4083 /* Line 1455 of yacc.c  */
4084 #line 1771 "parser.y"
4085     {
4086     (yyval.code) = (yyvsp[(3) - (3)].code);
4087 ;}
4088     break;
4089
4090   case 88:
4091
4092 /* Line 1455 of yacc.c  */
4093 #line 1774 "parser.y"
4094     {new_state();;}
4095     break;
4096
4097   case 89:
4098
4099 /* Line 1455 of yacc.c  */
4100 #line 1774 "parser.y"
4101     {
4102     (yyval.code)=(yyvsp[(4) - (8)].value).c;
4103     (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (8)].code));
4104     code_t*out = (yyval.code) = abc_pop((yyval.code));
4105     breakjumpsto((yyval.code), (yyvsp[(1) - (8)].id), out);
4106     
4107     code_t*c = (yyval.code),*lastblock=0;
4108     while(c) {
4109         if(c->opcode == OPCODE_IFNE) {
4110             if(!c->next) syntaxerror("internal error in fallthrough handling");
4111             lastblock=c->next;
4112         } else if(c->opcode == OPCODE___FALLTHROUGH__) {
4113             if(lastblock) {
4114                 c->opcode = OPCODE_JUMP;
4115                 c->branch = lastblock;
4116             } else {
4117                 /* fall through end of switch */
4118                 c->opcode = OPCODE_NOP;
4119             }
4120         }
4121         c=c->prev;
4122     }
4123    
4124     (yyval.code) = var_block((yyval.code));
4125     old_state();
4126 ;}
4127     break;
4128
4129   case 90:
4130
4131 /* Line 1455 of yacc.c  */
4132 #line 1803 "parser.y"
4133     {new_state();state->exception_name=(yyvsp[(3) - (5)].id);new_variable((yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].classinfo), 0);;}
4134     break;
4135
4136   case 91:
4137
4138 /* Line 1455 of yacc.c  */
4139 #line 1804 "parser.y"
4140     {
4141     namespace_t name_ns = {ACCESS_PACKAGE, ""};
4142     multiname_t name = {QNAME, &name_ns, 0, (yyvsp[(3) - (9)].id)};
4143     
4144     NEW(abc_exception_t, e)
4145     e->exc_type = sig2mname((yyvsp[(4) - (9)].classinfo));
4146     e->var_name = multiname_clone(&name);
4147     (yyval.exception) = e;
4148
4149     code_t*c = 0;
4150     int i = find_variable_safe((yyvsp[(3) - (9)].id))->index;
4151     e->target = c = abc_nop(0);
4152     c = abc_setlocal(c, i);
4153     c = code_append(c, (yyvsp[(8) - (9)].code));
4154     c = abc_kill(c, i);
4155
4156     c = var_block(c);
4157     old_state();
4158 ;}
4159     break;
4160
4161   case 92:
4162
4163 /* Line 1455 of yacc.c  */
4164 #line 1823 "parser.y"
4165     {new_state();state->exception_name=0;;}
4166     break;
4167
4168   case 93:
4169
4170 /* Line 1455 of yacc.c  */
4171 #line 1823 "parser.y"
4172     {
4173     (yyvsp[(4) - (5)].code) = var_block((yyvsp[(4) - (5)].code));
4174     if(!(yyvsp[(4) - (5)].code)) {
4175         (yyval.exception)=0;
4176         old_state();
4177     } else {
4178         NEW(abc_exception_t, e)
4179         e->exc_type = 0; //all exceptions
4180         e->var_name = 0; //no name
4181         e->target = 0;
4182         e->to = abc_nop(0);
4183         e->to = code_append(e->to, (yyvsp[(4) - (5)].code));
4184         old_state();
4185         (yyval.exception) = e;
4186     }
4187 ;}
4188     break;
4189
4190   case 94:
4191
4192 /* Line 1455 of yacc.c  */
4193 #line 1840 "parser.y"
4194     {(yyval.catch_list).l=list_new();(yyval.catch_list).finally=0;list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));;}
4195     break;
4196
4197   case 95:
4198
4199 /* Line 1455 of yacc.c  */
4200 #line 1841 "parser.y"
4201     {(yyval.catch_list)=(yyvsp[(1) - (2)].catch_list);list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));;}
4202     break;
4203
4204   case 96:
4205
4206 /* Line 1455 of yacc.c  */
4207 #line 1842 "parser.y"
4208     {(yyval.catch_list)=(yyvsp[(1) - (1)].catch_list);}
4209     break;
4210
4211   case 97:
4212
4213 /* Line 1455 of yacc.c  */
4214 #line 1843 "parser.y"
4215     {
4216     (yyval.catch_list) = (yyvsp[(1) - (2)].catch_list);
4217     (yyval.catch_list).finally = 0;
4218     if((yyvsp[(2) - (2)].exception)) {
4219         list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));
4220         (yyval.catch_list).finally = (yyvsp[(2) - (2)].exception)->to;(yyvsp[(2) - (2)].exception)->to=0;
4221     }
4222 ;}
4223     break;
4224
4225   case 98:
4226
4227 /* Line 1455 of yacc.c  */
4228 #line 1851 "parser.y"
4229     {
4230     (yyval.catch_list).l=list_new();
4231     (yyval.catch_list).finally = 0;
4232     if((yyvsp[(1) - (1)].exception)) {
4233         list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));
4234         (yyval.catch_list).finally = (yyvsp[(1) - (1)].exception)->to;(yyvsp[(1) - (1)].exception)->to=0;
4235     }
4236 ;}
4237     break;
4238
4239   case 99:
4240
4241 /* Line 1455 of yacc.c  */
4242 #line 1860 "parser.y"
4243     {new_state();;}
4244     break;
4245
4246   case 100:
4247
4248 /* Line 1455 of yacc.c  */
4249 #line 1860 "parser.y"
4250     {
4251     code_t*out = abc_nop(0);
4252
4253     code_t*start = abc_nop(0);
4254     (yyval.code) = code_append(start, (yyvsp[(4) - (6)].code));
4255     if(!is_break_or_jump((yyvsp[(4) - (6)].code))) {
4256         (yyval.code) = abc_jump((yyval.code), out);
4257     }
4258     code_t*end = (yyval.code) = abc_nop((yyval.code));
4259   
4260     int tmp;
4261     if((yyvsp[(6) - (6)].catch_list).finally)
4262         tmp = new_variable("__finally__", 0, 0);
4263     
4264     abc_exception_list_t*l = (yyvsp[(6) - (6)].catch_list).l;
4265     int count=0;
4266     while(l) {
4267         abc_exception_t*e = l->abc_exception;
4268         if(e->var_name) {
4269             (yyval.code) = code_append((yyval.code), e->target);
4270             (yyval.code) = abc_jump((yyval.code), out);
4271         } else {
4272             parserassert((ptroff_t)(yyvsp[(6) - (6)].catch_list).finally);
4273             // finally block
4274             e->target = (yyval.code) = abc_nop((yyval.code));
4275             (yyval.code) = abc___rethrow__((yyval.code));
4276         }
4277         
4278         e->from = start;
4279         e->to = end;
4280
4281         l = l->next;
4282     }
4283     (yyval.code) = code_append((yyval.code), out);
4284
4285     (yyval.code) = insert_finally((yyval.code), (yyvsp[(6) - (6)].catch_list).finally, tmp);
4286         
4287     list_concat(state->method->exceptions, (yyvsp[(6) - (6)].catch_list).l);
4288    
4289     (yyval.code) = var_block((yyval.code));
4290     old_state();
4291 ;}
4292     break;
4293
4294   case 101:
4295
4296 /* Line 1455 of yacc.c  */
4297 #line 1905 "parser.y"
4298     {
4299     (yyval.code)=(yyvsp[(2) - (2)].value).c;
4300     (yyval.code)=abc_throw((yyval.code));
4301 ;}
4302     break;
4303
4304   case 102:
4305
4306 /* Line 1455 of yacc.c  */
4307 #line 1909 "parser.y"
4308     {
4309     if(!state->exception_name)
4310         syntaxerror("re-throw only possible within a catch block");
4311     variable_t*v = find_variable(state->exception_name);
4312     (yyval.code)=code_new();
4313     (yyval.code)=abc_getlocal((yyval.code), v->index);
4314     (yyval.code)=abc_throw((yyval.code));
4315 ;}
4316     break;
4317
4318   case 103:
4319
4320 /* Line 1455 of yacc.c  */
4321 #line 1920 "parser.y"
4322     {
4323      (yyval.code) = (yyvsp[(3) - (5)].value).c;
4324      (yyval.code) = abc_pushscope((yyval.code));
4325      (yyval.code) = code_append((yyval.code), (yyvsp[(5) - (5)].code));
4326      (yyval.code) = abc_popscope((yyval.code));
4327 ;}
4328     break;
4329
4330   case 105:
4331
4332 /* Line 1455 of yacc.c  */
4333 #line 1930 "parser.y"
4334     {(yyval.id)="package";;}
4335     break;
4336
4337   case 106:
4338
4339 /* Line 1455 of yacc.c  */
4340 #line 1932 "parser.y"
4341     {(yyval.id) = concat3((yyvsp[(1) - (3)].id),".",(yyvsp[(3) - (3)].id));free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;;}
4342     break;
4343
4344   case 107:
4345
4346 /* Line 1455 of yacc.c  */
4347 #line 1933 "parser.y"
4348     {(yyval.id)=strdup((yyvsp[(1) - (1)].id));;}
4349     break;
4350
4351   case 108:
4352
4353 /* Line 1455 of yacc.c  */
4354 #line 1935 "parser.y"
4355     {startpackage((yyvsp[(2) - (3)].id));free((yyvsp[(2) - (3)].id));(yyvsp[(2) - (3)].id)=0;;}
4356     break;
4357
4358   case 109:
4359
4360 /* Line 1455 of yacc.c  */
4361 #line 1935 "parser.y"
4362     {endpackage();(yyval.code)=0;;}
4363     break;
4364
4365   case 110:
4366
4367 /* Line 1455 of yacc.c  */
4368 #line 1936 "parser.y"
4369     {startpackage("");}
4370     break;
4371
4372   case 111:
4373
4374 /* Line 1455 of yacc.c  */
4375 #line 1936 "parser.y"
4376     {endpackage();(yyval.code)=0;;}
4377     break;
4378
4379   case 112:
4380
4381 /* Line 1455 of yacc.c  */
4382 #line 1938 "parser.y"
4383     {
4384        classinfo_t*c = (yyvsp[(2) - (2)].classinfo);
4385        if(!c) 
4386             syntaxerror("Couldn't import class\n");
4387        state_has_imports();
4388        dict_put(state->imports, c->name, c);
4389        (yyval.code)=0;
4390 ;}
4391     break;
4392
4393   case 113:
4394
4395 /* Line 1455 of yacc.c  */
4396 #line 1946 "parser.y"
4397     {
4398        NEW(import_t,i);
4399        i->package = (yyvsp[(2) - (4)].id);
4400        state_has_imports();
4401        list_append(state->wildcard_imports, i);
4402        (yyval.code)=0;
4403 ;}
4404     break;
4405
4406   case 114:
4407
4408 /* Line 1455 of yacc.c  */
4409 #line 1956 "parser.y"
4410     {(yyval.flags)=0;;}
4411     break;
4412
4413   case 115:
4414
4415 /* Line 1455 of yacc.c  */
4416 #line 1957 "parser.y"
4417     {(yyval.flags)=(yyvsp[(1) - (1)].flags);}
4418     break;
4419
4420   case 116:
4421
4422 /* Line 1455 of yacc.c  */
4423 #line 1958 "parser.y"
4424     {(yyval.flags)=(yyvsp[(1) - (1)].token);;}
4425     break;
4426
4427   case 117:
4428
4429 /* Line 1455 of yacc.c  */
4430 #line 1959 "parser.y"
4431     {(yyval.flags)=(yyvsp[(1) - (2)].flags)|(yyvsp[(2) - (2)].token);;}
4432     break;
4433
4434   case 118:
4435
4436 /* Line 1455 of yacc.c  */
4437 #line 1961 "parser.y"
4438     {(yyval.token)=FLAG_PUBLIC;;}
4439     break;
4440
4441   case 119:
4442
4443 /* Line 1455 of yacc.c  */
4444 #line 1962 "parser.y"
4445     {(yyval.token)=FLAG_PRIVATE;;}
4446     break;
4447
4448   case 120:
4449
4450 /* Line 1455 of yacc.c  */
4451 #line 1963 "parser.y"
4452     {(yyval.token)=FLAG_PROTECTED;;}
4453     break;
4454
4455   case 121:
4456
4457 /* Line 1455 of yacc.c  */
4458 #line 1964 "parser.y"
4459     {(yyval.token)=FLAG_STATIC;;}
4460     break;
4461
4462   case 122:
4463
4464 /* Line 1455 of yacc.c  */
4465 #line 1965 "parser.y"
4466     {(yyval.token)=FLAG_DYNAMIC;;}
4467     break;
4468
4469   case 123:
4470
4471 /* Line 1455 of yacc.c  */
4472 #line 1966 "parser.y"
4473     {(yyval.token)=FLAG_FINAL;;}
4474     break;
4475
4476   case 124:
4477
4478 /* Line 1455 of yacc.c  */
4479 #line 1967 "parser.y"
4480     {(yyval.token)=FLAG_OVERRIDE;;}
4481     break;
4482
4483   case 125:
4484
4485 /* Line 1455 of yacc.c  */
4486 #line 1968 "parser.y"
4487     {(yyval.token)=FLAG_NATIVE;;}
4488     break;
4489
4490   case 126:
4491
4492 /* Line 1455 of yacc.c  */
4493 #line 1969 "parser.y"
4494     {(yyval.token)=FLAG_PACKAGEINTERNAL;;}
4495     break;
4496
4497   case 127:
4498
4499 /* Line 1455 of yacc.c  */
4500 #line 1971 "parser.y"
4501     {(yyval.classinfo)=registry_getobjectclass();;}
4502     break;
4503
4504   case 128:
4505
4506 /* Line 1455 of yacc.c  */
4507 #line 1972 "parser.y"
4508     {(yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);;}
4509     break;
4510
4511   case 129:
4512
4513 /* Line 1455 of yacc.c  */
4514 #line 1974 "parser.y"
4515     {(yyval.classinfo_list)=list_new();;}
4516     break;
4517
4518   case 130:
4519
4520 /* Line 1455 of yacc.c  */
4521 #line 1975 "parser.y"
4522     {(yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);;}
4523     break;
4524
4525   case 131:
4526
4527 /* Line 1455 of yacc.c  */
4528 #line 1977 "parser.y"
4529     {(yyval.classinfo_list)=list_new();;}
4530     break;
4531
4532   case 132:
4533
4534 /* Line 1455 of yacc.c  */
4535 #line 1978 "parser.y"
4536     {(yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);;}
4537     break;
4538
4539   case 133:
4540
4541 /* Line 1455 of yacc.c  */
4542 #line 1982 "parser.y"
4543     {startclass((yyvsp[(1) - (6)].flags),(yyvsp[(3) - (6)].id),(yyvsp[(4) - (6)].classinfo),(yyvsp[(5) - (6)].classinfo_list), 0);;}
4544     break;
4545
4546   case 134:
4547
4548 /* Line 1455 of yacc.c  */
4549 #line 1984 "parser.y"
4550     {endclass();(yyval.code)=0;;}
4551     break;
4552
4553   case 135:
4554
4555 /* Line 1455 of yacc.c  */
4556 #line 1988 "parser.y"
4557     {startclass((yyvsp[(1) - (5)].flags),(yyvsp[(3) - (5)].id),0,(yyvsp[(4) - (5)].classinfo_list),1);;}
4558     break;
4559
4560   case 136:
4561
4562 /* Line 1455 of yacc.c  */
4563 #line 1990 "parser.y"
4564     {endclass();(yyval.code)=0;;}
4565     break;
4566
4567   case 144:
4568
4569 /* Line 1455 of yacc.c  */
4570 #line 2002 "parser.y"
4571     {
4572     code_t*c = state->cls->static_init;
4573     c = code_append(c, (yyvsp[(1) - (1)].code));  
4574     state->cls->static_init = c;
4575 ;}
4576     break;
4577
4578   case 150:
4579
4580 /* Line 1455 of yacc.c  */
4581 #line 2013 "parser.y"
4582     {
4583     syntaxerror("variable declarations not allowed in interfaces");
4584 ;}
4585     break;
4586
4587   case 151:
4588
4589 /* Line 1455 of yacc.c  */
4590 #line 2016 "parser.y"
4591     {
4592     (yyvsp[(1) - (8)].flags) |= FLAG_PUBLIC;
4593     if((yyvsp[(1) - (8)].flags)&(FLAG_PRIVATE|FLAG_PACKAGEINTERNAL|FLAG_PROTECTED)) {
4594         syntaxerror("invalid method modifiers: interface methods always need to be public");
4595     }
4596     startfunction(0,(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo));
4597     endfunction(0,(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo), 0);
4598 ;}
4599     break;
4600
4601   case 154:
4602
4603 /* Line 1455 of yacc.c  */
4604 #line 2029 "parser.y"
4605     {
4606     int flags = (yyvsp[(1) - (5)].flags);
4607     memberinfo_t* info = state->cls?
4608             memberinfo_register(state->cls->info, (yyvsp[(3) - (5)].id), MEMBER_SLOT):
4609             memberinfo_register_global(flags2access((yyvsp[(1) - (5)].flags)), state->package, (yyvsp[(3) - (5)].id), MEMBER_SLOT);
4610
4611     info->type = (yyvsp[(4) - (5)].classinfo);
4612     info->flags = flags;
4613
4614     /* slot name */
4615     namespace_t mname_ns = {flags2access(flags), ""};
4616     multiname_t mname = {QNAME, &mname_ns, 0, (yyvsp[(3) - (5)].id)};
4617   
4618     trait_list_t**traits;
4619     code_t**code;
4620     if(!state->cls) {
4621         // global variable
4622         traits = &global->init->traits;
4623         code = &global->init->method->body->code;
4624     } else if(flags&FLAG_STATIC) {
4625         // static variable
4626         traits = &state->cls->abc->static_traits;
4627         code = &state->cls->static_init;
4628     } else {
4629         // instance variable
4630         traits = &state->cls->abc->traits;
4631         code = &state->cls->init;
4632     }
4633     
4634     trait_t*t=0;
4635     if((yyvsp[(4) - (5)].classinfo)) {
4636         MULTINAME(m, (yyvsp[(4) - (5)].classinfo));
4637         t = trait_new_member(traits, multiname_clone(&m), multiname_clone(&mname), 0);
4638     } else {
4639         t = trait_new_member(traits, 0, multiname_clone(&mname), 0);
4640     }
4641     info->slot = t->slot_id;
4642     
4643     /* initalization code (if needed) */
4644     code_t*c = 0;
4645     if((yyvsp[(5) - (5)].value).c && !is_pushundefined((yyvsp[(5) - (5)].value).c)) {
4646         c = abc_getlocal_0(c);
4647         c = code_append(c, (yyvsp[(5) - (5)].value).c);
4648         c = converttype(c, (yyvsp[(5) - (5)].value).t, (yyvsp[(4) - (5)].classinfo));
4649         c = abc_setslot(c, t->slot_id);
4650     }
4651
4652     *code = code_append(*code, c);
4653
4654     if((yyvsp[(2) - (5)].token)==KW_CONST) {
4655         t->kind= TRAIT_CONST;
4656     }
4657
4658     (yyval.code)=0;
4659 ;}
4660     break;
4661
4662   case 155:
4663
4664 /* Line 1455 of yacc.c  */
4665 #line 2087 "parser.y"
4666     {(yyval.constant)=0;;}
4667     break;
4668
4669   case 156:
4670
4671 /* Line 1455 of yacc.c  */
4672 #line 2088 "parser.y"
4673     {(yyval.constant)=(yyvsp[(2) - (2)].constant);;}
4674     break;
4675
4676   case 157:
4677
4678 /* Line 1455 of yacc.c  */
4679 #line 2090 "parser.y"
4680     {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_uint));;}
4681     break;
4682
4683   case 158:
4684
4685 /* Line 1455 of yacc.c  */
4686 #line 2091 "parser.y"
4687     {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_int));;}
4688     break;
4689
4690   case 159:
4691
4692 /* Line 1455 of yacc.c  */
4693 #line 2092 "parser.y"
4694     {(yyval.constant) = constant_new_uint((yyvsp[(1) - (1)].number_uint));;}
4695     break;
4696
4697   case 160:
4698
4699 /* Line 1455 of yacc.c  */
4700 #line 2093 "parser.y"
4701     {(yyval.constant) = constant_new_float((yyvsp[(1) - (1)].number_float));;}
4702     break;
4703
4704   case 161:
4705
4706 /* Line 1455 of yacc.c  */
4707 #line 2094 "parser.y"
4708     {(yyval.constant) = constant_new_string2((yyvsp[(1) - (1)].str).str,(yyvsp[(1) - (1)].str).len);;}
4709     break;
4710
4711   case 162:
4712
4713 /* Line 1455 of yacc.c  */
4714 #line 2096 "parser.y"
4715     {(yyval.constant) = constant_new_true((yyvsp[(1) - (1)].token));;}
4716     break;
4717
4718   case 163:
4719
4720 /* Line 1455 of yacc.c  */
4721 #line 2097 "parser.y"
4722     {(yyval.constant) = constant_new_false((yyvsp[(1) - (1)].token));;}
4723     break;
4724
4725   case 164:
4726
4727 /* Line 1455 of yacc.c  */
4728 #line 2098 "parser.y"
4729     {(yyval.constant) = constant_new_null((yyvsp[(1) - (1)].token));;}
4730     break;
4731
4732   case 165:
4733
4734 /* Line 1455 of yacc.c  */
4735 #line 2103 "parser.y"
4736     {
4737     memset(&(yyval.params),0,sizeof((yyval.params)));
4738 ;}
4739     break;
4740
4741   case 166:
4742
4743 /* Line 1455 of yacc.c  */
4744 #line 2106 "parser.y"
4745     {
4746     (yyval.params)=(yyvsp[(1) - (1)].params);
4747 ;}
4748     break;
4749
4750   case 167:
4751
4752 /* Line 1455 of yacc.c  */
4753 #line 2111 "parser.y"
4754     {
4755     memset(&(yyval.params),0,sizeof((yyval.params)));
4756     (yyval.params).varargs=1;
4757     list_append((yyval.params).list, (yyvsp[(2) - (2)].param));
4758 ;}
4759     break;
4760
4761   case 168:
4762
4763 /* Line 1455 of yacc.c  */
4764 #line 2116 "parser.y"
4765     {
4766     (yyval.params) =(yyvsp[(1) - (4)].params);
4767     (yyval.params).varargs=1;
4768     list_append((yyval.params).list, (yyvsp[(4) - (4)].param));
4769 ;}
4770     break;
4771
4772   case 169:
4773
4774 /* Line 1455 of yacc.c  */
4775 #line 2123 "parser.y"
4776     {
4777     (yyval.params) = (yyvsp[(1) - (3)].params);
4778     list_append((yyval.params).list, (yyvsp[(3) - (3)].param));
4779 ;}
4780     break;
4781
4782   case 170:
4783
4784 /* Line 1455 of yacc.c  */
4785 #line 2127 "parser.y"
4786     {
4787     memset(&(yyval.params),0,sizeof((yyval.params)));
4788     list_append((yyval.params).list, (yyvsp[(1) - (1)].param));
4789 ;}
4790     break;
4791
4792   case 171:
4793
4794 /* Line 1455 of yacc.c  */
4795 #line 2132 "parser.y"
4796     {
4797      (yyval.param) = malloc(sizeof(param_t));
4798      (yyval.param)->name=(yyvsp[(1) - (4)].id);
4799      (yyval.param)->type = (yyvsp[(3) - (4)].classinfo);
4800      (yyval.param)->value = (yyvsp[(4) - (4)].constant);
4801 ;}
4802     break;
4803
4804   case 172:
4805
4806 /* Line 1455 of yacc.c  */
4807 #line 2138 "parser.y"
4808     {
4809      (yyval.param) = malloc(sizeof(param_t));
4810      (yyval.param)->name=(yyvsp[(1) - (2)].id);
4811      (yyval.param)->type = TYPE_ANY;
4812      (yyval.param)->value = (yyvsp[(2) - (2)].constant);
4813 ;}
4814     break;
4815
4816   case 173:
4817
4818 /* Line 1455 of yacc.c  */
4819 #line 2144 "parser.y"
4820     {(yyval.token)=(yyvsp[(1) - (1)].token);;}
4821     break;
4822
4823   case 174:
4824
4825 /* Line 1455 of yacc.c  */
4826 #line 2145 "parser.y"
4827     {(yyval.token)=(yyvsp[(1) - (1)].token);;}
4828     break;
4829
4830   case 175:
4831
4832 /* Line 1455 of yacc.c  */
4833 #line 2146 "parser.y"
4834     {(yyval.token)=0;;}
4835     break;
4836
4837   case 176:
4838
4839 /* Line 1455 of yacc.c  */
4840 #line 2149 "parser.y"
4841     {startfunction(0,(yyvsp[(1) - (9)].flags),(yyvsp[(3) - (9)].token),(yyvsp[(4) - (9)].id),&(yyvsp[(6) - (9)].params),(yyvsp[(8) - (9)].classinfo));}
4842     break;
4843
4844   case 177:
4845
4846 /* Line 1455 of yacc.c  */
4847 #line 2150 "parser.y"
4848     {
4849     code_t*c = 0;
4850     if(state->method->late_binding) {
4851         c = abc_getlocal_0(c);
4852         c = abc_pushscope(c);
4853     }
4854     if(state->method->is_constructor && !state->method->has_super) {
4855         // call default constructor
4856         c = abc_getlocal_0(c);
4857         c = abc_constructsuper(c, 0);
4858     }
4859     c = wrap_function(c, 0, (yyvsp[(11) - (12)].code));
4860     endfunction(0,(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),(yyvsp[(8) - (12)].classinfo),c);
4861     (yyval.code)=0;
4862 ;}
4863     break;
4864
4865   case 179:
4866
4867 /* Line 1455 of yacc.c  */
4868 #line 2167 "parser.y"
4869     {(yyval.id)=0;;}
4870     break;
4871
4872   case 180:
4873
4874 /* Line 1455 of yacc.c  */
4875 #line 2169 "parser.y"
4876     {
4877     syntaxerror("nested functions not supported yet");
4878 ;}
4879     break;
4880
4881   case 181:
4882
4883 /* Line 1455 of yacc.c  */
4884 #line 2176 "parser.y"
4885     {
4886
4887     /* try current package */
4888     (yyval.classinfo) = find_class((yyvsp[(1) - (1)].id));
4889     if(!(yyval.classinfo)) syntaxerror("Could not find class %s\n", (yyvsp[(1) - (1)].id));
4890 ;}
4891     break;
4892
4893   case 182:
4894
4895 /* Line 1455 of yacc.c  */
4896 #line 2183 "parser.y"
4897     {
4898     (yyval.classinfo) = registry_findclass((yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
4899     if(!(yyval.classinfo)) syntaxerror("Couldn't find class %s.%s\n", (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
4900     free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;
4901 ;}
4902     break;
4903
4904   case 185:
4905
4906 /* Line 1455 of yacc.c  */
4907 #line 2192 "parser.y"
4908     {(yyval.classinfo_list)=list_new();list_append((yyval.classinfo_list), (yyvsp[(1) - (1)].classinfo));;}
4909     break;
4910
4911   case 186:
4912
4913 /* Line 1455 of yacc.c  */
4914 #line 2193 "parser.y"
4915     {(yyval.classinfo_list)=(yyvsp[(1) - (3)].classinfo_list);list_append((yyval.classinfo_list),(yyvsp[(3) - (3)].classinfo));;}
4916     break;
4917
4918   case 187:
4919
4920 /* Line 1455 of yacc.c  */
4921 #line 2195 "parser.y"
4922     {(yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);;}
4923     break;
4924
4925   case 188:
4926
4927 /* Line 1455 of yacc.c  */
4928 #line 2196 "parser.y"
4929     {(yyval.classinfo)=registry_getanytype();;}
4930     break;
4931
4932   case 189:
4933
4934 /* Line 1455 of yacc.c  */
4935 #line 2197 "parser.y"
4936     {(yyval.classinfo)=registry_getanytype();;}
4937     break;
4938
4939   case 190:
4940
4941 /* Line 1455 of yacc.c  */
4942 #line 2206 "parser.y"
4943     {(yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);;}
4944     break;
4945
4946   case 191:
4947
4948 /* Line 1455 of yacc.c  */
4949 #line 2207 "parser.y"
4950     {(yyval.classinfo)=0;;}
4951     break;
4952
4953   case 192:
4954
4955 /* Line 1455 of yacc.c  */
4956 #line 2211 "parser.y"
4957     {(yyval.value_list).cc=0;(yyval.value_list).len=0;;}
4958     break;
4959
4960   case 193:
4961
4962 /* Line 1455 of yacc.c  */
4963 #line 2212 "parser.y"
4964     {(yyval.value_list)=(yyvsp[(2) - (3)].value_list);}
4965     break;
4966
4967   case 194:
4968
4969 /* Line 1455 of yacc.c  */
4970 #line 2214 "parser.y"
4971     {(yyval.value_list).cc=0;(yyval.value_list).len=0;;}
4972     break;
4973
4974   case 196:
4975
4976 /* Line 1455 of yacc.c  */
4977 #line 2216 "parser.y"
4978     {(yyval.value_list).len=1;
4979                                                   (yyval.value_list).cc = (yyvsp[(1) - (1)].value).c;
4980                                                  ;}
4981     break;
4982
4983   case 197:
4984
4985 /* Line 1455 of yacc.c  */
4986 #line 2219 "parser.y"
4987     {
4988                                                   (yyval.value_list).len= (yyvsp[(1) - (3)].value_list).len+1;
4989                                                   (yyval.value_list).cc = code_append((yyvsp[(1) - (3)].value_list).cc, (yyvsp[(3) - (3)].value).c);
4990                                                   ;}
4991     break;
4992
4993   case 198:
4994
4995 /* Line 1455 of yacc.c  */
4996 #line 2224 "parser.y"
4997     {
4998     MULTINAME(m, (yyvsp[(2) - (3)].classinfo));
4999     (yyval.value).c = code_new();
5000
5001     if((yyvsp[(2) - (3)].classinfo)->slot) {
5002         (yyval.value).c = abc_getglobalscope((yyval.value).c);
5003         (yyval.value).c = abc_getslot((yyval.value).c, (yyvsp[(2) - (3)].classinfo)->slot);
5004     } else {
5005         (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
5006     }
5007
5008     (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (3)].value_list).cc);
5009
5010     if((yyvsp[(2) - (3)].classinfo)->slot)
5011         (yyval.value).c = abc_construct((yyval.value).c, (yyvsp[(3) - (3)].value_list).len);
5012     else
5013         (yyval.value).c = abc_constructprop2((yyval.value).c, &m, (yyvsp[(3) - (3)].value_list).len);
5014     (yyval.value).t = (yyvsp[(2) - (3)].classinfo);
5015 ;}
5016     break;
5017
5018   case 199:
5019
5020 /* Line 1455 of yacc.c  */
5021 #line 2248 "parser.y"
5022     {
5023     
5024     (yyval.value).c = (yyvsp[(1) - (4)].value).c;
5025     if((yyval.value).c->opcode == OPCODE_COERCE_A) {
5026         (yyval.value).c = code_cutlast((yyval.value).c);
5027     }
5028     code_t*paramcode = (yyvsp[(3) - (4)].value_list).cc;
5029
5030     (yyval.value).t = TYPE_ANY;
5031     if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
5032         multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
5033         (yyval.value).c = code_cutlast((yyval.value).c);
5034         (yyval.value).c = code_append((yyval.value).c, paramcode);
5035         (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).len);
5036         multiname_destroy(name);
5037     } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
5038         int slot = (int)(ptroff_t)(yyval.value).c->data[0];
5039         trait_t*t = abc_class_find_slotid(state->cls->abc,slot);//FIXME
5040         if(t->kind!=TRAIT_METHOD) {
5041             //ok: flash allows to assign closures to members.
5042         }
5043         multiname_t*name = t->name;
5044         (yyval.value).c = code_cutlast((yyval.value).c);
5045         (yyval.value).c = code_append((yyval.value).c, paramcode);
5046         //$$.c = abc_callmethod($$.c, t->method, len); //#1051 illegal early access binding
5047         (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).len);
5048     } else if((yyval.value).c->opcode == OPCODE_GETSUPER) {
5049         multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
5050         (yyval.value).c = code_cutlast((yyval.value).c);
5051         (yyval.value).c = code_append((yyval.value).c, paramcode);
5052         (yyval.value).c = abc_callsuper2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).len);
5053         multiname_destroy(name);
5054     } else {
5055         (yyval.value).c = abc_getlocal_0((yyval.value).c);
5056         (yyval.value).c = code_append((yyval.value).c, paramcode);
5057         (yyval.value).c = abc_call((yyval.value).c, (yyvsp[(3) - (4)].value_list).len);
5058     }
5059    
5060     memberinfo_t*f = 0;
5061    
5062     if(TYPE_IS_FUNCTION((yyvsp[(1) - (4)].value).t) && (yyvsp[(1) - (4)].value).t->function) {
5063         (yyval.value).t = (yyvsp[(1) - (4)].value).t->function->return_type;
5064     } else {
5065         (yyval.value).c = abc_coerce_a((yyval.value).c);
5066         (yyval.value).t = TYPE_ANY;
5067     }
5068
5069 ;}
5070     break;
5071
5072   case 200:
5073
5074 /* Line 1455 of yacc.c  */
5075 #line 2296 "parser.y"
5076     {
5077     if(!state->cls) syntaxerror("super() not allowed outside of a class");
5078     if(!state->method) syntaxerror("super() not allowed outside of a function");
5079     if(!state->method->is_constructor) syntaxerror("super() not allowed outside of a constructor");
5080
5081     (yyval.value).c = code_new();
5082     (yyval.value).c = abc_getlocal_0((yyval.value).c);
5083
5084     (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value_list).cc);
5085     /*
5086     this is dependent on the control path, check this somewhere else
5087     if(state->method->has_super)
5088         syntaxerror("constructor may call super() only once");
5089     */
5090     state->method->has_super = 1;
5091     (yyval.value).c = abc_constructsuper((yyval.value).c, (yyvsp[(3) - (4)].value_list).len);
5092     (yyval.value).c = abc_pushundefined((yyval.value).c);
5093     (yyval.value).t = TYPE_ANY;
5094 ;}
5095     break;
5096
5097   case 201:
5098
5099 /* Line 1455 of yacc.c  */
5100 #line 2316 "parser.y"
5101     {
5102     (yyval.value).c = (yyvsp[(2) - (2)].value).c;
5103     if((yyval.value).c->opcode == OPCODE_COERCE_A) {
5104         (yyval.value).c = code_cutlast((yyval.value).c);
5105     }
5106     multiname_t*name = 0;
5107     if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
5108         (yyval.value).c->opcode = OPCODE_DELETEPROPERTY;
5109     } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
5110         int slot = (int)(ptroff_t)(yyval.value).c->data[0];
5111         multiname_t*name = abc_class_find_slotid(state->cls->abc,slot)->name;
5112         (yyval.value).c = code_cutlast((yyval.value).c);
5113         (yyval.value).c = abc_deleteproperty2((yyval.value).c, name);
5114     } else {
5115         (yyval.value).c = abc_getlocal_0((yyval.value).c);
5116         MULTINAME_LATE(m, (yyvsp[(2) - (2)].value).t?(yyvsp[(2) - (2)].value).t->access:ACCESS_PACKAGE, "");
5117         (yyval.value).c = abc_deleteproperty2((yyval.value).c, &m);
5118     }
5119     (yyval.value).t = TYPE_BOOLEAN;
5120 ;}
5121     break;
5122
5123   case 202:
5124
5125 /* Line 1455 of yacc.c  */
5126 #line 2337 "parser.y"
5127     {
5128     (yyval.code) = abc_returnvoid(0);
5129 ;}
5130     break;
5131
5132   case 203:
5133
5134 /* Line 1455 of yacc.c  */
5135 #line 2340 "parser.y"
5136     {
5137     (yyval.code) = (yyvsp[(2) - (2)].value).c;
5138     (yyval.code) = abc_returnvalue((yyval.code));
5139 ;}
5140     break;
5141
5142   case 204:
5143
5144 /* Line 1455 of yacc.c  */
5145 #line 2347 "parser.y"
5146     {(yyval.value)=(yyvsp[(1) - (1)].value);;}
5147     break;
5148
5149   case 205:
5150
5151 /* Line 1455 of yacc.c  */
5152 #line 2348 "parser.y"
5153     {(yyval.value) = (yyvsp[(1) - (1)].value);;}
5154     break;
5155
5156   case 206:
5157
5158 /* Line 1455 of yacc.c  */
5159 #line 2349 "parser.y"
5160     {
5161     (yyval.value).c = (yyvsp[(1) - (3)].value).c;
5162     (yyval.value).c = cut_last_push((yyval.value).c);
5163     (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
5164     (yyval.value).t = (yyvsp[(3) - (3)].value).t;
5165 ;}
5166     break;
5167
5168   case 207:
5169
5170 /* Line 1455 of yacc.c  */
5171 #line 2355 "parser.y"
5172     {
5173     (yyval.code)=cut_last_push((yyvsp[(1) - (1)].value).c);
5174 ;}
5175     break;
5176
5177   case 208:
5178
5179 /* Line 1455 of yacc.c  */
5180 #line 2361 "parser.y"
5181     {(yyval.value) = (yyvsp[(1) - (1)].value);;}
5182     break;
5183
5184   case 210:
5185
5186 /* Line 1455 of yacc.c  */
5187 #line 2365 "parser.y"
5188     {(yyval.value) = (yyvsp[(1) - (1)].value);;}
5189     break;
5190
5191   case 211:
5192
5193 /* Line 1455 of yacc.c  */
5194 #line 2367 "parser.y"
5195     {(yyval.value) = (yyvsp[(1) - (1)].value);;}
5196     break;
5197
5198   case 212:
5199
5200 /* Line 1455 of yacc.c  */
5201 #line 2369 "parser.y"
5202     {(yyval.value) = (yyvsp[(1) - (1)].value);;}
5203     break;
5204
5205   case 213:
5206
5207 /* Line 1455 of yacc.c  */
5208 #line 2371 "parser.y"
5209     {
5210     (yyval.value).c = 0;
5211     namespace_t ns = {ACCESS_PACKAGE, ""};
5212     multiname_t m = {QNAME, &ns, 0, "RegExp"};
5213     if(!(yyvsp[(1) - (1)].regexp).options) {
5214         (yyval.value).c = abc_getlex2((yyval.value).c, &m);
5215         (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern);
5216         (yyval.value).c = abc_construct((yyval.value).c, 1);
5217     } else {
5218         (yyval.value).c = abc_getlex2((yyval.value).c, &m);
5219         (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern);
5220         (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).options);
5221         (yyval.value).c = abc_construct((yyval.value).c, 2);
5222     }
5223     (yyval.value).t = TYPE_REGEXP;
5224 ;}
5225     break;
5226
5227   case 214:
5228
5229 /* Line 1455 of yacc.c  */
5230 #line 2388 "parser.y"
5231     {(yyval.value).c = abc_pushbyte(0, (yyvsp[(1) - (1)].number_uint));
5232                    //MULTINAME(m, registry_getintclass());
5233                    //$$.c = abc_coerce2($$.c, &m); // FIXME
5234                    (yyval.value).t = TYPE_INT;
5235                   ;}
5236     break;
5237
5238   case 215:
5239
5240 /* Line 1455 of yacc.c  */
5241 #line 2393 "parser.y"
5242     {(yyval.value).c = abc_pushshort(0, (yyvsp[(1) - (1)].number_uint));
5243                     (yyval.value).t = TYPE_INT;
5244                    ;}
5245     break;
5246
5247   case 216:
5248
5249 /* Line 1455 of yacc.c  */
5250 #line 2396 "parser.y"
5251     {(yyval.value).c = abc_pushint(0, (yyvsp[(1) - (1)].number_int));
5252                   (yyval.value).t = TYPE_INT;
5253                  ;}
5254     break;
5255
5256   case 217:
5257
5258 /* Line 1455 of yacc.c  */
5259 #line 2399 "parser.y"
5260     {(yyval.value).c = abc_pushuint(0, (yyvsp[(1) - (1)].number_uint));
5261                    (yyval.value).t = TYPE_UINT;
5262                   ;}
5263     break;
5264
5265   case 218:
5266
5267 /* Line 1455 of yacc.c  */
5268 #line 2402 "parser.y"
5269     {(yyval.value).c = abc_pushdouble(0, (yyvsp[(1) - (1)].number_float));
5270                     (yyval.value).t = TYPE_FLOAT;
5271                    ;}
5272     break;
5273
5274   case 219:
5275
5276 /* Line 1455 of yacc.c  */
5277 #line 2405 "parser.y"
5278     {(yyval.value).c = abc_pushstring2(0, &(yyvsp[(1) - (1)].str));
5279                      (yyval.value).t = TYPE_STRING;
5280                     ;}
5281     break;
5282
5283   case 220:
5284
5285 /* Line 1455 of yacc.c  */
5286 #line 2408 "parser.y"
5287     {(yyval.value).c = abc_pushundefined(0);
5288                     (yyval.value).t = TYPE_ANY;
5289                    ;}
5290     break;
5291
5292   case 221:
5293
5294 /* Line 1455 of yacc.c  */
5295 #line 2411 "parser.y"
5296     {(yyval.value).c = abc_pushtrue(0);
5297                     (yyval.value).t = TYPE_BOOLEAN;
5298                    ;}
5299     break;
5300
5301   case 222:
5302
5303 /* Line 1455 of yacc.c  */
5304 #line 2414 "parser.y"
5305     {(yyval.value).c = abc_pushfalse(0);
5306                      (yyval.value).t = TYPE_BOOLEAN;
5307                     ;}
5308     break;
5309
5310   case 223:
5311
5312 /* Line 1455 of yacc.c  */
5313 #line 2417 "parser.y"
5314     {(yyval.value).c = abc_pushnull(0);
5315                     (yyval.value).t = TYPE_NULL;
5316                    ;}
5317     break;
5318
5319   case 225:
5320
5321 /* Line 1455 of yacc.c  */
5322 #line 2422 "parser.y"
5323     {(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);
5324              (yyval.value).t = TYPE_BOOLEAN;
5325             ;}
5326     break;
5327
5328   case 226:
5329
5330 /* Line 1455 of yacc.c  */
5331 #line 2425 "parser.y"
5332     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterthan((yyval.value).c);
5333              (yyval.value).t = TYPE_BOOLEAN;
5334             ;}
5335     break;
5336
5337   case 227:
5338
5339 /* Line 1455 of yacc.c  */
5340 #line 2428 "parser.y"
5341     {(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);
5342               (yyval.value).t = TYPE_BOOLEAN;
5343              ;}
5344     break;
5345
5346   case 228:
5347
5348 /* Line 1455 of yacc.c  */
5349 #line 2431 "parser.y"
5350     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterequals((yyval.value).c);
5351               (yyval.value).t = TYPE_BOOLEAN;
5352              ;}
5353     break;
5354
5355   case 229:
5356
5357 /* Line 1455 of yacc.c  */
5358 #line 2434 "parser.y"
5359     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_equals((yyval.value).c);
5360               (yyval.value).t = TYPE_BOOLEAN;
5361              ;}
5362     break;
5363
5364   case 230:
5365
5366 /* Line 1455 of yacc.c  */
5367 #line 2437 "parser.y"
5368     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_strictequals((yyval.value).c);
5369               (yyval.value).t = TYPE_BOOLEAN;
5370               ;}
5371     break;
5372
5373   case 231:
5374
5375 /* Line 1455 of yacc.c  */
5376 #line 2440 "parser.y"
5377     {(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);
5378               (yyval.value).t = TYPE_BOOLEAN;
5379              ;}
5380     break;
5381
5382   case 232:
5383
5384 /* Line 1455 of yacc.c  */
5385 #line 2443 "parser.y"
5386     {(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);
5387               (yyval.value).t = TYPE_BOOLEAN;
5388              ;}
5389     break;
5390
5391   case 233:
5392
5393 /* Line 1455 of yacc.c  */
5394 #line 2447 "parser.y"
5395     {(yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'O');
5396               (yyval.value).c = (yyvsp[(1) - (3)].value).c;
5397               (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t);
5398               (yyval.value).c = abc_dup((yyval.value).c);
5399               code_t*jmp = (yyval.value).c = abc_iftrue((yyval.value).c, 0);
5400               (yyval.value).c = cut_last_push((yyval.value).c);
5401               (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
5402               (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t);
5403               code_t*label = (yyval.value).c = abc_label((yyval.value).c);
5404               jmp->branch = label;
5405              ;}
5406     break;
5407
5408   case 234:
5409
5410 /* Line 1455 of yacc.c  */
5411 #line 2458 "parser.y"
5412     {
5413               (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'A');
5414               /*printf("%08x:\n",$1.t);
5415               code_dump($1.c, 0, 0, "", stdout);
5416               printf("%08x:\n",$3.t);
5417               code_dump($3.c, 0, 0, "", stdout);
5418               printf("joining %08x and %08x to %08x\n", $1.t, $3.t, $$.t);*/
5419               (yyval.value).c = (yyvsp[(1) - (3)].value).c;
5420               (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t);
5421               (yyval.value).c = abc_dup((yyval.value).c);
5422               code_t*jmp = (yyval.value).c = abc_iffalse((yyval.value).c, 0);
5423               (yyval.value).c = cut_last_push((yyval.value).c);
5424               (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
5425               (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t);
5426               code_t*label = (yyval.value).c = abc_label((yyval.value).c);
5427               jmp->branch = label;              
5428              ;}
5429     break;
5430
5431   case 235:
5432
5433 /* Line 1455 of yacc.c  */
5434 #line 2476 "parser.y"
5435     {(yyval.value).c=(yyvsp[(2) - (2)].value).c;
5436               (yyval.value).c = abc_not((yyval.value).c);
5437               (yyval.value).t = TYPE_BOOLEAN;
5438              ;}
5439     break;
5440
5441   case 236:
5442
5443 /* Line 1455 of yacc.c  */
5444 #line 2481 "parser.y"
5445     {(yyval.value).c=(yyvsp[(2) - (2)].value).c;
5446               (yyval.value).c = abc_bitnot((yyval.value).c);
5447               (yyval.value).t = TYPE_INT;
5448              ;}
5449     break;
5450
5451   case 237:
5452
5453 /* Line 1455 of yacc.c  */
5454 #line 2486 "parser.y"
5455     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
5456              (yyval.value).c = abc_bitand((yyval.value).c);
5457              (yyval.value).t = TYPE_INT;
5458             ;}
5459     break;
5460
5461   case 238:
5462
5463 /* Line 1455 of yacc.c  */
5464 #line 2491 "parser.y"
5465     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
5466              (yyval.value).c = abc_bitxor((yyval.value).c);
5467              (yyval.value).t = TYPE_INT;
5468             ;}
5469     break;
5470
5471   case 239:
5472
5473 /* Line 1455 of yacc.c  */
5474 #line 2496 "parser.y"
5475     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
5476              (yyval.value).c = abc_bitor((yyval.value).c);
5477              (yyval.value).t = TYPE_INT;
5478             ;}
5479     break;
5480
5481   case 240:
5482
5483 /* Line 1455 of yacc.c  */
5484 #line 2501 "parser.y"
5485     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
5486              (yyval.value).c = abc_rshift((yyval.value).c);
5487              (yyval.value).t = TYPE_INT;
5488             ;}
5489     break;
5490
5491   case 241:
5492
5493 /* Line 1455 of yacc.c  */
5494 #line 2505 "parser.y"
5495     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
5496              (yyval.value).c = abc_urshift((yyval.value).c);
5497              (yyval.value).t = TYPE_INT;
5498             ;}
5499     break;
5500
5501   case 242:
5502
5503 /* Line 1455 of yacc.c  */
5504 #line 2509 "parser.y"
5505     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
5506              (yyval.value).c = abc_lshift((yyval.value).c);
5507              (yyval.value).t = TYPE_INT;
5508             ;}
5509     break;
5510
5511   case 243:
5512
5513 /* Line 1455 of yacc.c  */
5514 #line 2514 "parser.y"
5515     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
5516              (yyval.value).c = abc_divide((yyval.value).c);
5517              (yyval.value).t = TYPE_NUMBER;
5518             ;}
5519     break;
5520
5521   case 244:
5522
5523 /* Line 1455 of yacc.c  */
5524 #line 2518 "parser.y"
5525     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
5526              (yyval.value).c = abc_modulo((yyval.value).c);
5527              (yyval.value).t = TYPE_NUMBER;
5528             ;}
5529     break;
5530
5531   case 245:
5532
5533 /* Line 1455 of yacc.c  */
5534 #line 2522 "parser.y"
5535     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
5536              if(BOTH_INT((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t)) {
5537                 (yyval.value).c = abc_add_i((yyval.value).c);
5538                 (yyval.value).t = TYPE_INT;
5539              } else {
5540                 (yyval.value).c = abc_add((yyval.value).c);
5541                 (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t,'+');
5542              }
5543             ;}
5544     break;
5545
5546   case 246:
5547
5548 /* Line 1455 of yacc.c  */
5549 #line 2531 "parser.y"
5550     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
5551              if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
5552                 (yyval.value).c = abc_subtract_i((yyval.value).c);
5553                 (yyval.value).t = TYPE_INT;
5554              } else {
5555                 (yyval.value).c = abc_subtract((yyval.value).c);
5556                 (yyval.value).t = TYPE_NUMBER;
5557              }
5558             ;}
5559     break;
5560
5561   case 247:
5562
5563 /* Line 1455 of yacc.c  */
5564 #line 2540 "parser.y"
5565     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
5566              if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
5567                 (yyval.value).c = abc_multiply_i((yyval.value).c);
5568                 (yyval.value).t = TYPE_INT;
5569              } else {
5570                 (yyval.value).c = abc_multiply((yyval.value).c);
5571                 (yyval.value).t = TYPE_NUMBER;
5572              }
5573             ;}
5574     break;
5575
5576   case 248:
5577
5578 /* Line 1455 of yacc.c  */
5579 #line 2550 "parser.y"
5580     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
5581               (yyval.value).c = abc_in((yyval.value).c);
5582               (yyval.value).t = TYPE_BOOLEAN;
5583              ;}
5584     break;
5585
5586   case 249:
5587
5588 /* Line 1455 of yacc.c  */
5589 #line 2555 "parser.y"
5590     {char use_astype=0; // flash player's astype works differently than astypelate
5591               if(use_astype && TYPE_IS_CLASS((yyvsp[(3) - (3)].value).t)) {
5592                 MULTINAME(m,(yyvsp[(3) - (3)].value).t->cls);
5593                 (yyval.value).c = abc_astype2((yyvsp[(1) - (3)].value).c, &m);
5594                 (yyval.value).t = (yyvsp[(3) - (3)].value).t->cls;
5595               } else {
5596                 (yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
5597                 (yyval.value).c = abc_astypelate((yyval.value).c);
5598                 (yyval.value).t = TYPE_ANY;
5599               }
5600              ;}
5601     break;
5602
5603   case 250:
5604
5605 /* Line 1455 of yacc.c  */
5606 #line 2568 "parser.y"
5607     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
5608               (yyval.value).c = abc_instanceof((yyval.value).c);
5609               (yyval.value).t = TYPE_BOOLEAN;
5610              ;}
5611     break;
5612
5613   case 251:
5614
5615 /* Line 1455 of yacc.c  */
5616 #line 2573 "parser.y"
5617     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
5618               (yyval.value).c = abc_istypelate((yyval.value).c);
5619               (yyval.value).t = TYPE_BOOLEAN;
5620              ;}
5621     break;
5622
5623   case 252:
5624
5625 /* Line 1455 of yacc.c  */
5626 #line 2578 "parser.y"
5627     {
5628               (yyval.value).c = (yyvsp[(3) - (4)].value).c;
5629               (yyval.value).c = abc_typeof((yyval.value).c);
5630               (yyval.value).t = TYPE_STRING;
5631              ;}
5632     break;
5633
5634   case 253:
5635
5636 /* Line 1455 of yacc.c  */
5637 #line 2584 "parser.y"
5638     {
5639               (yyval.value).c = cut_last_push((yyvsp[(2) - (2)].value).c);
5640               (yyval.value).c = abc_pushundefined((yyval.value).c);
5641               (yyval.value).t = TYPE_ANY;
5642              ;}
5643     break;
5644
5645   case 254:
5646
5647 /* Line 1455 of yacc.c  */
5648 #line 2590 "parser.y"
5649     { (yyval.value).c = abc_pushundefined(0);
5650              (yyval.value).t = TYPE_ANY;
5651            ;}
5652     break;
5653
5654   case 255:
5655
5656 /* Line 1455 of yacc.c  */
5657 #line 2594 "parser.y"
5658     {(yyval.value)=(yyvsp[(2) - (3)].value);;}
5659     break;
5660
5661   case 256:
5662
5663 /* Line 1455 of yacc.c  */
5664 #line 2596 "parser.y"
5665     {
5666   (yyval.value)=(yyvsp[(2) - (2)].value);
5667   if(IS_INT((yyvsp[(2) - (2)].value).t)) {
5668    (yyval.value).c=abc_negate_i((yyval.value).c);
5669    (yyval.value).t = TYPE_INT;
5670   } else {
5671    (yyval.value).c=abc_negate((yyval.value).c);
5672    (yyval.value).t = TYPE_NUMBER;
5673   }
5674 ;}
5675     break;
5676
5677   case 257:
5678
5679 /* Line 1455 of yacc.c  */
5680 #line 2607 "parser.y"
5681     {
5682   (yyval.value).c = (yyvsp[(1) - (4)].value).c;
5683   (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value).c);
5684  
5685   MULTINAME_LATE(m, (yyvsp[(1) - (4)].value).t?(yyvsp[(1) - (4)].value).t->access:ACCESS_PACKAGE, "");
5686   (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
5687   (yyval.value).t = 0; // array elements have unknown type
5688 ;}
5689     break;
5690
5691   case 258:
5692
5693 /* Line 1455 of yacc.c  */
5694 #line 2616 "parser.y"
5695     {
5696     (yyval.value).c = code_new();
5697     (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc);
5698     (yyval.value).c = abc_newarray((yyval.value).c, (yyvsp[(2) - (3)].value_list).len);
5699     (yyval.value).t = registry_getarrayclass();
5700 ;}
5701     break;
5702
5703   case 259:
5704
5705 /* Line 1455 of yacc.c  */
5706 #line 2623 "parser.y"
5707     {(yyval.value_list).cc=0;(yyval.value_list).len=0;;}
5708     break;
5709
5710   case 260:
5711
5712 /* Line 1455 of yacc.c  */
5713 #line 2624 "parser.y"
5714     {(yyval.value_list)=(yyvsp[(1) - (1)].value_list);}
5715     break;
5716
5717   case 261:
5718
5719 /* Line 1455 of yacc.c  */
5720 #line 2626 "parser.y"
5721     {
5722     (yyval.value_list).cc = 0;
5723     (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(1) - (3)].value).c);
5724     (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (3)].value).c);
5725     (yyval.value_list).len = 2;
5726 ;}
5727     break;
5728
5729   case 262:
5730
5731 /* Line 1455 of yacc.c  */
5732 #line 2632 "parser.y"
5733     {
5734     (yyval.value_list).cc = (yyvsp[(1) - (5)].value_list).cc;
5735     (yyval.value_list).len = (yyvsp[(1) - (5)].value_list).len+2;
5736     (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (5)].value).c);
5737     (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(5) - (5)].value).c);
5738 ;}
5739     break;
5740
5741   case 263:
5742
5743 /* Line 1455 of yacc.c  */
5744 #line 2641 "parser.y"
5745     {
5746     (yyval.value).c = code_new();
5747     (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc);
5748     (yyval.value).c = abc_newobject((yyval.value).c, (yyvsp[(2) - (3)].value_list).len/2);
5749     (yyval.value).t = registry_getobjectclass();
5750 ;}
5751     break;
5752
5753   case 264:
5754
5755 /* Line 1455 of yacc.c  */
5756 #line 2648 "parser.y"
5757     { 
5758                code_t*c = (yyvsp[(3) - (3)].value).c;
5759                if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
5760                 c=abc_multiply_i(c);
5761                } else {
5762                 c=abc_multiply(c);
5763                }
5764                c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '*'), (yyvsp[(1) - (3)].value).t);
5765                (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
5766                (yyval.value).t = (yyvsp[(1) - (3)].value).t;
5767               ;}
5768     break;
5769
5770   case 265:
5771
5772 /* Line 1455 of yacc.c  */
5773 #line 2660 "parser.y"
5774     { 
5775                code_t*c = abc_modulo((yyvsp[(3) - (3)].value).c);
5776                c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '%'), (yyvsp[(1) - (3)].value).t);
5777                (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
5778                (yyval.value).t = (yyvsp[(1) - (3)].value).t;
5779               ;}
5780     break;
5781
5782   case 266:
5783
5784 /* Line 1455 of yacc.c  */
5785 #line 2666 "parser.y"
5786     { 
5787                code_t*c = abc_lshift((yyvsp[(3) - (3)].value).c);
5788                c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '<'), (yyvsp[(1) - (3)].value).t);
5789                (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
5790                (yyval.value).t = (yyvsp[(1) - (3)].value).t;
5791               ;}
5792     break;
5793
5794   case 267:
5795
5796 /* Line 1455 of yacc.c  */
5797 #line 2672 "parser.y"
5798     { 
5799                code_t*c = abc_rshift((yyvsp[(3) - (3)].value).c);
5800                c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '>'), (yyvsp[(1) - (3)].value).t);
5801                (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
5802                (yyval.value).t = (yyvsp[(1) - (3)].value).t;
5803               ;}
5804     break;
5805
5806   case 268:
5807
5808 /* Line 1455 of yacc.c  */
5809 #line 2678 "parser.y"
5810     { 
5811                code_t*c = abc_urshift((yyvsp[(3) - (3)].value).c);
5812                c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'U'), (yyvsp[(1) - (3)].value).t);
5813                (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
5814                (yyval.value).t = (yyvsp[(1) - (3)].value).t;
5815               ;}
5816     break;
5817
5818   case 269:
5819
5820 /* Line 1455 of yacc.c  */
5821 #line 2684 "parser.y"
5822     { 
5823                code_t*c = abc_divide((yyvsp[(3) - (3)].value).c);
5824                c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '/'), (yyvsp[(1) - (3)].value).t);
5825                (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
5826                (yyval.value).t = (yyvsp[(1) - (3)].value).t;
5827               ;}
5828     break;
5829
5830   case 270:
5831
5832 /* Line 1455 of yacc.c  */
5833 #line 2690 "parser.y"
5834     { 
5835                code_t*c = abc_bitor((yyvsp[(3) - (3)].value).c);
5836                c=converttype(c, TYPE_INT, (yyvsp[(1) - (3)].value).t);
5837                (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
5838                (yyval.value).t = (yyvsp[(1) - (3)].value).t;
5839               ;}
5840     break;
5841
5842   case 271:
5843
5844 /* Line 1455 of yacc.c  */
5845 #line 2696 "parser.y"
5846     { 
5847                code_t*c = (yyvsp[(3) - (3)].value).c;
5848
5849                if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) {
5850                 c=abc_add_i(c);
5851                } else {
5852                 c=abc_add(c);
5853                 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '+'), (yyvsp[(1) - (3)].value).t);
5854                }
5855                
5856                (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
5857                (yyval.value).t = (yyvsp[(1) - (3)].value).t;
5858               ;}
5859     break;
5860
5861   case 272:
5862
5863 /* Line 1455 of yacc.c  */
5864 #line 2709 "parser.y"
5865     { code_t*c = (yyvsp[(3) - (3)].value).c; 
5866                if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) {
5867                 c=abc_subtract_i(c);
5868                } else {
5869                 c=abc_subtract(c);
5870                 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '-'), (yyvsp[(1) - (3)].value).t);
5871                }
5872                
5873                (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
5874                (yyval.value).t = (yyvsp[(1) - (3)].value).t;
5875              ;}
5876     break;
5877
5878   case 273:
5879
5880 /* Line 1455 of yacc.c  */
5881 #line 2720 "parser.y"
5882     { code_t*c = 0;
5883               c = code_append(c, (yyvsp[(3) - (3)].value).c);
5884               c = converttype(c, (yyvsp[(3) - (3)].value).t, (yyvsp[(1) - (3)].value).t);
5885               (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 1, 0);
5886               (yyval.value).t = (yyvsp[(1) - (3)].value).t;
5887             ;}
5888     break;
5889
5890   case 274:
5891
5892 /* Line 1455 of yacc.c  */
5893 #line 2727 "parser.y"
5894     { 
5895               (yyval.value).t = join_types((yyvsp[(3) - (5)].value).t,(yyvsp[(5) - (5)].value).t,'?');
5896               (yyval.value).c = (yyvsp[(1) - (5)].value).c;
5897               code_t*j1 = (yyval.value).c = abc_iffalse((yyval.value).c, 0);
5898               (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (5)].value).c);
5899               (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (5)].value).t, (yyval.value).t);
5900               code_t*j2 = (yyval.value).c = abc_jump((yyval.value).c, 0);
5901               (yyval.value).c = j1->branch = abc_label((yyval.value).c);
5902               (yyval.value).c = code_append((yyval.value).c, (yyvsp[(5) - (5)].value).c);
5903               (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (5)].value).t, (yyval.value).t);
5904               (yyval.value).c = j2->branch = abc_label((yyval.value).c);
5905             ;}
5906     break;
5907
5908   case 275:
5909
5910 /* Line 1455 of yacc.c  */
5911 #line 2740 "parser.y"
5912     { code_t*c = 0;
5913              classinfo_t*type = (yyvsp[(1) - (2)].value).t;
5914              if((is_getlocal((yyvsp[(1) - (2)].value).c) && TYPE_IS_INT((yyvsp[(1) - (2)].value).t)) || TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t)) {
5915                  int nr = getlocalnr((yyvsp[(1) - (2)].value).c);
5916                  code_free((yyvsp[(1) - (2)].value).c);(yyvsp[(1) - (2)].value).c=0;
5917                  if(TYPE_IS_INT((yyvsp[(1) - (2)].value).t)) {
5918                     (yyval.value).c = abc_getlocal(0, nr);
5919                     (yyval.value).c = abc_inclocal_i((yyval.value).c, nr);
5920                  } else if(TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t)) {
5921                     (yyval.value).c = abc_getlocal(0, nr);
5922                     (yyval.value).c = abc_inclocal((yyval.value).c, nr);
5923                  } else syntaxerror("internal error");
5924              } else {
5925                  if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
5926                      c=abc_increment_i(c);
5927                      type = TYPE_INT;
5928                  } else {
5929                      c=abc_increment(c);
5930                      type = TYPE_NUMBER;
5931                  }
5932                  c=converttype(c, type, (yyvsp[(1) - (2)].value).t);
5933                  (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1);
5934                  (yyval.value).t = (yyvsp[(1) - (2)].value).t;
5935              }
5936            ;}
5937     break;
5938
5939   case 276:
5940
5941 /* Line 1455 of yacc.c  */
5942 #line 2767 "parser.y"
5943     { code_t*c = 0;
5944              classinfo_t*type = (yyvsp[(1) - (2)].value).t;
5945              if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
5946                  c=abc_decrement_i(c);
5947                  type = TYPE_INT;
5948              } else {
5949                  c=abc_decrement(c);
5950                  type = TYPE_NUMBER;
5951              }
5952              c=converttype(c, type, (yyvsp[(1) - (2)].value).t);
5953              (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1);
5954              (yyval.value).t = (yyvsp[(1) - (2)].value).t;
5955             ;}
5956     break;
5957
5958   case 277:
5959
5960 /* Line 1455 of yacc.c  */
5961 #line 2781 "parser.y"
5962     { code_t*c = 0;
5963              classinfo_t*type = (yyvsp[(2) - (2)].value).t;
5964              if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
5965                  c=abc_increment_i(c);
5966                  type = TYPE_INT;
5967              } else {
5968                  c=abc_increment(c);
5969                  type = TYPE_NUMBER;
5970              }
5971              c=converttype(c, type, (yyvsp[(2) - (2)].value).t);
5972              (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0);
5973              (yyval.value).t = (yyvsp[(2) - (2)].value).t;
5974            ;}
5975     break;
5976
5977   case 278:
5978
5979 /* Line 1455 of yacc.c  */
5980 #line 2795 "parser.y"
5981     { code_t*c = 0;
5982              classinfo_t*type = (yyvsp[(2) - (2)].value).t;
5983              if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
5984                  c=abc_decrement_i(c);
5985                  type = TYPE_INT;
5986              } else {
5987                  c=abc_decrement(c);
5988                  type = TYPE_NUMBER;
5989              }
5990              c=converttype(c, type, (yyvsp[(2) - (2)].value).t);
5991              (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0);
5992              (yyval.value).t = (yyvsp[(2) - (2)].value).t;
5993            ;}
5994     break;
5995
5996   case 279:
5997
5998 /* Line 1455 of yacc.c  */
5999 #line 2810 "parser.y"
6000     { if(!state->cls->info)
6001                   syntaxerror("super keyword not allowed outside a class");
6002               classinfo_t*t = state->cls->info->superclass;
6003               if(!t) t = TYPE_OBJECT;
6004
6005               memberinfo_t*f = registry_findmember(t, (yyvsp[(3) - (3)].id), 1);
6006               namespace_t ns = flags2namespace(f->flags, "");
6007               MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
6008               (yyval.value).c = 0;
6009               (yyval.value).c = abc_getlocal_0((yyval.value).c);
6010               (yyval.value).c = abc_getsuper2((yyval.value).c, &m);
6011               (yyval.value).t = memberinfo_gettype(f);
6012            ;}
6013     break;
6014
6015   case 280:
6016
6017 /* Line 1455 of yacc.c  */
6018 #line 2825 "parser.y"
6019     {(yyval.value).c = (yyvsp[(1) - (3)].value).c;
6020              classinfo_t*t = (yyvsp[(1) - (3)].value).t;
6021              char is_static = 0;
6022              if(TYPE_IS_CLASS(t) && t->cls) {
6023                  t = t->cls;
6024                  is_static = 1;
6025              }
6026              if(t) {
6027                  memberinfo_t*f = registry_findmember(t, (yyvsp[(3) - (3)].id), 1);
6028                  char noslot = 0;
6029                  if(f && !is_static != !(f->flags&FLAG_STATIC))
6030                     noslot=1;
6031                  if(f && f->slot && !noslot) {
6032                      (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
6033                  } else {
6034                      MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
6035                      (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
6036                  }
6037                  /* determine type */
6038                  (yyval.value).t = memberinfo_gettype(f);
6039                  if(!(yyval.value).t)
6040                     (yyval.value).c = abc_coerce_a((yyval.value).c);
6041              } else {
6042                  /* when resolving a property on an unknown type, we do know the
6043                     name of the property (and don't seem to need the package), but
6044                     we need to make avm2 try out all access modes */
6045                  multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
6046                  (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
6047                  (yyval.value).c = abc_coerce_a((yyval.value).c);
6048                  (yyval.value).t = registry_getanytype();
6049              }
6050             ;}
6051     break;
6052
6053   case 281:
6054
6055 /* Line 1455 of yacc.c  */
6056 #line 2858 "parser.y"
6057     {
6058     (yyval.value).t = 0;
6059     (yyval.value).c = 0;
6060     classinfo_t*a = 0;
6061     memberinfo_t*f = 0;
6062
6063     variable_t*v;
6064     /* look at variables */
6065     if((v = find_variable((yyvsp[(1) - (1)].id)))) {
6066         // $1 is a local variable
6067         (yyval.value).c = abc_getlocal((yyval.value).c, v->index);
6068         (yyval.value).t = v->type;
6069         break;
6070     }
6071
6072     int i_am_static = (state->method && state->method->info)?(state->method->info->flags&FLAG_STATIC):FLAG_STATIC;
6073
6074     /* look at current class' members */
6075     if(state->cls && (f = registry_findmember(state->cls->info, (yyvsp[(1) - (1)].id), 1)) &&
6076         (f->flags&FLAG_STATIC) >= i_am_static) {
6077         // $1 is a function in this class
6078         int var_is_static = (f->flags&FLAG_STATIC);
6079
6080         if(f->kind == MEMBER_METHOD) {
6081             (yyval.value).t = TYPE_FUNCTION(f);
6082         } else {
6083             (yyval.value).t = f->type;
6084         }
6085         if(var_is_static && !i_am_static) {
6086         /* access to a static member from a non-static location.
6087            do this via findpropstrict:
6088            there doesn't seem to be any non-lookup way to access
6089            static properties of a class */
6090             state->method->late_binding = 1;
6091             (yyval.value).t = f->type;
6092             namespace_t ns = {flags2access(f->flags), ""};
6093             multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)};
6094             (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
6095             (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
6096             break;
6097         } else if(f->slot>0) {
6098             (yyval.value).c = abc_getlocal_0((yyval.value).c);
6099             (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
6100             break;
6101         } else {
6102             namespace_t ns = {flags2access(f->flags), ""};
6103             multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)};
6104             (yyval.value).c = abc_getlocal_0((yyval.value).c);
6105             (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
6106             break;
6107         }
6108     } 
6109     
6110     /* look at actual classes, in the current package and imported */
6111     if((a = find_class((yyvsp[(1) - (1)].id)))) {
6112         if(a->flags & FLAG_METHOD) {
6113             MULTINAME(m, a);
6114             (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
6115             (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
6116             if(a->function->kind == MEMBER_METHOD) {
6117                 (yyval.value).t = TYPE_FUNCTION(a->function);
6118             } else {
6119                 (yyval.value).t = a->function->type;
6120             }
6121         } else {
6122             if(a->slot) {
6123                 (yyval.value).c = abc_getglobalscope((yyval.value).c);
6124                 (yyval.value).c = abc_getslot((yyval.value).c, a->slot);
6125             } else {
6126                 MULTINAME(m, a);
6127                 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
6128             }
6129             (yyval.value).t = TYPE_CLASS(a);
6130         }
6131         break;
6132     }
6133
6134     /* unknown object, let the avm2 resolve it */
6135     if(1) {
6136         if(strcmp((yyvsp[(1) - (1)].id),"trace"))
6137             as3_softwarning("Couldn't resolve '%s', doing late binding", (yyvsp[(1) - (1)].id));
6138         state->method->late_binding = 1;
6139                 
6140         multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(1) - (1)].id)};
6141
6142         (yyval.value).t = 0;
6143         (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
6144         (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
6145     }
6146 ;}
6147     break;
6148
6149   case 282:
6150
6151 /* Line 1455 of yacc.c  */
6152 #line 2956 "parser.y"
6153     {(yyval.code)=0;;}
6154     break;
6155
6156   case 283:
6157
6158 /* Line 1455 of yacc.c  */
6159 #line 2957 "parser.y"
6160     {(yyval.code)=0;;}
6161     break;
6162
6163   case 284:
6164
6165 /* Line 1455 of yacc.c  */
6166 #line 2958 "parser.y"
6167     {(yyval.code)=0;;}
6168     break;
6169
6170   case 285:
6171
6172 /* Line 1455 of yacc.c  */
6173 #line 2960 "parser.y"
6174     {(yyval.token)=0;;}
6175     break;
6176
6177
6178
6179 /* Line 1455 of yacc.c  */
6180 #line 6181 "parser.tab.c"
6181       default: break;
6182     }
6183   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
6184
6185   YYPOPSTACK (yylen);
6186   yylen = 0;
6187   YY_STACK_PRINT (yyss, yyssp);
6188
6189   *++yyvsp = yyval;
6190
6191   /* Now `shift' the result of the reduction.  Determine what state
6192      that goes to, based on the state we popped back to and the rule
6193      number reduced by.  */
6194
6195   yyn = yyr1[yyn];
6196
6197   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
6198   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
6199     yystate = yytable[yystate];
6200   else
6201     yystate = yydefgoto[yyn - YYNTOKENS];
6202
6203   goto yynewstate;
6204
6205
6206 /*------------------------------------.
6207 | yyerrlab -- here on detecting error |
6208 `------------------------------------*/
6209 yyerrlab:
6210   /* If not already recovering from an error, report this error.  */
6211   if (!yyerrstatus)
6212     {
6213       ++yynerrs;
6214 #if ! YYERROR_VERBOSE
6215       yyerror (YY_("syntax error"));
6216 #else
6217       {
6218         YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
6219         if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
6220           {
6221             YYSIZE_T yyalloc = 2 * yysize;
6222             if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
6223               yyalloc = YYSTACK_ALLOC_MAXIMUM;
6224             if (yymsg != yymsgbuf)
6225               YYSTACK_FREE (yymsg);
6226             yymsg = (char *) YYSTACK_ALLOC (yyalloc);
6227             if (yymsg)
6228               yymsg_alloc = yyalloc;
6229             else
6230               {
6231                 yymsg = yymsgbuf;
6232                 yymsg_alloc = sizeof yymsgbuf;
6233               }
6234           }
6235
6236         if (0 < yysize && yysize <= yymsg_alloc)
6237           {
6238             (void) yysyntax_error (yymsg, yystate, yychar);
6239             yyerror (yymsg);
6240           }
6241         else
6242           {
6243             yyerror (YY_("syntax error"));
6244             if (yysize != 0)
6245               goto yyexhaustedlab;
6246           }
6247       }
6248 #endif
6249     }
6250
6251
6252
6253   if (yyerrstatus == 3)
6254     {
6255       /* If just tried and failed to reuse lookahead token after an
6256          error, discard it.  */
6257
6258       if (yychar <= YYEOF)
6259         {
6260           /* Return failure if at end of input.  */
6261           if (yychar == YYEOF)
6262             YYABORT;
6263         }
6264       else
6265         {
6266           yydestruct ("Error: discarding",
6267                       yytoken, &yylval);
6268           yychar = YYEMPTY;
6269         }
6270     }
6271
6272   /* Else will try to reuse lookahead token after shifting the error
6273      token.  */
6274   goto yyerrlab1;
6275
6276
6277 /*---------------------------------------------------.
6278 | yyerrorlab -- error raised explicitly by YYERROR.  |
6279 `---------------------------------------------------*/
6280 yyerrorlab:
6281
6282   /* Pacify compilers like GCC when the user code never invokes
6283      YYERROR and the label yyerrorlab therefore never appears in user
6284      code.  */
6285   if (/*CONSTCOND*/ 0)
6286      goto yyerrorlab;
6287
6288   /* Do not reclaim the symbols of the rule which action triggered
6289      this YYERROR.  */
6290   YYPOPSTACK (yylen);
6291   yylen = 0;
6292   YY_STACK_PRINT (yyss, yyssp);
6293   yystate = *yyssp;
6294   goto yyerrlab1;
6295
6296
6297 /*-------------------------------------------------------------.
6298 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
6299 `-------------------------------------------------------------*/
6300 yyerrlab1:
6301   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
6302
6303   for (;;)
6304     {
6305       yyn = yypact[yystate];
6306       if (yyn != YYPACT_NINF)
6307         {
6308           yyn += YYTERROR;
6309           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
6310             {
6311               yyn = yytable[yyn];
6312               if (0 < yyn)
6313                 break;
6314             }
6315         }
6316
6317       /* Pop the current state because it cannot handle the error token.  */
6318       if (yyssp == yyss)
6319         YYABORT;
6320
6321
6322       yydestruct ("Error: popping",
6323                   yystos[yystate], yyvsp);
6324       YYPOPSTACK (1);
6325       yystate = *yyssp;
6326       YY_STACK_PRINT (yyss, yyssp);
6327     }
6328
6329   *++yyvsp = yylval;
6330
6331
6332   /* Shift the error token.  */
6333   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
6334
6335   yystate = yyn;
6336   goto yynewstate;
6337
6338
6339 /*-------------------------------------.
6340 | yyacceptlab -- YYACCEPT comes here.  |
6341 `-------------------------------------*/
6342 yyacceptlab:
6343   yyresult = 0;
6344   goto yyreturn;
6345
6346 /*-----------------------------------.
6347 | yyabortlab -- YYABORT comes here.  |
6348 `-----------------------------------*/
6349 yyabortlab:
6350   yyresult = 1;
6351   goto yyreturn;
6352
6353 #if !defined(yyoverflow) || YYERROR_VERBOSE
6354 /*-------------------------------------------------.
6355 | yyexhaustedlab -- memory exhaustion comes here.  |
6356 `-------------------------------------------------*/
6357 yyexhaustedlab:
6358   yyerror (YY_("memory exhausted"));
6359   yyresult = 2;
6360   /* Fall through.  */
6361 #endif
6362
6363 yyreturn:
6364   if (yychar != YYEMPTY)
6365      yydestruct ("Cleanup: discarding lookahead",
6366                  yytoken, &yylval);
6367   /* Do not reclaim the symbols of the rule which action triggered
6368      this YYABORT or YYACCEPT.  */
6369   YYPOPSTACK (yylen);
6370   YY_STACK_PRINT (yyss, yyssp);
6371   while (yyssp != yyss)
6372     {
6373       yydestruct ("Cleanup: popping",
6374                   yystos[*yyssp], yyvsp);
6375       YYPOPSTACK (1);
6376     }
6377 #ifndef yyoverflow
6378   if (yyss != yyssa)
6379     YYSTACK_FREE (yyss);
6380 #endif
6381 #if YYERROR_VERBOSE
6382   if (yymsg != yymsgbuf)
6383     YYSTACK_FREE (yymsg);
6384 #endif
6385   /* Make sure YYID is used.  */
6386   return YYID (yyresult);
6387 }
6388
6389
6390