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