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