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