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