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