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