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