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