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