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