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