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