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