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