generated using flex+bison
[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,  1552,  1553,  1557,  1558,  1560,  1561,  1563,  1604,
1918     1605,  1608,  1608,  1627,  1628,  1629,  1632,  1635,  1639,  1640,
1919     1642,  1662,  1705,  1705,  1724,  1724,  1739,  1742,  1745,  1748,
1920     1752,  1753,  1754,  1755,  1756,  1757,  1759,  1770,  1773,  1773,
1921     1802,  1802,  1822,  1822,  1839,  1840,  1841,  1842,  1850,  1859,
1922     1859,  1904,  1908,  1919,  1928,  1929,  1931,  1932,  1934,  1934,
1923     1935,  1935,  1937,  1945,  1955,  1956,  1957,  1958,  1960,  1961,
1924     1962,  1963,  1964,  1965,  1966,  1967,  1968,  1970,  1971,  1973,
1925     1974,  1976,  1977,  1981,  1979,  1987,  1985,  1993,  1994,  1995,
1926     1996,  1997,  1998,  1999,  2001,  2007,  2008,  2009,  2010,  2011,
1927     2012,  2015,  2026,  2026,  2028,  2086,  2087,  2089,  2090,  2091,
1928     2092,  2093,  2095,  2096,  2097,  2102,  2105,  2110,  2115,  2122,
1929     2126,  2131,  2137,  2143,  2144,  2145,  2148,  2147,  2165,  2166,
1930     2167,  2175,  2182,  2188,  2189,  2191,  2192,  2194,  2195,  2196,
1931     2205,  2206,  2210,  2211,  2213,  2214,  2215,  2218,  2223,  2247,
1932     2295,  2315,  2336,  2339,  2346,  2347,  2348,  2354,  2360,  2362,
1933     2364,  2366,  2368,  2370,  2387,  2392,  2395,  2398,  2401,  2404,
1934     2407,  2410,  2413,  2416,  2420,  2421,  2424,  2427,  2430,  2433,
1935     2436,  2439,  2442,  2446,  2457,  2475,  2480,  2485,  2490,  2495,
1936     2500,  2504,  2508,  2513,  2517,  2521,  2530,  2539,  2549,  2554,
1937     2566,  2572,  2577,  2583,  2589,  2593,  2595,  2606,  2615,  2622,
1938     2623,  2625,  2631,  2640,  2647,  2659,  2665,  2671,  2677,  2683,
1939     2689,  2695,  2708,  2719,  2726,  2739,  2766,  2780,  2794,  2808,
1940     2823,  2857,  2944,  2945,  2946,  2948
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     if((yyvsp[(1) - (1)].code)) as3_warning("code ignored");
3680 ;}
3681     break;
3682
3683   case 52:
3684
3685 /* Line 1455 of yacc.c  */
3686 #line 1552 "parser.y"
3687     {(yyval.value)=(yyvsp[(2) - (2)].value);;}
3688     break;
3689
3690   case 53:
3691
3692 /* Line 1455 of yacc.c  */
3693 #line 1553 "parser.y"
3694     {(yyval.value).c=abc_pushundefined(0);
3695                                   (yyval.value).t=TYPE_ANY;
3696                                  ;}
3697     break;
3698
3699   case 54:
3700
3701 /* Line 1455 of yacc.c  */
3702 #line 1557 "parser.y"
3703     {(yyval.code)=(yyvsp[(2) - (2)].code);;}
3704     break;
3705
3706   case 55:
3707
3708 /* Line 1455 of yacc.c  */
3709 #line 1558 "parser.y"
3710     {(yyval.code)=(yyvsp[(2) - (2)].code);;}
3711     break;
3712
3713   case 56:
3714
3715 /* Line 1455 of yacc.c  */
3716 #line 1560 "parser.y"
3717     {(yyval.code) = (yyvsp[(1) - (1)].code);;}
3718     break;
3719
3720   case 57:
3721
3722 /* Line 1455 of yacc.c  */
3723 #line 1561 "parser.y"
3724     {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));;}
3725     break;
3726
3727   case 58:
3728
3729 /* Line 1455 of yacc.c  */
3730 #line 1564 "parser.y"
3731     {
3732     if(variable_exists((yyvsp[(1) - (3)].id)))
3733         syntaxerror("Variable %s already defined", (yyvsp[(1) - (3)].id));
3734    
3735     if(!is_subtype_of((yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo))) {
3736         syntaxerror("Can't convert %s to %s", (yyvsp[(3) - (3)].value).t->name, 
3737                                               (yyvsp[(2) - (3)].classinfo)->name);
3738     }
3739
3740     int index = new_variable((yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].classinfo), 1);
3741     
3742     if((yyvsp[(2) - (3)].classinfo)) {
3743         if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) {
3744             (yyval.code) = (yyvsp[(3) - (3)].value).c;
3745             (yyval.code) = converttype((yyval.code), (yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo));
3746             (yyval.code) = abc_setlocal((yyval.code), index);
3747         } else {
3748             (yyval.code) = defaultvalue(0, (yyvsp[(2) - (3)].classinfo));
3749             (yyval.code) = abc_setlocal((yyval.code), index);
3750         }
3751     } else {
3752         if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) {
3753             (yyval.code) = (yyvsp[(3) - (3)].value).c;
3754             (yyval.code) = abc_coerce_a((yyval.code));
3755             (yyval.code) = abc_setlocal((yyval.code), index);
3756         } else {
3757             (yyval.code) = code_new();
3758         }
3759     }
3760     
3761     /* that's the default for a local register, anyway
3762         else {
3763         state->method->initcode = abc_pushundefined(state->method->initcode);
3764         state->method->initcode = abc_setlocal(state->method->initcode, index);
3765     }*/
3766     //printf("variable %s -> %d (%s)\n", $2->text, index, $4.t?$4.t->name:"");
3767 ;}
3768     break;
3769
3770   case 59:
3771
3772 /* Line 1455 of yacc.c  */
3773 #line 1604 "parser.y"
3774     {(yyval.code) = code_new();;}
3775     break;
3776
3777   case 60:
3778
3779 /* Line 1455 of yacc.c  */
3780 #line 1605 "parser.y"
3781     {(yyval.code)=(yyvsp[(2) - (2)].code);;}
3782     break;
3783
3784   case 61:
3785
3786 /* Line 1455 of yacc.c  */
3787 #line 1608 "parser.y"
3788     {new_state();;}
3789     break;
3790
3791   case 62:
3792
3793 /* Line 1455 of yacc.c  */
3794 #line 1608 "parser.y"
3795     {
3796      
3797     (yyval.code) = code_new();
3798     (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (7)].value).c);
3799     code_t*myjmp,*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
3800    
3801     (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].code));
3802     if((yyvsp[(7) - (7)].code)) {
3803         myjmp = (yyval.code) = abc_jump((yyval.code), 0);
3804     }
3805     myif->branch = (yyval.code) = abc_nop((yyval.code));
3806     if((yyvsp[(7) - (7)].code)) {
3807         (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (7)].code));
3808         myjmp->branch = (yyval.code) = abc_nop((yyval.code));
3809     }
3810     (yyval.code) = var_block((yyval.code));
3811     old_state();
3812 ;}
3813     break;
3814
3815   case 63:
3816
3817 /* Line 1455 of yacc.c  */
3818 #line 1627 "parser.y"
3819     {(yyval.code)=code_new();;}
3820     break;
3821
3822   case 66:
3823
3824 /* Line 1455 of yacc.c  */
3825 #line 1632 "parser.y"
3826     {
3827     (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1);
3828 ;}
3829     break;
3830
3831   case 67:
3832
3833 /* Line 1455 of yacc.c  */
3834 #line 1635 "parser.y"
3835     {
3836     (yyval.id)=(yyvsp[(1) - (1)].id);
3837 ;}
3838     break;
3839
3840   case 68:
3841
3842 /* Line 1455 of yacc.c  */
3843 #line 1639 "parser.y"
3844     {new_state();(yyval.for_start).name=(yyvsp[(1) - (2)].id);(yyval.for_start).each=0;;}
3845     break;
3846
3847   case 69:
3848
3849 /* Line 1455 of yacc.c  */
3850 #line 1640 "parser.y"
3851     {new_state();(yyval.for_start).name=(yyvsp[(1) - (3)].id);(yyval.for_start).each=1;;}
3852     break;
3853
3854   case 70:
3855
3856 /* Line 1455 of yacc.c  */
3857 #line 1642 "parser.y"
3858     {
3859     if((yyvsp[(1) - (8)].for_start).each) syntaxerror("invalid syntax: ; not allowed in for each statement");
3860     (yyval.code) = code_new();
3861     (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (8)].code));
3862     code_t*loopstart = (yyval.code) = abc_label((yyval.code));
3863     (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (8)].value).c);
3864     code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
3865     (yyval.code) = code_append((yyval.code), (yyvsp[(8) - (8)].code));
3866     code_t*cont = (yyval.code) = abc_nop((yyval.code));
3867     (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (8)].code));
3868     (yyval.code) = abc_jump((yyval.code), loopstart);
3869     code_t*out = (yyval.code) = abc_nop((yyval.code));
3870     breakjumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, out);
3871     continuejumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, cont);
3872     myif->branch = out;
3873
3874     (yyval.code) = var_block((yyval.code));
3875     old_state();
3876 ;}
3877     break;
3878
3879   case 71:
3880
3881 /* Line 1455 of yacc.c  */
3882 #line 1662 "parser.y"
3883     {
3884     variable_t*var = find_variable((yyvsp[(2) - (6)].id));
3885     char*tmp1name = concat2((yyvsp[(2) - (6)].id), "__tmp1__");
3886     int it = new_variable(tmp1name, TYPE_INT, 0);
3887     char*tmp2name = concat2((yyvsp[(2) - (6)].id), "__array__");
3888     int array = new_variable(tmp1name, 0, 0);
3889
3890     (yyval.code) = code_new();
3891     (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
3892     (yyval.code) = abc_coerce_a((yyval.code));
3893     (yyval.code) = abc_setlocal((yyval.code), array);
3894     (yyval.code) = abc_pushbyte((yyval.code), 0);
3895     (yyval.code) = abc_setlocal((yyval.code), it);
3896
3897     code_t*loopstart = (yyval.code) = abc_label((yyval.code));
3898     
3899     (yyval.code) = abc_hasnext2((yyval.code), array, it);
3900     code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0);
3901     (yyval.code) = abc_getlocal((yyval.code), array);
3902     (yyval.code) = abc_getlocal((yyval.code), it);
3903     if(!(yyvsp[(1) - (6)].for_start).each)
3904         (yyval.code) = abc_nextname((yyval.code));
3905     else
3906         (yyval.code) = abc_nextvalue((yyval.code));
3907     (yyval.code) = converttype((yyval.code), 0, var->type);
3908     (yyval.code) = abc_setlocal((yyval.code), var->index);
3909
3910     (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
3911     (yyval.code) = abc_jump((yyval.code), loopstart);
3912     
3913     code_t*out = (yyval.code) = abc_nop((yyval.code));
3914     breakjumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, out);
3915     continuejumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, loopstart);
3916     
3917     myif->branch = out;
3918
3919     (yyval.code) = var_block((yyval.code));
3920     old_state();
3921
3922     free(tmp1name);
3923     free(tmp2name);
3924 ;}
3925     break;
3926
3927   case 72:
3928
3929 /* Line 1455 of yacc.c  */
3930 #line 1705 "parser.y"
3931     {new_state();;}
3932     break;
3933
3934   case 73:
3935
3936 /* Line 1455 of yacc.c  */
3937 #line 1705 "parser.y"
3938     {
3939
3940     (yyval.code) = code_new();
3941
3942     code_t*myjmp = (yyval.code) = abc_jump((yyval.code), 0);
3943     code_t*loopstart = (yyval.code) = abc_label((yyval.code));
3944     (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code));
3945     code_t*cont = (yyval.code) = abc_nop((yyval.code));
3946     myjmp->branch = cont;
3947     (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c);
3948     (yyval.code) = abc_iftrue((yyval.code), loopstart);
3949     code_t*out = (yyval.code) = abc_nop((yyval.code));
3950     breakjumpsto((yyval.code), (yyvsp[(1) - (6)].id), out);
3951     continuejumpsto((yyval.code), (yyvsp[(1) - (6)].id), cont);
3952
3953     (yyval.code) = var_block((yyval.code));
3954     old_state();
3955 ;}
3956     break;
3957
3958   case 74:
3959
3960 /* Line 1455 of yacc.c  */
3961 #line 1724 "parser.y"
3962     {new_state();;}
3963     break;
3964
3965   case 75:
3966
3967 /* Line 1455 of yacc.c  */
3968 #line 1724 "parser.y"
3969     {
3970     (yyval.code) = code_new();
3971     code_t*loopstart = (yyval.code) = abc_label((yyval.code));
3972     (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (7)].code));
3973     code_t*cont = (yyval.code) = abc_nop((yyval.code));
3974     (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].value).c);
3975     (yyval.code) = abc_iftrue((yyval.code), loopstart);
3976     code_t*out = (yyval.code) = abc_nop((yyval.code));
3977     breakjumpsto((yyval.code), (yyvsp[(1) - (7)].id), out);
3978     continuejumpsto((yyval.code), (yyvsp[(1) - (7)].id), cont);
3979     
3980     (yyval.code) = var_block((yyval.code));
3981     old_state();
3982 ;}
3983     break;
3984
3985   case 76:
3986
3987 /* Line 1455 of yacc.c  */
3988 #line 1739 "parser.y"
3989     {
3990     (yyval.code) = abc___break__(0, "");
3991 ;}
3992     break;
3993
3994   case 77:
3995
3996 /* Line 1455 of yacc.c  */
3997 #line 1742 "parser.y"
3998     {
3999     (yyval.code) = abc___break__(0, (yyvsp[(2) - (2)].id));
4000 ;}
4001     break;
4002
4003   case 78:
4004
4005 /* Line 1455 of yacc.c  */
4006 #line 1745 "parser.y"
4007     {
4008     (yyval.code) = abc___continue__(0, "");
4009 ;}
4010     break;
4011
4012   case 79:
4013
4014 /* Line 1455 of yacc.c  */
4015 #line 1748 "parser.y"
4016     {
4017     (yyval.code) = abc___continue__(0, (yyvsp[(2) - (2)].id));
4018 ;}
4019     break;
4020
4021   case 80:
4022
4023 /* Line 1455 of yacc.c  */
4024 #line 1752 "parser.y"
4025     {(yyval.code)=0;;}
4026     break;
4027
4028   case 81:
4029
4030 /* Line 1455 of yacc.c  */
4031 #line 1753 "parser.y"
4032     {(yyval.code)=(yyvsp[(1) - (1)].code);;}
4033     break;
4034
4035   case 82:
4036
4037 /* Line 1455 of yacc.c  */
4038 #line 1754 "parser.y"
4039     {(yyval.code)=(yyvsp[(1) - (1)].code);;}
4040     break;
4041
4042   case 83:
4043
4044 /* Line 1455 of yacc.c  */
4045 #line 1755 "parser.y"
4046     {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));;}
4047     break;
4048
4049   case 84:
4050
4051 /* Line 1455 of yacc.c  */
4052 #line 1756 "parser.y"
4053     {(yyval.code)=(yyvsp[(1) - (1)].code);}
4054     break;
4055
4056   case 85:
4057
4058 /* Line 1455 of yacc.c  */
4059 #line 1757 "parser.y"
4060     {(yyval.code)=code_append((yyval.code),(yyvsp[(2) - (2)].code));;}
4061     break;
4062
4063   case 86:
4064
4065 /* Line 1455 of yacc.c  */
4066 #line 1759 "parser.y"
4067     {
4068     (yyval.code) = abc_dup(0);
4069     (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (4)].value).c);
4070     code_t*j = (yyval.code) = abc_ifne((yyval.code), 0);
4071     (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (4)].code));
4072     if((yyval.code)->opcode != OPCODE___BREAK__) {
4073         (yyval.code) = abc___fallthrough__((yyval.code), "");
4074     }
4075     code_t*e = (yyval.code) = abc_nop((yyval.code));
4076     j->branch = e;
4077 ;}
4078     break;
4079
4080   case 87:
4081
4082 /* Line 1455 of yacc.c  */
4083 #line 1770 "parser.y"
4084     {
4085     (yyval.code) = (yyvsp[(3) - (3)].code);
4086 ;}
4087     break;
4088
4089   case 88:
4090
4091 /* Line 1455 of yacc.c  */
4092 #line 1773 "parser.y"
4093     {new_state();;}
4094     break;
4095
4096   case 89:
4097
4098 /* Line 1455 of yacc.c  */
4099 #line 1773 "parser.y"
4100     {
4101     (yyval.code)=(yyvsp[(4) - (8)].value).c;
4102     (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (8)].code));
4103     code_t*out = (yyval.code) = abc_pop((yyval.code));
4104     breakjumpsto((yyval.code), (yyvsp[(1) - (8)].id), out);
4105     
4106     code_t*c = (yyval.code),*lastblock=0;
4107     while(c) {
4108         if(c->opcode == OPCODE_IFNE) {
4109             if(!c->next) syntaxerror("internal error in fallthrough handling");
4110             lastblock=c->next;
4111         } else if(c->opcode == OPCODE___FALLTHROUGH__) {
4112             if(lastblock) {
4113                 c->opcode = OPCODE_JUMP;
4114                 c->branch = lastblock;
4115             } else {
4116                 /* fall through end of switch */
4117                 c->opcode = OPCODE_NOP;
4118             }
4119         }
4120         c=c->prev;
4121     }
4122    
4123     (yyval.code) = var_block((yyval.code));
4124     old_state();
4125 ;}
4126     break;
4127
4128   case 90:
4129
4130 /* Line 1455 of yacc.c  */
4131 #line 1802 "parser.y"
4132     {new_state();state->exception_name=(yyvsp[(3) - (5)].id);new_variable((yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].classinfo), 0);;}
4133     break;
4134
4135   case 91:
4136
4137 /* Line 1455 of yacc.c  */
4138 #line 1803 "parser.y"
4139     {
4140     namespace_t name_ns = {ACCESS_PACKAGE, ""};
4141     multiname_t name = {QNAME, &name_ns, 0, (yyvsp[(3) - (9)].id)};
4142     
4143     NEW(abc_exception_t, e)
4144     e->exc_type = sig2mname((yyvsp[(4) - (9)].classinfo));
4145     e->var_name = multiname_clone(&name);
4146     (yyval.exception) = e;
4147
4148     code_t*c = 0;
4149     int i = find_variable_safe((yyvsp[(3) - (9)].id))->index;
4150     e->target = c = abc_nop(0);
4151     c = abc_setlocal(c, i);
4152     c = code_append(c, (yyvsp[(8) - (9)].code));
4153     c = abc_kill(c, i);
4154
4155     c = var_block(c);
4156     old_state();
4157 ;}
4158     break;
4159
4160   case 92:
4161
4162 /* Line 1455 of yacc.c  */
4163 #line 1822 "parser.y"
4164     {new_state();state->exception_name=0;;}
4165     break;
4166
4167   case 93:
4168
4169 /* Line 1455 of yacc.c  */
4170 #line 1822 "parser.y"
4171     {
4172     (yyvsp[(4) - (5)].code) = var_block((yyvsp[(4) - (5)].code));
4173     if(!(yyvsp[(4) - (5)].code)) {
4174         (yyval.exception)=0;
4175         old_state();
4176     } else {
4177         NEW(abc_exception_t, e)
4178         e->exc_type = 0; //all exceptions
4179         e->var_name = 0; //no name
4180         e->target = 0;
4181         e->to = abc_nop(0);
4182         e->to = code_append(e->to, (yyvsp[(4) - (5)].code));
4183         old_state();
4184         (yyval.exception) = e;
4185     }
4186 ;}
4187     break;
4188
4189   case 94:
4190
4191 /* Line 1455 of yacc.c  */
4192 #line 1839 "parser.y"
4193     {(yyval.catch_list).l=list_new();(yyval.catch_list).finally=0;list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));;}
4194     break;
4195
4196   case 95:
4197
4198 /* Line 1455 of yacc.c  */
4199 #line 1840 "parser.y"
4200     {(yyval.catch_list)=(yyvsp[(1) - (2)].catch_list);list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));;}
4201     break;
4202
4203   case 96:
4204
4205 /* Line 1455 of yacc.c  */
4206 #line 1841 "parser.y"
4207     {(yyval.catch_list)=(yyvsp[(1) - (1)].catch_list);}
4208     break;
4209
4210   case 97:
4211
4212 /* Line 1455 of yacc.c  */
4213 #line 1842 "parser.y"
4214     {
4215     (yyval.catch_list) = (yyvsp[(1) - (2)].catch_list);
4216     (yyval.catch_list).finally = 0;
4217     if((yyvsp[(2) - (2)].exception)) {
4218         list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));
4219         (yyval.catch_list).finally = (yyvsp[(2) - (2)].exception)->to;(yyvsp[(2) - (2)].exception)->to=0;
4220     }
4221 ;}
4222     break;
4223
4224   case 98:
4225
4226 /* Line 1455 of yacc.c  */
4227 #line 1850 "parser.y"
4228     {
4229     (yyval.catch_list).l=list_new();
4230     (yyval.catch_list).finally = 0;
4231     if((yyvsp[(1) - (1)].exception)) {
4232         list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));
4233         (yyval.catch_list).finally = (yyvsp[(1) - (1)].exception)->to;(yyvsp[(1) - (1)].exception)->to=0;
4234     }
4235 ;}
4236     break;
4237
4238   case 99:
4239
4240 /* Line 1455 of yacc.c  */
4241 #line 1859 "parser.y"
4242     {new_state();;}
4243     break;
4244
4245   case 100:
4246
4247 /* Line 1455 of yacc.c  */
4248 #line 1859 "parser.y"
4249     {
4250     code_t*out = abc_nop(0);
4251
4252     code_t*start = abc_nop(0);
4253     (yyval.code) = code_append(start, (yyvsp[(4) - (6)].code));
4254     if(!is_break_or_jump((yyvsp[(4) - (6)].code))) {
4255         (yyval.code) = abc_jump((yyval.code), out);
4256     }
4257     code_t*end = (yyval.code) = abc_nop((yyval.code));
4258   
4259     int tmp;
4260     if((yyvsp[(6) - (6)].catch_list).finally)
4261         tmp = new_variable("__finally__", 0, 0);
4262     
4263     abc_exception_list_t*l = (yyvsp[(6) - (6)].catch_list).l;
4264     int count=0;
4265     while(l) {
4266         abc_exception_t*e = l->abc_exception;
4267         if(e->var_name) {
4268             (yyval.code) = code_append((yyval.code), e->target);
4269             (yyval.code) = abc_jump((yyval.code), out);
4270         } else {
4271             parserassert((ptroff_t)(yyvsp[(6) - (6)].catch_list).finally);
4272             // finally block
4273             e->target = (yyval.code) = abc_nop((yyval.code));
4274             (yyval.code) = abc___rethrow__((yyval.code));
4275         }
4276         
4277         e->from = start;
4278         e->to = end;
4279
4280         l = l->next;
4281     }
4282     (yyval.code) = code_append((yyval.code), out);
4283
4284     (yyval.code) = insert_finally((yyval.code), (yyvsp[(6) - (6)].catch_list).finally, tmp);
4285         
4286     list_concat(state->method->exceptions, (yyvsp[(6) - (6)].catch_list).l);
4287    
4288     (yyval.code) = var_block((yyval.code));
4289     old_state();
4290 ;}
4291     break;
4292
4293   case 101:
4294
4295 /* Line 1455 of yacc.c  */
4296 #line 1904 "parser.y"
4297     {
4298     (yyval.code)=(yyvsp[(2) - (2)].value).c;
4299     (yyval.code)=abc_throw((yyval.code));
4300 ;}
4301     break;
4302
4303   case 102:
4304
4305 /* Line 1455 of yacc.c  */
4306 #line 1908 "parser.y"
4307     {
4308     if(!state->exception_name)
4309         syntaxerror("re-throw only possible within a catch block");
4310     variable_t*v = find_variable(state->exception_name);
4311     (yyval.code)=code_new();
4312     (yyval.code)=abc_getlocal((yyval.code), v->index);
4313     (yyval.code)=abc_throw((yyval.code));
4314 ;}
4315     break;
4316
4317   case 103:
4318
4319 /* Line 1455 of yacc.c  */
4320 #line 1919 "parser.y"
4321     {
4322      (yyval.code) = (yyvsp[(3) - (5)].value).c;
4323      (yyval.code) = abc_pushscope((yyval.code));
4324      (yyval.code) = code_append((yyval.code), (yyvsp[(5) - (5)].code));
4325      (yyval.code) = abc_popscope((yyval.code));
4326 ;}
4327     break;
4328
4329   case 105:
4330
4331 /* Line 1455 of yacc.c  */
4332 #line 1929 "parser.y"
4333     {(yyval.id)="package";;}
4334     break;
4335
4336   case 106:
4337
4338 /* Line 1455 of yacc.c  */
4339 #line 1931 "parser.y"
4340     {(yyval.id) = concat3((yyvsp[(1) - (3)].id),".",(yyvsp[(3) - (3)].id));free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;;}
4341     break;
4342
4343   case 107:
4344
4345 /* Line 1455 of yacc.c  */
4346 #line 1932 "parser.y"
4347     {(yyval.id)=strdup((yyvsp[(1) - (1)].id));;}
4348     break;
4349
4350   case 108:
4351
4352 /* Line 1455 of yacc.c  */
4353 #line 1934 "parser.y"
4354     {startpackage((yyvsp[(2) - (3)].id));free((yyvsp[(2) - (3)].id));(yyvsp[(2) - (3)].id)=0;;}
4355     break;
4356
4357   case 109:
4358
4359 /* Line 1455 of yacc.c  */
4360 #line 1934 "parser.y"
4361     {endpackage();(yyval.code)=0;;}
4362     break;
4363
4364   case 110:
4365
4366 /* Line 1455 of yacc.c  */
4367 #line 1935 "parser.y"
4368     {startpackage("");}
4369     break;
4370
4371   case 111:
4372
4373 /* Line 1455 of yacc.c  */
4374 #line 1935 "parser.y"
4375     {endpackage();(yyval.code)=0;;}
4376     break;
4377
4378   case 112:
4379
4380 /* Line 1455 of yacc.c  */
4381 #line 1937 "parser.y"
4382     {
4383        classinfo_t*c = (yyvsp[(2) - (2)].classinfo);
4384        if(!c) 
4385             syntaxerror("Couldn't import class\n");
4386        state_has_imports();
4387        dict_put(state->imports, c->name, c);
4388        (yyval.code)=0;
4389 ;}
4390     break;
4391
4392   case 113:
4393
4394 /* Line 1455 of yacc.c  */
4395 #line 1945 "parser.y"
4396     {
4397        NEW(import_t,i);
4398        i->package = (yyvsp[(2) - (4)].id);
4399        state_has_imports();
4400        list_append(state->wildcard_imports, i);
4401        (yyval.code)=0;
4402 ;}
4403     break;
4404
4405   case 114:
4406
4407 /* Line 1455 of yacc.c  */
4408 #line 1955 "parser.y"
4409     {(yyval.flags)=0;;}
4410     break;
4411
4412   case 115:
4413
4414 /* Line 1455 of yacc.c  */
4415 #line 1956 "parser.y"
4416     {(yyval.flags)=(yyvsp[(1) - (1)].flags);}
4417     break;
4418
4419   case 116:
4420
4421 /* Line 1455 of yacc.c  */
4422 #line 1957 "parser.y"
4423     {(yyval.flags)=(yyvsp[(1) - (1)].token);;}
4424     break;
4425
4426   case 117:
4427
4428 /* Line 1455 of yacc.c  */
4429 #line 1958 "parser.y"
4430     {(yyval.flags)=(yyvsp[(1) - (2)].flags)|(yyvsp[(2) - (2)].token);;}
4431     break;
4432
4433   case 118:
4434
4435 /* Line 1455 of yacc.c  */
4436 #line 1960 "parser.y"
4437     {(yyval.token)=FLAG_PUBLIC;;}
4438     break;
4439
4440   case 119:
4441
4442 /* Line 1455 of yacc.c  */
4443 #line 1961 "parser.y"
4444     {(yyval.token)=FLAG_PRIVATE;;}
4445     break;
4446
4447   case 120:
4448
4449 /* Line 1455 of yacc.c  */
4450 #line 1962 "parser.y"
4451     {(yyval.token)=FLAG_PROTECTED;;}
4452     break;
4453
4454   case 121:
4455
4456 /* Line 1455 of yacc.c  */
4457 #line 1963 "parser.y"
4458     {(yyval.token)=FLAG_STATIC;;}
4459     break;
4460
4461   case 122:
4462
4463 /* Line 1455 of yacc.c  */
4464 #line 1964 "parser.y"
4465     {(yyval.token)=FLAG_DYNAMIC;;}
4466     break;
4467
4468   case 123:
4469
4470 /* Line 1455 of yacc.c  */
4471 #line 1965 "parser.y"
4472     {(yyval.token)=FLAG_FINAL;;}
4473     break;
4474
4475   case 124:
4476
4477 /* Line 1455 of yacc.c  */
4478 #line 1966 "parser.y"
4479     {(yyval.token)=FLAG_OVERRIDE;;}
4480     break;
4481
4482   case 125:
4483
4484 /* Line 1455 of yacc.c  */
4485 #line 1967 "parser.y"
4486     {(yyval.token)=FLAG_NATIVE;;}
4487     break;
4488
4489   case 126:
4490
4491 /* Line 1455 of yacc.c  */
4492 #line 1968 "parser.y"
4493     {(yyval.token)=FLAG_PACKAGEINTERNAL;;}
4494     break;
4495
4496   case 127:
4497
4498 /* Line 1455 of yacc.c  */
4499 #line 1970 "parser.y"
4500     {(yyval.classinfo)=registry_getobjectclass();;}
4501     break;
4502
4503   case 128:
4504
4505 /* Line 1455 of yacc.c  */
4506 #line 1971 "parser.y"
4507     {(yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);;}
4508     break;
4509
4510   case 129:
4511
4512 /* Line 1455 of yacc.c  */
4513 #line 1973 "parser.y"
4514     {(yyval.classinfo_list)=list_new();;}
4515     break;
4516
4517   case 130:
4518
4519 /* Line 1455 of yacc.c  */
4520 #line 1974 "parser.y"
4521     {(yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);;}
4522     break;
4523
4524   case 131:
4525
4526 /* Line 1455 of yacc.c  */
4527 #line 1976 "parser.y"
4528     {(yyval.classinfo_list)=list_new();;}
4529     break;
4530
4531   case 132:
4532
4533 /* Line 1455 of yacc.c  */
4534 #line 1977 "parser.y"
4535     {(yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);;}
4536     break;
4537
4538   case 133:
4539
4540 /* Line 1455 of yacc.c  */
4541 #line 1981 "parser.y"
4542     {startclass((yyvsp[(1) - (6)].flags),(yyvsp[(3) - (6)].id),(yyvsp[(4) - (6)].classinfo),(yyvsp[(5) - (6)].classinfo_list), 0);;}
4543     break;
4544
4545   case 134:
4546
4547 /* Line 1455 of yacc.c  */
4548 #line 1983 "parser.y"
4549     {endclass();(yyval.code)=0;;}
4550     break;
4551
4552   case 135:
4553
4554 /* Line 1455 of yacc.c  */
4555 #line 1987 "parser.y"
4556     {startclass((yyvsp[(1) - (5)].flags),(yyvsp[(3) - (5)].id),0,(yyvsp[(4) - (5)].classinfo_list),1);;}
4557     break;
4558
4559   case 136:
4560
4561 /* Line 1455 of yacc.c  */
4562 #line 1989 "parser.y"
4563     {endclass();(yyval.code)=0;;}
4564     break;
4565
4566   case 144:
4567
4568 /* Line 1455 of yacc.c  */
4569 #line 2001 "parser.y"
4570     {
4571     code_t*c = state->cls->static_init;
4572     c = code_append(c, (yyvsp[(1) - (1)].code));  
4573     state->cls->static_init = c;
4574 ;}
4575     break;
4576
4577   case 150:
4578
4579 /* Line 1455 of yacc.c  */
4580 #line 2012 "parser.y"
4581     {
4582     syntaxerror("variable declarations not allowed in interfaces");
4583 ;}
4584     break;
4585
4586   case 151:
4587
4588 /* Line 1455 of yacc.c  */
4589 #line 2015 "parser.y"
4590     {
4591     (yyvsp[(1) - (8)].flags) |= FLAG_PUBLIC;
4592     if((yyvsp[(1) - (8)].flags)&(FLAG_PRIVATE|FLAG_PACKAGEINTERNAL|FLAG_PROTECTED)) {
4593         syntaxerror("invalid method modifiers: interface methods always need to be public");
4594     }
4595     startfunction(0,(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo));
4596     endfunction(0,(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo), 0);
4597 ;}
4598     break;
4599
4600   case 154:
4601
4602 /* Line 1455 of yacc.c  */
4603 #line 2028 "parser.y"
4604     {
4605     int flags = (yyvsp[(1) - (5)].flags);
4606     memberinfo_t* info = state->cls?
4607             memberinfo_register(state->cls->info, (yyvsp[(3) - (5)].id), MEMBER_SLOT):
4608             memberinfo_register_global(flags2access((yyvsp[(1) - (5)].flags)), state->package, (yyvsp[(3) - (5)].id), MEMBER_SLOT);
4609
4610     info->type = (yyvsp[(4) - (5)].classinfo);
4611     info->flags = flags;
4612
4613     /* slot name */
4614     namespace_t mname_ns = {flags2access(flags), ""};
4615     multiname_t mname = {QNAME, &mname_ns, 0, (yyvsp[(3) - (5)].id)};
4616   
4617     trait_list_t**traits;
4618     code_t**code;
4619     if(!state->cls) {
4620         // global variable
4621         traits = &global->init->traits;
4622         code = &global->init->method->body->code;
4623     } else if(flags&FLAG_STATIC) {
4624         // static variable
4625         traits = &state->cls->abc->static_traits;
4626         code = &state->cls->static_init;
4627     } else {
4628         // instance variable
4629         traits = &state->cls->abc->traits;
4630         code = &state->cls->init;
4631     }
4632     
4633     trait_t*t=0;
4634     if((yyvsp[(4) - (5)].classinfo)) {
4635         MULTINAME(m, (yyvsp[(4) - (5)].classinfo));
4636         t = trait_new_member(traits, multiname_clone(&m), multiname_clone(&mname), 0);
4637     } else {
4638         t = trait_new_member(traits, 0, multiname_clone(&mname), 0);
4639     }
4640     info->slot = t->slot_id;
4641     
4642     /* initalization code (if needed) */
4643     code_t*c = 0;
4644     if((yyvsp[(5) - (5)].value).c && !is_pushundefined((yyvsp[(5) - (5)].value).c)) {
4645         c = abc_getlocal_0(c);
4646         c = code_append(c, (yyvsp[(5) - (5)].value).c);
4647         c = converttype(c, (yyvsp[(5) - (5)].value).t, (yyvsp[(4) - (5)].classinfo));
4648         c = abc_setslot(c, t->slot_id);
4649     }
4650
4651     *code = code_append(*code, c);
4652
4653     if((yyvsp[(2) - (5)].token)==KW_CONST) {
4654         t->kind= TRAIT_CONST;
4655     }
4656
4657     (yyval.code)=0;
4658 ;}
4659     break;
4660
4661   case 155:
4662
4663 /* Line 1455 of yacc.c  */
4664 #line 2086 "parser.y"
4665     {(yyval.constant)=0;;}
4666     break;
4667
4668   case 156:
4669
4670 /* Line 1455 of yacc.c  */
4671 #line 2087 "parser.y"
4672     {(yyval.constant)=(yyvsp[(2) - (2)].constant);;}
4673     break;
4674
4675   case 157:
4676
4677 /* Line 1455 of yacc.c  */
4678 #line 2089 "parser.y"
4679     {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_uint));;}
4680     break;
4681
4682   case 158:
4683
4684 /* Line 1455 of yacc.c  */
4685 #line 2090 "parser.y"
4686     {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_int));;}
4687     break;
4688
4689   case 159:
4690
4691 /* Line 1455 of yacc.c  */
4692 #line 2091 "parser.y"
4693     {(yyval.constant) = constant_new_uint((yyvsp[(1) - (1)].number_uint));;}
4694     break;
4695
4696   case 160:
4697
4698 /* Line 1455 of yacc.c  */
4699 #line 2092 "parser.y"
4700     {(yyval.constant) = constant_new_float((yyvsp[(1) - (1)].number_float));;}
4701     break;
4702
4703   case 161:
4704
4705 /* Line 1455 of yacc.c  */
4706 #line 2093 "parser.y"
4707     {(yyval.constant) = constant_new_string2((yyvsp[(1) - (1)].str).str,(yyvsp[(1) - (1)].str).len);;}
4708     break;
4709
4710   case 162:
4711
4712 /* Line 1455 of yacc.c  */
4713 #line 2095 "parser.y"
4714     {(yyval.constant) = constant_new_true((yyvsp[(1) - (1)].token));;}
4715     break;
4716
4717   case 163:
4718
4719 /* Line 1455 of yacc.c  */
4720 #line 2096 "parser.y"
4721     {(yyval.constant) = constant_new_false((yyvsp[(1) - (1)].token));;}
4722     break;
4723
4724   case 164:
4725
4726 /* Line 1455 of yacc.c  */
4727 #line 2097 "parser.y"
4728     {(yyval.constant) = constant_new_null((yyvsp[(1) - (1)].token));;}
4729     break;
4730
4731   case 165:
4732
4733 /* Line 1455 of yacc.c  */
4734 #line 2102 "parser.y"
4735     {
4736     memset(&(yyval.params),0,sizeof((yyval.params)));
4737 ;}
4738     break;
4739
4740   case 166:
4741
4742 /* Line 1455 of yacc.c  */
4743 #line 2105 "parser.y"
4744     {
4745     (yyval.params)=(yyvsp[(1) - (1)].params);
4746 ;}
4747     break;
4748
4749   case 167:
4750
4751 /* Line 1455 of yacc.c  */
4752 #line 2110 "parser.y"
4753     {
4754     memset(&(yyval.params),0,sizeof((yyval.params)));
4755     (yyval.params).varargs=1;
4756     list_append((yyval.params).list, (yyvsp[(2) - (2)].param));
4757 ;}
4758     break;
4759
4760   case 168:
4761
4762 /* Line 1455 of yacc.c  */
4763 #line 2115 "parser.y"
4764     {
4765     (yyval.params) =(yyvsp[(1) - (4)].params);
4766     (yyval.params).varargs=1;
4767     list_append((yyval.params).list, (yyvsp[(4) - (4)].param));
4768 ;}
4769     break;
4770
4771   case 169:
4772
4773 /* Line 1455 of yacc.c  */
4774 #line 2122 "parser.y"
4775     {
4776     (yyval.params) = (yyvsp[(1) - (3)].params);
4777     list_append((yyval.params).list, (yyvsp[(3) - (3)].param));
4778 ;}
4779     break;
4780
4781   case 170:
4782
4783 /* Line 1455 of yacc.c  */
4784 #line 2126 "parser.y"
4785     {
4786     memset(&(yyval.params),0,sizeof((yyval.params)));
4787     list_append((yyval.params).list, (yyvsp[(1) - (1)].param));
4788 ;}
4789     break;
4790
4791   case 171:
4792
4793 /* Line 1455 of yacc.c  */
4794 #line 2131 "parser.y"
4795     {
4796      (yyval.param) = malloc(sizeof(param_t));
4797      (yyval.param)->name=(yyvsp[(1) - (4)].id);
4798      (yyval.param)->type = (yyvsp[(3) - (4)].classinfo);
4799      (yyval.param)->value = (yyvsp[(4) - (4)].constant);
4800 ;}
4801     break;
4802
4803   case 172:
4804
4805 /* Line 1455 of yacc.c  */
4806 #line 2137 "parser.y"
4807     {
4808      (yyval.param) = malloc(sizeof(param_t));
4809      (yyval.param)->name=(yyvsp[(1) - (2)].id);
4810      (yyval.param)->type = TYPE_ANY;
4811      (yyval.param)->value = (yyvsp[(2) - (2)].constant);
4812 ;}
4813     break;
4814
4815   case 173:
4816
4817 /* Line 1455 of yacc.c  */
4818 #line 2143 "parser.y"
4819     {(yyval.token)=(yyvsp[(1) - (1)].token);;}
4820     break;
4821
4822   case 174:
4823
4824 /* Line 1455 of yacc.c  */
4825 #line 2144 "parser.y"
4826     {(yyval.token)=(yyvsp[(1) - (1)].token);;}
4827     break;
4828
4829   case 175:
4830
4831 /* Line 1455 of yacc.c  */
4832 #line 2145 "parser.y"
4833     {(yyval.token)=0;;}
4834     break;
4835
4836   case 176:
4837
4838 /* Line 1455 of yacc.c  */
4839 #line 2148 "parser.y"
4840     {startfunction(0,(yyvsp[(1) - (9)].flags),(yyvsp[(3) - (9)].token),(yyvsp[(4) - (9)].id),&(yyvsp[(6) - (9)].params),(yyvsp[(8) - (9)].classinfo));}
4841     break;
4842
4843   case 177:
4844
4845 /* Line 1455 of yacc.c  */
4846 #line 2149 "parser.y"
4847     {
4848     code_t*c = 0;
4849     if(state->method->late_binding) {
4850         c = abc_getlocal_0(c);
4851         c = abc_pushscope(c);
4852     }
4853     if(state->method->is_constructor && !state->method->has_super) {
4854         // call default constructor
4855         c = abc_getlocal_0(c);
4856         c = abc_constructsuper(c, 0);
4857     }
4858     c = wrap_function(c, 0, (yyvsp[(11) - (12)].code));
4859     endfunction(0,(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),(yyvsp[(8) - (12)].classinfo),c);
4860     (yyval.code)=0;
4861 ;}
4862     break;
4863
4864   case 179:
4865
4866 /* Line 1455 of yacc.c  */
4867 #line 2166 "parser.y"
4868     {(yyval.id)=0;;}
4869     break;
4870
4871   case 180:
4872
4873 /* Line 1455 of yacc.c  */
4874 #line 2168 "parser.y"
4875     {
4876     syntaxerror("nested functions not supported yet");
4877 ;}
4878     break;
4879
4880   case 181:
4881
4882 /* Line 1455 of yacc.c  */
4883 #line 2175 "parser.y"
4884     {
4885
4886     /* try current package */
4887     (yyval.classinfo) = find_class((yyvsp[(1) - (1)].id));
4888     if(!(yyval.classinfo)) syntaxerror("Could not find class %s\n", (yyvsp[(1) - (1)].id));
4889 ;}
4890     break;
4891
4892   case 182:
4893
4894 /* Line 1455 of yacc.c  */
4895 #line 2182 "parser.y"
4896     {
4897     (yyval.classinfo) = registry_findclass((yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
4898     if(!(yyval.classinfo)) syntaxerror("Couldn't find class %s.%s\n", (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id));
4899     free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;
4900 ;}
4901     break;
4902
4903   case 185:
4904
4905 /* Line 1455 of yacc.c  */
4906 #line 2191 "parser.y"
4907     {(yyval.classinfo_list)=list_new();list_append((yyval.classinfo_list), (yyvsp[(1) - (1)].classinfo));;}
4908     break;
4909
4910   case 186:
4911
4912 /* Line 1455 of yacc.c  */
4913 #line 2192 "parser.y"
4914     {(yyval.classinfo_list)=(yyvsp[(1) - (3)].classinfo_list);list_append((yyval.classinfo_list),(yyvsp[(3) - (3)].classinfo));;}
4915     break;
4916
4917   case 187:
4918
4919 /* Line 1455 of yacc.c  */
4920 #line 2194 "parser.y"
4921     {(yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);;}
4922     break;
4923
4924   case 188:
4925
4926 /* Line 1455 of yacc.c  */
4927 #line 2195 "parser.y"
4928     {(yyval.classinfo)=registry_getanytype();;}
4929     break;
4930
4931   case 189:
4932
4933 /* Line 1455 of yacc.c  */
4934 #line 2196 "parser.y"
4935     {(yyval.classinfo)=registry_getanytype();;}
4936     break;
4937
4938   case 190:
4939
4940 /* Line 1455 of yacc.c  */
4941 #line 2205 "parser.y"
4942     {(yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);;}
4943     break;
4944
4945   case 191:
4946
4947 /* Line 1455 of yacc.c  */
4948 #line 2206 "parser.y"
4949     {(yyval.classinfo)=0;;}
4950     break;
4951
4952   case 192:
4953
4954 /* Line 1455 of yacc.c  */
4955 #line 2210 "parser.y"
4956     {(yyval.value_list).cc=0;(yyval.value_list).len=0;;}
4957     break;
4958
4959   case 193:
4960
4961 /* Line 1455 of yacc.c  */
4962 #line 2211 "parser.y"
4963     {(yyval.value_list)=(yyvsp[(2) - (3)].value_list);}
4964     break;
4965
4966   case 194:
4967
4968 /* Line 1455 of yacc.c  */
4969 #line 2213 "parser.y"
4970     {(yyval.value_list).cc=0;(yyval.value_list).len=0;;}
4971     break;
4972
4973   case 196:
4974
4975 /* Line 1455 of yacc.c  */
4976 #line 2215 "parser.y"
4977     {(yyval.value_list).len=1;
4978                                                   (yyval.value_list).cc = (yyvsp[(1) - (1)].value).c;
4979                                                  ;}
4980     break;
4981
4982   case 197:
4983
4984 /* Line 1455 of yacc.c  */
4985 #line 2218 "parser.y"
4986     {
4987                                                   (yyval.value_list).len= (yyvsp[(1) - (3)].value_list).len+1;
4988                                                   (yyval.value_list).cc = code_append((yyvsp[(1) - (3)].value_list).cc, (yyvsp[(3) - (3)].value).c);
4989                                                   ;}
4990     break;
4991
4992   case 198:
4993
4994 /* Line 1455 of yacc.c  */
4995 #line 2223 "parser.y"
4996     {
4997     MULTINAME(m, (yyvsp[(2) - (3)].classinfo));
4998     (yyval.value).c = code_new();
4999
5000     if((yyvsp[(2) - (3)].classinfo)->slot) {
5001         (yyval.value).c = abc_getglobalscope((yyval.value).c);
5002         (yyval.value).c = abc_getslot((yyval.value).c, (yyvsp[(2) - (3)].classinfo)->slot);
5003     } else {
5004         (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
5005     }
5006
5007     (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (3)].value_list).cc);
5008
5009     if((yyvsp[(2) - (3)].classinfo)->slot)
5010         (yyval.value).c = abc_construct((yyval.value).c, (yyvsp[(3) - (3)].value_list).len);
5011     else
5012         (yyval.value).c = abc_constructprop2((yyval.value).c, &m, (yyvsp[(3) - (3)].value_list).len);
5013     (yyval.value).t = (yyvsp[(2) - (3)].classinfo);
5014 ;}
5015     break;
5016
5017   case 199:
5018
5019 /* Line 1455 of yacc.c  */
5020 #line 2247 "parser.y"
5021     {
5022     
5023     (yyval.value).c = (yyvsp[(1) - (4)].value).c;
5024     if((yyval.value).c->opcode == OPCODE_COERCE_A) {
5025         (yyval.value).c = code_cutlast((yyval.value).c);
5026     }
5027     code_t*paramcode = (yyvsp[(3) - (4)].value_list).cc;
5028
5029     (yyval.value).t = TYPE_ANY;
5030     if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
5031         multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
5032         (yyval.value).c = code_cutlast((yyval.value).c);
5033         (yyval.value).c = code_append((yyval.value).c, paramcode);
5034         (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).len);
5035         multiname_destroy(name);
5036     } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
5037         int slot = (int)(ptroff_t)(yyval.value).c->data[0];
5038         trait_t*t = abc_class_find_slotid(state->cls->abc,slot);//FIXME
5039         if(t->kind!=TRAIT_METHOD) {
5040             //ok: flash allows to assign closures to members.
5041         }
5042         multiname_t*name = t->name;
5043         (yyval.value).c = code_cutlast((yyval.value).c);
5044         (yyval.value).c = code_append((yyval.value).c, paramcode);
5045         //$$.c = abc_callmethod($$.c, t->method, len); //#1051 illegal early access binding
5046         (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).len);
5047     } else if((yyval.value).c->opcode == OPCODE_GETSUPER) {
5048         multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0;
5049         (yyval.value).c = code_cutlast((yyval.value).c);
5050         (yyval.value).c = code_append((yyval.value).c, paramcode);
5051         (yyval.value).c = abc_callsuper2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).len);
5052         multiname_destroy(name);
5053     } else {
5054         (yyval.value).c = abc_getlocal_0((yyval.value).c);
5055         (yyval.value).c = code_append((yyval.value).c, paramcode);
5056         (yyval.value).c = abc_call((yyval.value).c, (yyvsp[(3) - (4)].value_list).len);
5057     }
5058    
5059     memberinfo_t*f = 0;
5060    
5061     if(TYPE_IS_FUNCTION((yyvsp[(1) - (4)].value).t) && (yyvsp[(1) - (4)].value).t->function) {
5062         (yyval.value).t = (yyvsp[(1) - (4)].value).t->function->return_type;
5063     } else {
5064         (yyval.value).c = abc_coerce_a((yyval.value).c);
5065         (yyval.value).t = TYPE_ANY;
5066     }
5067
5068 ;}
5069     break;
5070
5071   case 200:
5072
5073 /* Line 1455 of yacc.c  */
5074 #line 2295 "parser.y"
5075     {
5076     if(!state->cls) syntaxerror("super() not allowed outside of a class");
5077     if(!state->method) syntaxerror("super() not allowed outside of a function");
5078     if(!state->method->is_constructor) syntaxerror("super() not allowed outside of a constructor");
5079
5080     (yyval.value).c = code_new();
5081     (yyval.value).c = abc_getlocal_0((yyval.value).c);
5082
5083     (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value_list).cc);
5084     /*
5085     this is dependent on the control path, check this somewhere else
5086     if(state->method->has_super)
5087         syntaxerror("constructor may call super() only once");
5088     */
5089     state->method->has_super = 1;
5090     (yyval.value).c = abc_constructsuper((yyval.value).c, (yyvsp[(3) - (4)].value_list).len);
5091     (yyval.value).c = abc_pushundefined((yyval.value).c);
5092     (yyval.value).t = TYPE_ANY;
5093 ;}
5094     break;
5095
5096   case 201:
5097
5098 /* Line 1455 of yacc.c  */
5099 #line 2315 "parser.y"
5100     {
5101     (yyval.value).c = (yyvsp[(2) - (2)].value).c;
5102     if((yyval.value).c->opcode == OPCODE_COERCE_A) {
5103         (yyval.value).c = code_cutlast((yyval.value).c);
5104     }
5105     multiname_t*name = 0;
5106     if((yyval.value).c->opcode == OPCODE_GETPROPERTY) {
5107         (yyval.value).c->opcode = OPCODE_DELETEPROPERTY;
5108     } else if((yyval.value).c->opcode == OPCODE_GETSLOT) {
5109         int slot = (int)(ptroff_t)(yyval.value).c->data[0];
5110         multiname_t*name = abc_class_find_slotid(state->cls->abc,slot)->name;
5111         (yyval.value).c = code_cutlast((yyval.value).c);
5112         (yyval.value).c = abc_deleteproperty2((yyval.value).c, name);
5113     } else {
5114         (yyval.value).c = abc_getlocal_0((yyval.value).c);
5115         MULTINAME_LATE(m, (yyvsp[(2) - (2)].value).t?(yyvsp[(2) - (2)].value).t->access:ACCESS_PACKAGE, "");
5116         (yyval.value).c = abc_deleteproperty2((yyval.value).c, &m);
5117     }
5118     (yyval.value).t = TYPE_BOOLEAN;
5119 ;}
5120     break;
5121
5122   case 202:
5123
5124 /* Line 1455 of yacc.c  */
5125 #line 2336 "parser.y"
5126     {
5127     (yyval.code) = abc_returnvoid(0);
5128 ;}
5129     break;
5130
5131   case 203:
5132
5133 /* Line 1455 of yacc.c  */
5134 #line 2339 "parser.y"
5135     {
5136     (yyval.code) = (yyvsp[(2) - (2)].value).c;
5137     (yyval.code) = abc_returnvalue((yyval.code));
5138 ;}
5139     break;
5140
5141   case 204:
5142
5143 /* Line 1455 of yacc.c  */
5144 #line 2346 "parser.y"
5145     {(yyval.value)=(yyvsp[(1) - (1)].value);;}
5146     break;
5147
5148   case 205:
5149
5150 /* Line 1455 of yacc.c  */
5151 #line 2347 "parser.y"
5152     {(yyval.value) = (yyvsp[(1) - (1)].value);;}
5153     break;
5154
5155   case 206:
5156
5157 /* Line 1455 of yacc.c  */
5158 #line 2348 "parser.y"
5159     {
5160     (yyval.value).c = (yyvsp[(1) - (3)].value).c;
5161     (yyval.value).c = cut_last_push((yyval.value).c);
5162     (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
5163     (yyval.value).t = (yyvsp[(3) - (3)].value).t;
5164 ;}
5165     break;
5166
5167   case 207:
5168
5169 /* Line 1455 of yacc.c  */
5170 #line 2354 "parser.y"
5171     {
5172     (yyval.code)=cut_last_push((yyvsp[(1) - (1)].value).c);
5173 ;}
5174     break;
5175
5176   case 208:
5177
5178 /* Line 1455 of yacc.c  */
5179 #line 2360 "parser.y"
5180     {(yyval.value) = (yyvsp[(1) - (1)].value);;}
5181     break;
5182
5183   case 210:
5184
5185 /* Line 1455 of yacc.c  */
5186 #line 2364 "parser.y"
5187     {(yyval.value) = (yyvsp[(1) - (1)].value);;}
5188     break;
5189
5190   case 211:
5191
5192 /* Line 1455 of yacc.c  */
5193 #line 2366 "parser.y"
5194     {(yyval.value) = (yyvsp[(1) - (1)].value);;}
5195     break;
5196
5197   case 212:
5198
5199 /* Line 1455 of yacc.c  */
5200 #line 2368 "parser.y"
5201     {(yyval.value) = (yyvsp[(1) - (1)].value);;}
5202     break;
5203
5204   case 213:
5205
5206 /* Line 1455 of yacc.c  */
5207 #line 2370 "parser.y"
5208     {
5209     (yyval.value).c = 0;
5210     namespace_t ns = {ACCESS_PACKAGE, ""};
5211     multiname_t m = {QNAME, &ns, 0, "RegExp"};
5212     if(!(yyvsp[(1) - (1)].regexp).options) {
5213         (yyval.value).c = abc_getlex2((yyval.value).c, &m);
5214         (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern);
5215         (yyval.value).c = abc_construct((yyval.value).c, 1);
5216     } else {
5217         (yyval.value).c = abc_getlex2((yyval.value).c, &m);
5218         (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern);
5219         (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).options);
5220         (yyval.value).c = abc_construct((yyval.value).c, 2);
5221     }
5222     (yyval.value).t = TYPE_REGEXP;
5223 ;}
5224     break;
5225
5226   case 214:
5227
5228 /* Line 1455 of yacc.c  */
5229 #line 2387 "parser.y"
5230     {(yyval.value).c = abc_pushbyte(0, (yyvsp[(1) - (1)].number_uint));
5231                    //MULTINAME(m, registry_getintclass());
5232                    //$$.c = abc_coerce2($$.c, &m); // FIXME
5233                    (yyval.value).t = TYPE_INT;
5234                   ;}
5235     break;
5236
5237   case 215:
5238
5239 /* Line 1455 of yacc.c  */
5240 #line 2392 "parser.y"
5241     {(yyval.value).c = abc_pushshort(0, (yyvsp[(1) - (1)].number_uint));
5242                     (yyval.value).t = TYPE_INT;
5243                    ;}
5244     break;
5245
5246   case 216:
5247
5248 /* Line 1455 of yacc.c  */
5249 #line 2395 "parser.y"
5250     {(yyval.value).c = abc_pushint(0, (yyvsp[(1) - (1)].number_int));
5251                   (yyval.value).t = TYPE_INT;
5252                  ;}
5253     break;
5254
5255   case 217:
5256
5257 /* Line 1455 of yacc.c  */
5258 #line 2398 "parser.y"
5259     {(yyval.value).c = abc_pushuint(0, (yyvsp[(1) - (1)].number_uint));
5260                    (yyval.value).t = TYPE_UINT;
5261                   ;}
5262     break;
5263
5264   case 218:
5265
5266 /* Line 1455 of yacc.c  */
5267 #line 2401 "parser.y"
5268     {(yyval.value).c = abc_pushdouble(0, (yyvsp[(1) - (1)].number_float));
5269                     (yyval.value).t = TYPE_FLOAT;
5270                    ;}
5271     break;
5272
5273   case 219:
5274
5275 /* Line 1455 of yacc.c  */
5276 #line 2404 "parser.y"
5277     {(yyval.value).c = abc_pushstring2(0, &(yyvsp[(1) - (1)].str));
5278                      (yyval.value).t = TYPE_STRING;
5279                     ;}
5280     break;
5281
5282   case 220:
5283
5284 /* Line 1455 of yacc.c  */
5285 #line 2407 "parser.y"
5286     {(yyval.value).c = abc_pushundefined(0);
5287                     (yyval.value).t = TYPE_ANY;
5288                    ;}
5289     break;
5290
5291   case 221:
5292
5293 /* Line 1455 of yacc.c  */
5294 #line 2410 "parser.y"
5295     {(yyval.value).c = abc_pushtrue(0);
5296                     (yyval.value).t = TYPE_BOOLEAN;
5297                    ;}
5298     break;
5299
5300   case 222:
5301
5302 /* Line 1455 of yacc.c  */
5303 #line 2413 "parser.y"
5304     {(yyval.value).c = abc_pushfalse(0);
5305                      (yyval.value).t = TYPE_BOOLEAN;
5306                     ;}
5307     break;
5308
5309   case 223:
5310
5311 /* Line 1455 of yacc.c  */
5312 #line 2416 "parser.y"
5313     {(yyval.value).c = abc_pushnull(0);
5314                     (yyval.value).t = TYPE_NULL;
5315                    ;}
5316     break;
5317
5318   case 225:
5319
5320 /* Line 1455 of yacc.c  */
5321 #line 2421 "parser.y"
5322     {(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);
5323              (yyval.value).t = TYPE_BOOLEAN;
5324             ;}
5325     break;
5326
5327   case 226:
5328
5329 /* Line 1455 of yacc.c  */
5330 #line 2424 "parser.y"
5331     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterthan((yyval.value).c);
5332              (yyval.value).t = TYPE_BOOLEAN;
5333             ;}
5334     break;
5335
5336   case 227:
5337
5338 /* Line 1455 of yacc.c  */
5339 #line 2427 "parser.y"
5340     {(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);
5341               (yyval.value).t = TYPE_BOOLEAN;
5342              ;}
5343     break;
5344
5345   case 228:
5346
5347 /* Line 1455 of yacc.c  */
5348 #line 2430 "parser.y"
5349     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterequals((yyval.value).c);
5350               (yyval.value).t = TYPE_BOOLEAN;
5351              ;}
5352     break;
5353
5354   case 229:
5355
5356 /* Line 1455 of yacc.c  */
5357 #line 2433 "parser.y"
5358     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_equals((yyval.value).c);
5359               (yyval.value).t = TYPE_BOOLEAN;
5360              ;}
5361     break;
5362
5363   case 230:
5364
5365 /* Line 1455 of yacc.c  */
5366 #line 2436 "parser.y"
5367     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_strictequals((yyval.value).c);
5368               (yyval.value).t = TYPE_BOOLEAN;
5369               ;}
5370     break;
5371
5372   case 231:
5373
5374 /* Line 1455 of yacc.c  */
5375 #line 2439 "parser.y"
5376     {(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);
5377               (yyval.value).t = TYPE_BOOLEAN;
5378              ;}
5379     break;
5380
5381   case 232:
5382
5383 /* Line 1455 of yacc.c  */
5384 #line 2442 "parser.y"
5385     {(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);
5386               (yyval.value).t = TYPE_BOOLEAN;
5387              ;}
5388     break;
5389
5390   case 233:
5391
5392 /* Line 1455 of yacc.c  */
5393 #line 2446 "parser.y"
5394     {(yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'O');
5395               (yyval.value).c = (yyvsp[(1) - (3)].value).c;
5396               (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t);
5397               (yyval.value).c = abc_dup((yyval.value).c);
5398               code_t*jmp = (yyval.value).c = abc_iftrue((yyval.value).c, 0);
5399               (yyval.value).c = cut_last_push((yyval.value).c);
5400               (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
5401               (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t);
5402               code_t*label = (yyval.value).c = abc_label((yyval.value).c);
5403               jmp->branch = label;
5404              ;}
5405     break;
5406
5407   case 234:
5408
5409 /* Line 1455 of yacc.c  */
5410 #line 2457 "parser.y"
5411     {
5412               (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'A');
5413               /*printf("%08x:\n",$1.t);
5414               code_dump($1.c, 0, 0, "", stdout);
5415               printf("%08x:\n",$3.t);
5416               code_dump($3.c, 0, 0, "", stdout);
5417               printf("joining %08x and %08x to %08x\n", $1.t, $3.t, $$.t);*/
5418               (yyval.value).c = (yyvsp[(1) - (3)].value).c;
5419               (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t);
5420               (yyval.value).c = abc_dup((yyval.value).c);
5421               code_t*jmp = (yyval.value).c = abc_iffalse((yyval.value).c, 0);
5422               (yyval.value).c = cut_last_push((yyval.value).c);
5423               (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c);
5424               (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t);
5425               code_t*label = (yyval.value).c = abc_label((yyval.value).c);
5426               jmp->branch = label;              
5427              ;}
5428     break;
5429
5430   case 235:
5431
5432 /* Line 1455 of yacc.c  */
5433 #line 2475 "parser.y"
5434     {(yyval.value).c=(yyvsp[(2) - (2)].value).c;
5435               (yyval.value).c = abc_not((yyval.value).c);
5436               (yyval.value).t = TYPE_BOOLEAN;
5437              ;}
5438     break;
5439
5440   case 236:
5441
5442 /* Line 1455 of yacc.c  */
5443 #line 2480 "parser.y"
5444     {(yyval.value).c=(yyvsp[(2) - (2)].value).c;
5445               (yyval.value).c = abc_bitnot((yyval.value).c);
5446               (yyval.value).t = TYPE_INT;
5447              ;}
5448     break;
5449
5450   case 237:
5451
5452 /* Line 1455 of yacc.c  */
5453 #line 2485 "parser.y"
5454     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
5455              (yyval.value).c = abc_bitand((yyval.value).c);
5456              (yyval.value).t = TYPE_INT;
5457             ;}
5458     break;
5459
5460   case 238:
5461
5462 /* Line 1455 of yacc.c  */
5463 #line 2490 "parser.y"
5464     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
5465              (yyval.value).c = abc_bitxor((yyval.value).c);
5466              (yyval.value).t = TYPE_INT;
5467             ;}
5468     break;
5469
5470   case 239:
5471
5472 /* Line 1455 of yacc.c  */
5473 #line 2495 "parser.y"
5474     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
5475              (yyval.value).c = abc_bitor((yyval.value).c);
5476              (yyval.value).t = TYPE_INT;
5477             ;}
5478     break;
5479
5480   case 240:
5481
5482 /* Line 1455 of yacc.c  */
5483 #line 2500 "parser.y"
5484     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
5485              (yyval.value).c = abc_rshift((yyval.value).c);
5486              (yyval.value).t = TYPE_INT;
5487             ;}
5488     break;
5489
5490   case 241:
5491
5492 /* Line 1455 of yacc.c  */
5493 #line 2504 "parser.y"
5494     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
5495              (yyval.value).c = abc_urshift((yyval.value).c);
5496              (yyval.value).t = TYPE_INT;
5497             ;}
5498     break;
5499
5500   case 242:
5501
5502 /* Line 1455 of yacc.c  */
5503 #line 2508 "parser.y"
5504     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
5505              (yyval.value).c = abc_lshift((yyval.value).c);
5506              (yyval.value).t = TYPE_INT;
5507             ;}
5508     break;
5509
5510   case 243:
5511
5512 /* Line 1455 of yacc.c  */
5513 #line 2513 "parser.y"
5514     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
5515              (yyval.value).c = abc_divide((yyval.value).c);
5516              (yyval.value).t = TYPE_NUMBER;
5517             ;}
5518     break;
5519
5520   case 244:
5521
5522 /* Line 1455 of yacc.c  */
5523 #line 2517 "parser.y"
5524     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
5525              (yyval.value).c = abc_modulo((yyval.value).c);
5526              (yyval.value).t = TYPE_NUMBER;
5527             ;}
5528     break;
5529
5530   case 245:
5531
5532 /* Line 1455 of yacc.c  */
5533 #line 2521 "parser.y"
5534     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
5535              if(BOTH_INT((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t)) {
5536                 (yyval.value).c = abc_add_i((yyval.value).c);
5537                 (yyval.value).t = TYPE_INT;
5538              } else {
5539                 (yyval.value).c = abc_add((yyval.value).c);
5540                 (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t,'+');
5541              }
5542             ;}
5543     break;
5544
5545   case 246:
5546
5547 /* Line 1455 of yacc.c  */
5548 #line 2530 "parser.y"
5549     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
5550              if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
5551                 (yyval.value).c = abc_subtract_i((yyval.value).c);
5552                 (yyval.value).t = TYPE_INT;
5553              } else {
5554                 (yyval.value).c = abc_subtract((yyval.value).c);
5555                 (yyval.value).t = TYPE_NUMBER;
5556              }
5557             ;}
5558     break;
5559
5560   case 247:
5561
5562 /* Line 1455 of yacc.c  */
5563 #line 2539 "parser.y"
5564     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
5565              if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
5566                 (yyval.value).c = abc_multiply_i((yyval.value).c);
5567                 (yyval.value).t = TYPE_INT;
5568              } else {
5569                 (yyval.value).c = abc_multiply((yyval.value).c);
5570                 (yyval.value).t = TYPE_NUMBER;
5571              }
5572             ;}
5573     break;
5574
5575   case 248:
5576
5577 /* Line 1455 of yacc.c  */
5578 #line 2549 "parser.y"
5579     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);
5580               (yyval.value).c = abc_in((yyval.value).c);
5581               (yyval.value).t = TYPE_BOOLEAN;
5582              ;}
5583     break;
5584
5585   case 249:
5586
5587 /* Line 1455 of yacc.c  */
5588 #line 2554 "parser.y"
5589     {char use_astype=0; // flash player's astype works differently than astypelate
5590               if(use_astype && TYPE_IS_CLASS((yyvsp[(3) - (3)].value).t)) {
5591                 MULTINAME(m,(yyvsp[(3) - (3)].value).t->cls);
5592                 (yyval.value).c = abc_astype2((yyvsp[(1) - (3)].value).c, &m);
5593                 (yyval.value).t = (yyvsp[(3) - (3)].value).t->cls;
5594               } else {
5595                 (yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
5596                 (yyval.value).c = abc_astypelate((yyval.value).c);
5597                 (yyval.value).t = TYPE_ANY;
5598               }
5599              ;}
5600     break;
5601
5602   case 250:
5603
5604 /* Line 1455 of yacc.c  */
5605 #line 2567 "parser.y"
5606     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
5607               (yyval.value).c = abc_instanceof((yyval.value).c);
5608               (yyval.value).t = TYPE_BOOLEAN;
5609              ;}
5610     break;
5611
5612   case 251:
5613
5614 /* Line 1455 of yacc.c  */
5615 #line 2572 "parser.y"
5616     {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c);
5617               (yyval.value).c = abc_istypelate((yyval.value).c);
5618               (yyval.value).t = TYPE_BOOLEAN;
5619              ;}
5620     break;
5621
5622   case 252:
5623
5624 /* Line 1455 of yacc.c  */
5625 #line 2577 "parser.y"
5626     {
5627               (yyval.value).c = (yyvsp[(3) - (4)].value).c;
5628               (yyval.value).c = abc_typeof((yyval.value).c);
5629               (yyval.value).t = TYPE_STRING;
5630              ;}
5631     break;
5632
5633   case 253:
5634
5635 /* Line 1455 of yacc.c  */
5636 #line 2583 "parser.y"
5637     {
5638               (yyval.value).c = cut_last_push((yyvsp[(2) - (2)].value).c);
5639               (yyval.value).c = abc_pushundefined((yyval.value).c);
5640               (yyval.value).t = TYPE_ANY;
5641              ;}
5642     break;
5643
5644   case 254:
5645
5646 /* Line 1455 of yacc.c  */
5647 #line 2589 "parser.y"
5648     { (yyval.value).c = abc_pushundefined(0);
5649              (yyval.value).t = TYPE_ANY;
5650            ;}
5651     break;
5652
5653   case 255:
5654
5655 /* Line 1455 of yacc.c  */
5656 #line 2593 "parser.y"
5657     {(yyval.value)=(yyvsp[(2) - (3)].value);;}
5658     break;
5659
5660   case 256:
5661
5662 /* Line 1455 of yacc.c  */
5663 #line 2595 "parser.y"
5664     {
5665   (yyval.value)=(yyvsp[(2) - (2)].value);
5666   if(IS_INT((yyvsp[(2) - (2)].value).t)) {
5667    (yyval.value).c=abc_negate_i((yyval.value).c);
5668    (yyval.value).t = TYPE_INT;
5669   } else {
5670    (yyval.value).c=abc_negate((yyval.value).c);
5671    (yyval.value).t = TYPE_NUMBER;
5672   }
5673 ;}
5674     break;
5675
5676   case 257:
5677
5678 /* Line 1455 of yacc.c  */
5679 #line 2606 "parser.y"
5680     {
5681   (yyval.value).c = (yyvsp[(1) - (4)].value).c;
5682   (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value).c);
5683  
5684   MULTINAME_LATE(m, (yyvsp[(1) - (4)].value).t?(yyvsp[(1) - (4)].value).t->access:ACCESS_PACKAGE, "");
5685   (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
5686   (yyval.value).t = 0; // array elements have unknown type
5687 ;}
5688     break;
5689
5690   case 258:
5691
5692 /* Line 1455 of yacc.c  */
5693 #line 2615 "parser.y"
5694     {
5695     (yyval.value).c = code_new();
5696     (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc);
5697     (yyval.value).c = abc_newarray((yyval.value).c, (yyvsp[(2) - (3)].value_list).len);
5698     (yyval.value).t = registry_getarrayclass();
5699 ;}
5700     break;
5701
5702   case 259:
5703
5704 /* Line 1455 of yacc.c  */
5705 #line 2622 "parser.y"
5706     {(yyval.value_list).cc=0;(yyval.value_list).len=0;;}
5707     break;
5708
5709   case 260:
5710
5711 /* Line 1455 of yacc.c  */
5712 #line 2623 "parser.y"
5713     {(yyval.value_list)=(yyvsp[(1) - (1)].value_list);}
5714     break;
5715
5716   case 261:
5717
5718 /* Line 1455 of yacc.c  */
5719 #line 2625 "parser.y"
5720     {
5721     (yyval.value_list).cc = 0;
5722     (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(1) - (3)].value).c);
5723     (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (3)].value).c);
5724     (yyval.value_list).len = 2;
5725 ;}
5726     break;
5727
5728   case 262:
5729
5730 /* Line 1455 of yacc.c  */
5731 #line 2631 "parser.y"
5732     {
5733     (yyval.value_list).cc = (yyvsp[(1) - (5)].value_list).cc;
5734     (yyval.value_list).len = (yyvsp[(1) - (5)].value_list).len+2;
5735     (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (5)].value).c);
5736     (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(5) - (5)].value).c);
5737 ;}
5738     break;
5739
5740   case 263:
5741
5742 /* Line 1455 of yacc.c  */
5743 #line 2640 "parser.y"
5744     {
5745     (yyval.value).c = code_new();
5746     (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc);
5747     (yyval.value).c = abc_newobject((yyval.value).c, (yyvsp[(2) - (3)].value_list).len/2);
5748     (yyval.value).t = registry_getobjectclass();
5749 ;}
5750     break;
5751
5752   case 264:
5753
5754 /* Line 1455 of yacc.c  */
5755 #line 2647 "parser.y"
5756     { 
5757                code_t*c = (yyvsp[(3) - (3)].value).c;
5758                if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) {
5759                 c=abc_multiply_i(c);
5760                } else {
5761                 c=abc_multiply(c);
5762                }
5763                c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '*'), (yyvsp[(1) - (3)].value).t);
5764                (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
5765                (yyval.value).t = (yyvsp[(1) - (3)].value).t;
5766               ;}
5767     break;
5768
5769   case 265:
5770
5771 /* Line 1455 of yacc.c  */
5772 #line 2659 "parser.y"
5773     { 
5774                code_t*c = abc_modulo((yyvsp[(3) - (3)].value).c);
5775                c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '%'), (yyvsp[(1) - (3)].value).t);
5776                (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
5777                (yyval.value).t = (yyvsp[(1) - (3)].value).t;
5778               ;}
5779     break;
5780
5781   case 266:
5782
5783 /* Line 1455 of yacc.c  */
5784 #line 2665 "parser.y"
5785     { 
5786                code_t*c = abc_lshift((yyvsp[(3) - (3)].value).c);
5787                c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '<'), (yyvsp[(1) - (3)].value).t);
5788                (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
5789                (yyval.value).t = (yyvsp[(1) - (3)].value).t;
5790               ;}
5791     break;
5792
5793   case 267:
5794
5795 /* Line 1455 of yacc.c  */
5796 #line 2671 "parser.y"
5797     { 
5798                code_t*c = abc_rshift((yyvsp[(3) - (3)].value).c);
5799                c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '>'), (yyvsp[(1) - (3)].value).t);
5800                (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
5801                (yyval.value).t = (yyvsp[(1) - (3)].value).t;
5802               ;}
5803     break;
5804
5805   case 268:
5806
5807 /* Line 1455 of yacc.c  */
5808 #line 2677 "parser.y"
5809     { 
5810                code_t*c = abc_urshift((yyvsp[(3) - (3)].value).c);
5811                c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'U'), (yyvsp[(1) - (3)].value).t);
5812                (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
5813                (yyval.value).t = (yyvsp[(1) - (3)].value).t;
5814               ;}
5815     break;
5816
5817   case 269:
5818
5819 /* Line 1455 of yacc.c  */
5820 #line 2683 "parser.y"
5821     { 
5822                code_t*c = abc_divide((yyvsp[(3) - (3)].value).c);
5823                c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '/'), (yyvsp[(1) - (3)].value).t);
5824                (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
5825                (yyval.value).t = (yyvsp[(1) - (3)].value).t;
5826               ;}
5827     break;
5828
5829   case 270:
5830
5831 /* Line 1455 of yacc.c  */
5832 #line 2689 "parser.y"
5833     { 
5834                code_t*c = abc_bitor((yyvsp[(3) - (3)].value).c);
5835                c=converttype(c, TYPE_INT, (yyvsp[(1) - (3)].value).t);
5836                (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
5837                (yyval.value).t = (yyvsp[(1) - (3)].value).t;
5838               ;}
5839     break;
5840
5841   case 271:
5842
5843 /* Line 1455 of yacc.c  */
5844 #line 2695 "parser.y"
5845     { 
5846                code_t*c = (yyvsp[(3) - (3)].value).c;
5847
5848                if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) {
5849                 c=abc_add_i(c);
5850                } else {
5851                 c=abc_add(c);
5852                 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '+'), (yyvsp[(1) - (3)].value).t);
5853                }
5854                
5855                (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
5856                (yyval.value).t = (yyvsp[(1) - (3)].value).t;
5857               ;}
5858     break;
5859
5860   case 272:
5861
5862 /* Line 1455 of yacc.c  */
5863 #line 2708 "parser.y"
5864     { code_t*c = (yyvsp[(3) - (3)].value).c; 
5865                if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) {
5866                 c=abc_subtract_i(c);
5867                } else {
5868                 c=abc_subtract(c);
5869                 c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '-'), (yyvsp[(1) - (3)].value).t);
5870                }
5871                
5872                (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0);
5873                (yyval.value).t = (yyvsp[(1) - (3)].value).t;
5874              ;}
5875     break;
5876
5877   case 273:
5878
5879 /* Line 1455 of yacc.c  */
5880 #line 2719 "parser.y"
5881     { code_t*c = 0;
5882               c = code_append(c, (yyvsp[(3) - (3)].value).c);
5883               c = converttype(c, (yyvsp[(3) - (3)].value).t, (yyvsp[(1) - (3)].value).t);
5884               (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 1, 0);
5885               (yyval.value).t = (yyvsp[(1) - (3)].value).t;
5886             ;}
5887     break;
5888
5889   case 274:
5890
5891 /* Line 1455 of yacc.c  */
5892 #line 2726 "parser.y"
5893     { 
5894               (yyval.value).t = join_types((yyvsp[(3) - (5)].value).t,(yyvsp[(5) - (5)].value).t,'?');
5895               (yyval.value).c = (yyvsp[(1) - (5)].value).c;
5896               code_t*j1 = (yyval.value).c = abc_iffalse((yyval.value).c, 0);
5897               (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (5)].value).c);
5898               (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (5)].value).t, (yyval.value).t);
5899               code_t*j2 = (yyval.value).c = abc_jump((yyval.value).c, 0);
5900               (yyval.value).c = j1->branch = abc_label((yyval.value).c);
5901               (yyval.value).c = code_append((yyval.value).c, (yyvsp[(5) - (5)].value).c);
5902               (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (5)].value).t, (yyval.value).t);
5903               (yyval.value).c = j2->branch = abc_label((yyval.value).c);
5904             ;}
5905     break;
5906
5907   case 275:
5908
5909 /* Line 1455 of yacc.c  */
5910 #line 2739 "parser.y"
5911     { code_t*c = 0;
5912              classinfo_t*type = (yyvsp[(1) - (2)].value).t;
5913              if((is_getlocal((yyvsp[(1) - (2)].value).c) && TYPE_IS_INT((yyvsp[(1) - (2)].value).t)) || TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t)) {
5914                  int nr = getlocalnr((yyvsp[(1) - (2)].value).c);
5915                  code_free((yyvsp[(1) - (2)].value).c);(yyvsp[(1) - (2)].value).c=0;
5916                  if(TYPE_IS_INT((yyvsp[(1) - (2)].value).t)) {
5917                     (yyval.value).c = abc_getlocal(0, nr);
5918                     (yyval.value).c = abc_inclocal_i((yyval.value).c, nr);
5919                  } else if(TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t)) {
5920                     (yyval.value).c = abc_getlocal(0, nr);
5921                     (yyval.value).c = abc_inclocal((yyval.value).c, nr);
5922                  } else syntaxerror("internal error");
5923              } else {
5924                  if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
5925                      c=abc_increment_i(c);
5926                      type = TYPE_INT;
5927                  } else {
5928                      c=abc_increment(c);
5929                      type = TYPE_NUMBER;
5930                  }
5931                  c=converttype(c, type, (yyvsp[(1) - (2)].value).t);
5932                  (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1);
5933                  (yyval.value).t = (yyvsp[(1) - (2)].value).t;
5934              }
5935            ;}
5936     break;
5937
5938   case 276:
5939
5940 /* Line 1455 of yacc.c  */
5941 #line 2766 "parser.y"
5942     { code_t*c = 0;
5943              classinfo_t*type = (yyvsp[(1) - (2)].value).t;
5944              if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
5945                  c=abc_decrement_i(c);
5946                  type = TYPE_INT;
5947              } else {
5948                  c=abc_decrement(c);
5949                  type = TYPE_NUMBER;
5950              }
5951              c=converttype(c, type, (yyvsp[(1) - (2)].value).t);
5952              (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1);
5953              (yyval.value).t = (yyvsp[(1) - (2)].value).t;
5954             ;}
5955     break;
5956
5957   case 277:
5958
5959 /* Line 1455 of yacc.c  */
5960 #line 2780 "parser.y"
5961     { code_t*c = 0;
5962              classinfo_t*type = (yyvsp[(2) - (2)].value).t;
5963              if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
5964                  c=abc_increment_i(c);
5965                  type = TYPE_INT;
5966              } else {
5967                  c=abc_increment(c);
5968                  type = TYPE_NUMBER;
5969              }
5970              c=converttype(c, type, (yyvsp[(2) - (2)].value).t);
5971              (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0);
5972              (yyval.value).t = (yyvsp[(2) - (2)].value).t;
5973            ;}
5974     break;
5975
5976   case 278:
5977
5978 /* Line 1455 of yacc.c  */
5979 #line 2794 "parser.y"
5980     { code_t*c = 0;
5981              classinfo_t*type = (yyvsp[(2) - (2)].value).t;
5982              if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) {
5983                  c=abc_decrement_i(c);
5984                  type = TYPE_INT;
5985              } else {
5986                  c=abc_decrement(c);
5987                  type = TYPE_NUMBER;
5988              }
5989              c=converttype(c, type, (yyvsp[(2) - (2)].value).t);
5990              (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0);
5991              (yyval.value).t = (yyvsp[(2) - (2)].value).t;
5992            ;}
5993     break;
5994
5995   case 279:
5996
5997 /* Line 1455 of yacc.c  */
5998 #line 2809 "parser.y"
5999     { if(!state->cls->info)
6000                   syntaxerror("super keyword not allowed outside a class");
6001               classinfo_t*t = state->cls->info->superclass;
6002               if(!t) t = TYPE_OBJECT;
6003
6004               memberinfo_t*f = registry_findmember(t, (yyvsp[(3) - (3)].id), 1);
6005               namespace_t ns = flags2namespace(f->flags, "");
6006               MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
6007               (yyval.value).c = 0;
6008               (yyval.value).c = abc_getlocal_0((yyval.value).c);
6009               (yyval.value).c = abc_getsuper2((yyval.value).c, &m);
6010               (yyval.value).t = memberinfo_gettype(f);
6011            ;}
6012     break;
6013
6014   case 280:
6015
6016 /* Line 1455 of yacc.c  */
6017 #line 2824 "parser.y"
6018     {(yyval.value).c = (yyvsp[(1) - (3)].value).c;
6019              classinfo_t*t = (yyvsp[(1) - (3)].value).t;
6020              char is_static = 0;
6021              if(TYPE_IS_CLASS(t) && t->cls) {
6022                  t = t->cls;
6023                  is_static = 1;
6024              }
6025              if(t) {
6026                  memberinfo_t*f = registry_findmember(t, (yyvsp[(3) - (3)].id), 1);
6027                  char noslot = 0;
6028                  if(f && !is_static != !(f->flags&FLAG_STATIC))
6029                     noslot=1;
6030                  if(f && f->slot && !noslot) {
6031                      (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
6032                  } else {
6033                      MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id));
6034                      (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
6035                  }
6036                  /* determine type */
6037                  (yyval.value).t = memberinfo_gettype(f);
6038                  if(!(yyval.value).t)
6039                     (yyval.value).c = abc_coerce_a((yyval.value).c);
6040              } else {
6041                  /* when resolving a property on an unknown type, we do know the
6042                     name of the property (and don't seem to need the package), but
6043                     we need to make avm2 try out all access modes */
6044                  multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)};
6045                  (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
6046                  (yyval.value).c = abc_coerce_a((yyval.value).c);
6047                  (yyval.value).t = registry_getanytype();
6048              }
6049             ;}
6050     break;
6051
6052   case 281:
6053
6054 /* Line 1455 of yacc.c  */
6055 #line 2857 "parser.y"
6056     {
6057     (yyval.value).t = 0;
6058     (yyval.value).c = 0;
6059     classinfo_t*a = 0;
6060     memberinfo_t*f = 0;
6061
6062     variable_t*v;
6063     /* look at variables */
6064     if((v = find_variable((yyvsp[(1) - (1)].id)))) {
6065         // $1 is a local variable
6066         (yyval.value).c = abc_getlocal((yyval.value).c, v->index);
6067         (yyval.value).t = v->type;
6068
6069     /* look at current class' members */
6070     } else if(state->cls && (f = registry_findmember(state->cls->info, (yyvsp[(1) - (1)].id), 1))) {
6071         // $1 is a function in this class
6072         int var_is_static = (f->flags&FLAG_STATIC);
6073         int i_am_static = ((state->method && state->method->info)?(state->method->info->flags&FLAG_STATIC):FLAG_STATIC);
6074         if(var_is_static != i_am_static) {
6075             /* there doesn't seem to be any "static" way to access
6076                static properties of a class */
6077             state->method->late_binding = 1;
6078             (yyval.value).t = f->type;
6079             namespace_t ns = {flags2access(f->flags), ""};
6080             multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)};
6081             (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
6082             (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
6083         } else {
6084             if(f->slot>0) {
6085                 (yyval.value).c = abc_getlocal_0((yyval.value).c);
6086                 (yyval.value).c = abc_getslot((yyval.value).c, f->slot);
6087             } else {
6088                 namespace_t ns = {flags2access(f->flags), ""};
6089                 multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)};
6090                 (yyval.value).c = abc_getlocal_0((yyval.value).c);
6091                 (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
6092             }
6093         }
6094         if(f->kind == MEMBER_METHOD) {
6095             (yyval.value).t = TYPE_FUNCTION(f);
6096         } else {
6097             (yyval.value).t = f->type;
6098         }
6099     
6100     /* look at actual classes, in the current package and imported */
6101     } else if((a = find_class((yyvsp[(1) - (1)].id)))) {
6102         if(a->flags & FLAG_METHOD) {
6103             MULTINAME(m, a);
6104             (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
6105             (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
6106             if(a->function->kind == MEMBER_METHOD) {
6107                 (yyval.value).t = TYPE_FUNCTION(a->function);
6108             } else {
6109                 (yyval.value).t = a->function->type;
6110             }
6111         } else {
6112             if(a->slot) {
6113                 (yyval.value).c = abc_getglobalscope((yyval.value).c);
6114                 (yyval.value).c = abc_getslot((yyval.value).c, a->slot);
6115             } else {
6116                 MULTINAME(m, a);
6117                 (yyval.value).c = abc_getlex2((yyval.value).c, &m);
6118             }
6119             (yyval.value).t = TYPE_CLASS(a);
6120         }
6121
6122     /* unknown object, let the avm2 resolve it */
6123     } else {
6124         if(strcmp((yyvsp[(1) - (1)].id),"trace"))
6125             as3_softwarning("Couldn't resolve '%s', doing late binding", (yyvsp[(1) - (1)].id));
6126         state->method->late_binding = 1;
6127                 
6128         multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(1) - (1)].id)};
6129
6130         (yyval.value).t = 0;
6131         (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m);
6132         (yyval.value).c = abc_getproperty2((yyval.value).c, &m);
6133     }
6134 ;}
6135     break;
6136
6137   case 282:
6138
6139 /* Line 1455 of yacc.c  */
6140 #line 2944 "parser.y"
6141     {(yyval.code)=0;;}
6142     break;
6143
6144   case 283:
6145
6146 /* Line 1455 of yacc.c  */
6147 #line 2945 "parser.y"
6148     {(yyval.code)=0;;}
6149     break;
6150
6151   case 284:
6152
6153 /* Line 1455 of yacc.c  */
6154 #line 2946 "parser.y"
6155     {(yyval.code)=0;;}
6156     break;
6157
6158   case 285:
6159
6160 /* Line 1455 of yacc.c  */
6161 #line 2948 "parser.y"
6162     {(yyval.token)=0;;}
6163     break;
6164
6165
6166
6167 /* Line 1455 of yacc.c  */
6168 #line 6169 "parser.tab.c"
6169       default: break;
6170     }
6171   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
6172
6173   YYPOPSTACK (yylen);
6174   yylen = 0;
6175   YY_STACK_PRINT (yyss, yyssp);
6176
6177   *++yyvsp = yyval;
6178
6179   /* Now `shift' the result of the reduction.  Determine what state
6180      that goes to, based on the state we popped back to and the rule
6181      number reduced by.  */
6182
6183   yyn = yyr1[yyn];
6184
6185   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
6186   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
6187     yystate = yytable[yystate];
6188   else
6189     yystate = yydefgoto[yyn - YYNTOKENS];
6190
6191   goto yynewstate;
6192
6193
6194 /*------------------------------------.
6195 | yyerrlab -- here on detecting error |
6196 `------------------------------------*/
6197 yyerrlab:
6198   /* If not already recovering from an error, report this error.  */
6199   if (!yyerrstatus)
6200     {
6201       ++yynerrs;
6202 #if ! YYERROR_VERBOSE
6203       yyerror (YY_("syntax error"));
6204 #else
6205       {
6206         YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
6207         if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
6208           {
6209             YYSIZE_T yyalloc = 2 * yysize;
6210             if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
6211               yyalloc = YYSTACK_ALLOC_MAXIMUM;
6212             if (yymsg != yymsgbuf)
6213               YYSTACK_FREE (yymsg);
6214             yymsg = (char *) YYSTACK_ALLOC (yyalloc);
6215             if (yymsg)
6216               yymsg_alloc = yyalloc;
6217             else
6218               {
6219                 yymsg = yymsgbuf;
6220                 yymsg_alloc = sizeof yymsgbuf;
6221               }
6222           }
6223
6224         if (0 < yysize && yysize <= yymsg_alloc)
6225           {
6226             (void) yysyntax_error (yymsg, yystate, yychar);
6227             yyerror (yymsg);
6228           }
6229         else
6230           {
6231             yyerror (YY_("syntax error"));
6232             if (yysize != 0)
6233               goto yyexhaustedlab;
6234           }
6235       }
6236 #endif
6237     }
6238
6239
6240
6241   if (yyerrstatus == 3)
6242     {
6243       /* If just tried and failed to reuse lookahead token after an
6244          error, discard it.  */
6245
6246       if (yychar <= YYEOF)
6247         {
6248           /* Return failure if at end of input.  */
6249           if (yychar == YYEOF)
6250             YYABORT;
6251         }
6252       else
6253         {
6254           yydestruct ("Error: discarding",
6255                       yytoken, &yylval);
6256           yychar = YYEMPTY;
6257         }
6258     }
6259
6260   /* Else will try to reuse lookahead token after shifting the error
6261      token.  */
6262   goto yyerrlab1;
6263
6264
6265 /*---------------------------------------------------.
6266 | yyerrorlab -- error raised explicitly by YYERROR.  |
6267 `---------------------------------------------------*/
6268 yyerrorlab:
6269
6270   /* Pacify compilers like GCC when the user code never invokes
6271      YYERROR and the label yyerrorlab therefore never appears in user
6272      code.  */
6273   if (/*CONSTCOND*/ 0)
6274      goto yyerrorlab;
6275
6276   /* Do not reclaim the symbols of the rule which action triggered
6277      this YYERROR.  */
6278   YYPOPSTACK (yylen);
6279   yylen = 0;
6280   YY_STACK_PRINT (yyss, yyssp);
6281   yystate = *yyssp;
6282   goto yyerrlab1;
6283
6284
6285 /*-------------------------------------------------------------.
6286 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
6287 `-------------------------------------------------------------*/
6288 yyerrlab1:
6289   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
6290
6291   for (;;)
6292     {
6293       yyn = yypact[yystate];
6294       if (yyn != YYPACT_NINF)
6295         {
6296           yyn += YYTERROR;
6297           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
6298             {
6299               yyn = yytable[yyn];
6300               if (0 < yyn)
6301                 break;
6302             }
6303         }
6304
6305       /* Pop the current state because it cannot handle the error token.  */
6306       if (yyssp == yyss)
6307         YYABORT;
6308
6309
6310       yydestruct ("Error: popping",
6311                   yystos[yystate], yyvsp);
6312       YYPOPSTACK (1);
6313       yystate = *yyssp;
6314       YY_STACK_PRINT (yyss, yyssp);
6315     }
6316
6317   *++yyvsp = yylval;
6318
6319
6320   /* Shift the error token.  */
6321   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
6322
6323   yystate = yyn;
6324   goto yynewstate;
6325
6326
6327 /*-------------------------------------.
6328 | yyacceptlab -- YYACCEPT comes here.  |
6329 `-------------------------------------*/
6330 yyacceptlab:
6331   yyresult = 0;
6332   goto yyreturn;
6333
6334 /*-----------------------------------.
6335 | yyabortlab -- YYABORT comes here.  |
6336 `-----------------------------------*/
6337 yyabortlab:
6338   yyresult = 1;
6339   goto yyreturn;
6340
6341 #if !defined(yyoverflow) || YYERROR_VERBOSE
6342 /*-------------------------------------------------.
6343 | yyexhaustedlab -- memory exhaustion comes here.  |
6344 `-------------------------------------------------*/
6345 yyexhaustedlab:
6346   yyerror (YY_("memory exhausted"));
6347   yyresult = 2;
6348   /* Fall through.  */
6349 #endif
6350
6351 yyreturn:
6352   if (yychar != YYEMPTY)
6353      yydestruct ("Cleanup: discarding lookahead",
6354                  yytoken, &yylval);
6355   /* Do not reclaim the symbols of the rule which action triggered
6356      this YYABORT or YYACCEPT.  */
6357   YYPOPSTACK (yylen);
6358   YY_STACK_PRINT (yyss, yyssp);
6359   while (yyssp != yyss)
6360     {
6361       yydestruct ("Cleanup: popping",
6362                   yystos[*yyssp], yyvsp);
6363       YYPOPSTACK (1);
6364     }
6365 #ifndef yyoverflow
6366   if (yyss != yyssa)
6367     YYSTACK_FREE (yyss);
6368 #endif
6369 #if YYERROR_VERBOSE
6370   if (yymsg != yymsgbuf)
6371     YYSTACK_FREE (yymsg);
6372 #endif
6373   /* Make sure YYID is used.  */
6374   return YYID (yyresult);
6375 }
6376
6377
6378