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