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