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