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