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