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