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