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