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