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