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