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