From b90a862675445a668b49221a4ac2ead441b9d153 Mon Sep 17 00:00:00 2001 From: kramm Date: Fri, 9 Jan 2009 11:48:30 +0000 Subject: [PATCH] generated using flex+bison --- lib/as3/parser.tab.c | 6378 ++++++++++++++++++++++++++++++++++++++++++++++++ lib/as3/parser.tab.h | 196 ++ lib/as3/tokenizer.yy.c | 3550 +++++++++++++++++++++++++++ 3 files changed, 10124 insertions(+) create mode 100644 lib/as3/parser.tab.c create mode 100644 lib/as3/parser.tab.h create mode 100644 lib/as3/tokenizer.yy.c diff --git a/lib/as3/parser.tab.c b/lib/as3/parser.tab.c new file mode 100644 index 0000000..6fe4636 --- /dev/null +++ b/lib/as3/parser.tab.c @@ -0,0 +1,6378 @@ + +/* A Bison parser, made by GNU Bison 2.4. */ + +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.4" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + +/* Substitute the variable and function names. */ +#define yyparse avm2_parse +#define yylex avm2_lex +#define yyerror avm2_error +#define yylval avm2_lval +#define yychar avm2_char +#define yydebug avm2_debug +#define yynerrs avm2_nerrs + + +/* Copy the first part of user declarations. */ + +/* Line 189 of yacc.c */ +#line 23 "parser.y" + +#include +#include +#include +#include "abc.h" +#include "pool.h" +#include "files.h" +#include "tokenizer.h" +#include "registry.h" +#include "code.h" +#include "opcodes.h" + + + +/* Line 189 of yacc.c */ +#line 96 "parser.tab.c" + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 1 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + T_IDENTIFIER = 258, + T_STRING = 259, + T_REGEXP = 260, + T_EMPTY = 261, + T_INT = 262, + T_UINT = 263, + T_BYTE = 264, + T_SHORT = 265, + T_FLOAT = 266, + T_FOR = 267, + T_WHILE = 268, + T_DO = 269, + T_SWITCH = 270, + KW_IMPLEMENTS = 271, + KW_NAMESPACE = 272, + KW_PACKAGE = 273, + KW_PROTECTED = 274, + KW_PUBLIC = 275, + KW_PRIVATE = 276, + KW_USE = 277, + KW_INTERNAL = 278, + KW_NEW = 279, + KW_NATIVE = 280, + KW_FUNCTION = 281, + KW_FINALLY = 282, + KW_UNDEFINED = 283, + KW_CONTINUE = 284, + KW_CLASS = 285, + KW_CONST = 286, + KW_CATCH = 287, + KW_CASE = 288, + KW_SET = 289, + KW_VOID = 290, + KW_THROW = 291, + KW_STATIC = 292, + KW_WITH = 293, + KW_INSTANCEOF = 294, + KW_IMPORT = 295, + KW_RETURN = 296, + KW_TYPEOF = 297, + KW_INTERFACE = 298, + KW_NULL = 299, + KW_VAR = 300, + KW_DYNAMIC = 301, + KW_OVERRIDE = 302, + KW_FINAL = 303, + KW_EACH = 304, + KW_GET = 305, + KW_TRY = 306, + KW_SUPER = 307, + KW_EXTENDS = 308, + KW_FALSE = 309, + KW_TRUE = 310, + KW_BOOLEAN = 311, + KW_UINT = 312, + KW_INT = 313, + KW_NUMBER = 314, + KW_STRING = 315, + KW_DEFAULT = 316, + KW_DELETE = 317, + KW_IF = 318, + KW_ELSE = 319, + KW_BREAK = 320, + KW_IS = 321, + KW_IN = 322, + KW_AS = 323, + T_EQEQ = 324, + T_EQEQEQ = 325, + T_NE = 326, + T_NEE = 327, + T_LE = 328, + T_GE = 329, + T_ORBY = 330, + T_DIVBY = 331, + T_MODBY = 332, + T_MULBY = 333, + T_PLUSBY = 334, + T_MINUSBY = 335, + T_SHRBY = 336, + T_SHLBY = 337, + T_USHRBY = 338, + T_OROR = 339, + T_ANDAND = 340, + T_COLONCOLON = 341, + T_MINUSMINUS = 342, + T_PLUSPLUS = 343, + T_DOTDOT = 344, + T_DOTDOTDOT = 345, + T_SHL = 346, + T_USHR = 347, + T_SHR = 348, + prec_none = 349, + below_semicolon = 350, + below_assignment = 351, + below_minus = 354, + minusminus_prefix = 355, + plusplus_prefix = 356, + below_curly = 357, + above_identifier = 358, + below_else = 359, + above_function = 360 + }; +#endif + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union +/* Line 214 of yacc.c */ +#line 41 "parser.y" +tokenunion +{ + +/* Line 214 of yacc.c */ +#line 41 "parser.y" + + enum yytokentype token; + int flags; + + classinfo_t*classinfo; + classinfo_list_t*classinfo_list; + + int number_int; + unsigned int number_uint; + double number_float; + code_t*code; + typedcode_t value; + //typedcode_list_t*value_list; + codeandnumber_t value_list; + param_t* param; + params_t params; + string_t str; + char*id; + constant_t*constant; + for_start_t for_start; + abc_exception_t *exception; + regexp_t regexp; + struct { + abc_exception_list_t *l; + code_t*finally; + } catch_list; + + + +/* Line 214 of yacc.c */ +#line 268 "parser.tab.c" +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +#endif + + +/* Copy the second part of user declarations. */ + +/* Line 264 of yacc.c */ +#line 251 "parser.y" + + +static int yyerror(char*s) +{ + syntaxerror("%s", s); + return 0; //make gcc happy +} + +static char* concat2(const char* t1, const char* t2) +{ + int l1 = strlen(t1); + int l2 = strlen(t2); + char*text = malloc(l1+l2+1); + memcpy(text , t1, l1); + memcpy(text+l1, t2, l2); + text[l1+l2] = 0; + return text; +} +static char* concat3(const char* t1, const char* t2, const char* t3) +{ + int l1 = strlen(t1); + int l2 = strlen(t2); + int l3 = strlen(t3); + char*text = malloc(l1+l2+l3+1); + memcpy(text , t1, l1); + memcpy(text+l1, t2, l2); + memcpy(text+l1+l2, t3, l3); + text[l1+l2+l3] = 0; + return text; +} + +typedef struct _import { + char*package; +} import_t; + +DECLARE_LIST(import); + +typedef struct _classstate { + /* class data */ + classinfo_t*info; + abc_class_t*abc; + code_t*init; + code_t*static_init; + char has_constructor; +} classstate_t; + +typedef struct _methodstate { + /* method data */ + memberinfo_t*info; + char late_binding; + char is_constructor; + char has_super; + char is_global; + abc_exception_list_t*exceptions; +} methodstate_t; + +typedef struct _state { + struct _state*old; + int level; + + char*package; + import_list_t*wildcard_imports; + dict_t*imports; + char has_own_imports; + + classstate_t*cls; + methodstate_t*method; + + char*exception_name; + + dict_t*vars; +} state_t; + +typedef struct _global { + abc_file_t*file; + abc_script_t*init; + + int variable_count; +} global_t; + +static global_t*global = 0; +static state_t* state = 0; + +DECLARE_LIST(state); + +#define MULTINAME(m,x) \ + multiname_t m;\ + namespace_t m##_ns;\ + registry_fill_multiname(&m, &m##_ns, x); + +#define MEMBER_MULTINAME(m,f,n) \ + multiname_t m;\ + namespace_t m##_ns;\ + if(f) { \ + m##_ns = flags2namespace(f->flags, ""); \ + m.type = QNAME; \ + m.ns = &m##_ns; \ + m.namespace_set = 0; \ + m.name = f->name; \ + } else { \ + m.type = MULTINAME; \ + m.ns =0; \ + m.namespace_set = &nopackage_namespace_set; \ + m.name = n; \ + } + +/* warning: list length of namespace set is undefined */ +#define MULTINAME_LATE(m, access, package) \ + namespace_t m##_ns = {access, package}; \ + namespace_set_t m##_nsset; \ + namespace_list_t m##_l;m##_l.next = 0; \ + m##_nsset.namespaces = &m##_l; \ + m##_nsset = m##_nsset; \ + m##_l.namespace = &m##_ns; \ + multiname_t m = {MULTINAMEL, 0, &m##_nsset, 0}; + +static namespace_t ns1 = {ACCESS_PRIVATE, ""}; +static namespace_t ns2 = {ACCESS_PROTECTED, ""}; +static namespace_t ns3 = {ACCESS_PACKAGEINTERNAL, ""}; +static namespace_t ns4 = {ACCESS_PACKAGE, ""}; +static namespace_list_t nl4 = {&ns4,0}; +static namespace_list_t nl3 = {&ns3,&nl4}; +static namespace_list_t nl2 = {&ns2,&nl3}; +static namespace_list_t nl1 = {&ns1,&nl2}; +static namespace_set_t nopackage_namespace_set = {&nl1}; + +static void new_state() +{ + NEW(state_t, s); + state_t*oldstate = state; + if(state) + memcpy(s, state, sizeof(state_t)); //shallow copy + if(!s->imports) { + s->imports = dict_new(); + } + state = s; + state->level++; + state->has_own_imports = 0; + state->vars = dict_new(); + state->old = oldstate; +} +static void state_has_imports() +{ + state->wildcard_imports = list_clone(state->wildcard_imports); + state->imports = dict_clone(state->imports); + state->has_own_imports = 1; +} + +static void state_destroy(state_t*state) +{ + if(state->has_own_imports) { + list_free(state->wildcard_imports); + dict_destroy(state->imports);state->imports=0; + } + if(state->imports && (!state->old || state->old->imports!=state->imports)) { + dict_destroy(state->imports);state->imports=0; + } + if(state->vars) { + int t; + for(t=0;tvars->hashsize;t++) { + dictentry_t*e =state->vars->slots[t]; + while(e) { + free(e->data);e->data=0; + e = e->next; + } + } + dict_destroy(state->vars);state->vars=0; + } + + free(state); +} + +static void old_state() +{ + if(!state || !state->old) + syntaxerror("invalid nesting"); + state_t*leaving = state; + + state = state->old; + state_destroy(leaving); +} + +void initialize_parser() +{ + global = rfx_calloc(sizeof(global_t)); + global->file = abc_file_new(); + global->file->flags &= ~ABCFILE_LAZY; + global->variable_count = 1; + global->init = abc_initscript(global->file); + code_t*c = global->init->method->body->code; + c = abc_getlocal_0(c); + c = abc_pushscope(c); + /*c = abc_findpropstrict(c, "[package]::trace"); + c = abc_pushstring(c, "[entering global init function]"); + c = abc_callpropvoid(c, "[package]::trace", 1);*/ + global->init->method->body->code = c; +} + +void initialize_file(char*filename) +{ + new_state(); + state->package = filename; + // needed for state->method->late_binding: + state->method = rfx_calloc(sizeof(methodstate_t)); +} +void finish_file() +{ + if(!state || state->level!=1) { + syntaxerror("unexpected end of file"); + } + state_destroy(state);state=0; +} + +void* finish_parser() +{ + code_t*c = global->init->method->body->code; + /*c = abc_findpropstrict(c, "[package]::trace"); + c = abc_pushstring(c, "[leaving global init function]"); + c = abc_callpropvoid(c, "[package]::trace", 1);*/ + c = abc_returnvoid(c); + global->init->method->body->code = c; + return global->file; +} + + +static void xx_scopetest() +{ + /* findpropstrict doesn't just return a scope object- it + also makes it "active" somehow. Push local_0 on the + scope stack and read it back with findpropstrict, it'll + contain properties like "trace". Trying to find the same + property on a "vanilla" local_0 yields only a "undefined" */ + //c = abc_findpropstrict(c, "[package]::trace"); + + /*c = abc_getlocal_0(c); + c = abc_findpropstrict(c, "[package]::trace"); + c = abc_coerce_a(c); + c = abc_setlocal_1(c); + + c = abc_pushbyte(c, 0); + c = abc_setlocal_2(c); + + code_t*xx = c = abc_label(c); + c = abc_findpropstrict(c, "[package]::trace"); + c = abc_pushstring(c, "prop:"); + c = abc_hasnext2(c, 1, 2); + c = abc_dup(c); + c = abc_setlocal_3(c); + c = abc_callpropvoid(c, "[package]::trace", 2); + c = abc_getlocal_3(c); + c = abc_kill(c, 3); + c = abc_iftrue(c,xx);*/ +} + + +typedef struct _variable { + int index; + classinfo_t*type; + char init; +} variable_t; + +static variable_t* find_variable(char*name) +{ + state_t* s = state; + while(s) { + variable_t*v = 0; + if(s->method) + v = dict_lookup(s->vars, name); + if(v) { + return v; + } + s = s->old; + } + return 0; +} +static variable_t* find_variable_safe(char*name) +{ + variable_t* v = find_variable(name); + if(!v) + syntaxerror("undefined variable: %s", name); + return v; +} +static char variable_exists(char*name) +{ + return dict_lookup(state->vars, name)!=0; +} +code_t*defaultvalue(code_t*c, classinfo_t*type); +static int new_variable(char*name, classinfo_t*type, char init) +{ + NEW(variable_t, v); + v->index = global->variable_count; + v->type = type; + v->init = init; + + dict_put(state->vars, name, v); + + return global->variable_count++; +} +#define TEMPVARNAME "__as3_temp__" +static int gettempvar() +{ + variable_t*v = find_variable(TEMPVARNAME); + if(v) + return v->index; + return new_variable(TEMPVARNAME, 0, 0); +} + +code_t* var_block(code_t*body) +{ + code_t*c = 0; + code_t*k = 0; + int t; + int num=0; + for(t=0;tvars->hashsize;t++) { + dictentry_t*e = state->vars->slots[t]; + while(e) { + variable_t*v = (variable_t*)e->data; + if(v->type && v->init) { + c = defaultvalue(c, v->type); + c = abc_setlocal(c, v->index); + k = abc_kill(k, v->index); + num++; + } + e = e->next; + } + } + + if(k) { + code_t*x = body; + while(x) { + if(x->opcode== OPCODE___BREAK__ || + x->opcode== OPCODE___CONTINUE__) { + /* link kill code before break/continue */ + code_t*e = code_dup(k); + code_t*s = code_start(e); + s->prev = x->prev; + if(x->prev) { + x->prev->next = s; + } + e->next = x; + x->prev = e; + } + x = x->prev; + } + } + + c = code_append(c, body); + c = code_append(c, k); + return c; +} + +static code_t* wrap_function(code_t*c,code_t*header, code_t*body) +{ + c = code_append(c, header); + c = code_append(c, var_block(body)); + /* append return if necessary */ + if(!c || (c->opcode != OPCODE_RETURNVOID && + c->opcode != OPCODE_RETURNVALUE)) { + c = abc_returnvoid(c); + } + return c; +} + + +static void startpackage(char*name) +{ + new_state(); + /*printf("entering package \"%s\"\n", name);*/ + state->package = strdup(name); + global->variable_count = 1; +} +static void endpackage() +{ + /*printf("leaving package \"%s\"\n", state->package);*/ + + //used e.g. in classinfo_register: + //free(state->package);state->package=0; + + old_state(); +} + +char*as3_globalclass=0; +static void startclass(int flags, char*classname, classinfo_t*extends, classinfo_list_t*implements, char interface) +{ + if(state->cls) { + syntaxerror("inner classes now allowed"); + } + new_state(); + global->variable_count = 1; + state->cls = rfx_calloc(sizeof(classstate_t)); + state->method = rfx_calloc(sizeof(methodstate_t)); // method state, for static constructor + + token_list_t*t=0; + classinfo_list_t*mlist=0; + + if(flags&~(FLAG_PACKAGEINTERNAL|FLAG_PUBLIC|FLAG_FINAL|FLAG_DYNAMIC)) + syntaxerror("invalid modifier(s)"); + + if((flags&(FLAG_PUBLIC|FLAG_PACKAGEINTERNAL)) == (FLAG_PUBLIC|FLAG_PACKAGEINTERNAL)) + syntaxerror("public and internal not supported at the same time."); + + /* create the class name, together with the proper attributes */ + int access=0; + char*package=0; + + if(!(flags&FLAG_PUBLIC) && !state->package) { + access = ACCESS_PRIVATE; package = current_filename; + } else if(!(flags&FLAG_PUBLIC) && state->package) { + access = ACCESS_PACKAGEINTERNAL; package = state->package; + } else if(state->package) { + access = ACCESS_PACKAGE; package = state->package; + } else { + syntaxerror("public classes only allowed inside a package"); + } + + if(registry_findclass(package, classname)) { + syntaxerror("Package \"%s\" already contains a class called \"%s\"", package, classname); + } + + + /* build info struct */ + int num_interfaces = (list_length(implements)); + state->cls->info = classinfo_register(access, package, classname, num_interfaces); + state->cls->info->superclass = extends?extends:TYPE_OBJECT; + int pos = 0; + classinfo_list_t*l = implements; + for(l=implements;l;l=l->next) { + state->cls->info->interfaces[pos++] = l->classinfo; + } + + multiname_t*extends2 = sig2mname(extends); + + MULTINAME(classname2,state->cls->info); + + /*if(extends) { + state->cls_init = abc_getlocal_0(state->cls_init); + state->cls_init = abc_constructsuper(state->cls_init, 0); + }*/ + + state->cls->abc = abc_class_new(global->file, &classname2, extends2); + if(flags&FLAG_FINAL) abc_class_final(state->cls->abc); + if(!(flags&FLAG_DYNAMIC)) abc_class_sealed(state->cls->abc); + if(interface) { + state->cls->info->flags |= CLASS_INTERFACE; + abc_class_interface(state->cls->abc); + } + + abc_class_protectedNS(state->cls->abc, classname); + + for(mlist=implements;mlist;mlist=mlist->next) { + MULTINAME(m, mlist->classinfo); + abc_class_add_interface(state->cls->abc, &m); + } + + /* now write the construction code for this class */ + int slotindex = abc_initscript_addClassTrait(global->init, &classname2, state->cls->abc); + + abc_method_body_t*m = global->init->method->body; + __ getglobalscope(m); + classinfo_t*s = extends; + + int count=0; + + while(s) { + //TODO: take a look at the current scope stack, maybe + // we can re-use something + s = s->superclass; + if(!s) + break; + + multiname_t*s2 = sig2mname(s); + __ getlex2(m, s2); + multiname_destroy(s2); + + __ pushscope(m); count++; + m->code = m->code->prev->prev; // invert + } + /* continue appending after last op end */ + while(m->code && m->code->next) m->code = m->code->next; + + /* TODO: if this is one of *our* classes, we can also + do a getglobalscope/getslot (which references + the init function's slots) */ + if(extends2) { + __ getlex2(m, extends2); + __ dup(m); + /* notice: we get a Verify Error #1107 if the top elemnt on the scope + stack is not the superclass */ + __ pushscope(m);count++; + } else { + __ pushnull(m); + /* notice: we get a verify error #1107 if the top element on the scope + stack is not the global object */ + __ getlocal_0(m); + __ pushscope(m);count++; + } + __ newclass(m,state->cls->abc); + while(count--) { + __ popscope(m); + } + __ setslot(m, slotindex); + + /* flash.display.MovieClip handling */ + if(!as3_globalclass && (flags&FLAG_PUBLIC) && classinfo_equals(registry_getMovieClip(),extends)) { + if(state->package && state->package[0]) { + as3_globalclass = concat3(state->package, ".", classname); + } else { + as3_globalclass = strdup(classname); + } + } + multiname_destroy(extends2); +} + +static void endclass() +{ + if(!state->cls->has_constructor && !(state->cls->info->flags&CLASS_INTERFACE)) { + code_t*c = 0; + c = abc_getlocal_0(c); + c = abc_constructsuper(c, 0); + state->cls->init = code_append(state->cls->init, c); + } + if(!state->method->late_binding) { + // class initialization code uses late binding + code_t*c = 0; + c = abc_getlocal_0(c); + c = abc_pushscope(c); + state->cls->static_init = code_append(c, state->cls->static_init); + } + + if(state->cls->init) { + abc_method_t*m = abc_class_getconstructor(state->cls->abc, 0); + m->body->code = wrap_function(0, state->cls->init, m->body->code); + } + if(state->cls->static_init) { + abc_method_t*m = abc_class_getstaticconstructor(state->cls->abc, 0); + m->body->code = wrap_function(0, state->cls->static_init, m->body->code); + } + + free(state->cls);state->cls=0; + free(state->method);state->method=0; + old_state(); +} + +void check_code_for_break(code_t*c) +{ + while(c) { + if(c->opcode == OPCODE___BREAK__) { + char*name = string_cstr(c->data[0]); + syntaxerror("Unresolved \"break %s\"", name); + } + if(c->opcode == OPCODE___CONTINUE__) { + char*name = string_cstr(c->data[0]); + syntaxerror("Unresolved \"continue %s\"", name); + } + c=c->prev; + } +} + + +static void check_constant_against_type(classinfo_t*t, constant_t*c) +{ +#define xassert(b) if(!(b)) syntaxerror("Invalid default value %s for type '%s'", constant_tostring(c), t->name) + if(TYPE_IS_NUMBER(t)) { + xassert(c->type == CONSTANT_FLOAT + || c->type == CONSTANT_INT + || c->type == CONSTANT_UINT); + } else if(TYPE_IS_UINT(t)) { + xassert(c->type == CONSTANT_UINT || + (c->type == CONSTANT_INT && c->i>0)); + } else if(TYPE_IS_INT(t)) { + xassert(c->type == CONSTANT_INT); + } else if(TYPE_IS_BOOLEAN(t)) { + xassert(c->type == CONSTANT_TRUE + || c->type == CONSTANT_FALSE); + } +} + + +static int flags2access(int flags) +{ + int access = 0; + if(flags&FLAG_PUBLIC) { + if(access&(FLAG_PRIVATE|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL)) + syntaxerror("invalid combination of access levels"); + access = ACCESS_PACKAGE; + } else if(flags&FLAG_PRIVATE) { + if(access&(FLAG_PUBLIC|FLAG_PROTECTED|FLAG_PACKAGEINTERNAL)) + syntaxerror("invalid combination of access levels"); + access = ACCESS_PRIVATE; + } else if(flags&FLAG_PROTECTED) { + if(access&(FLAG_PUBLIC|FLAG_PRIVATE|FLAG_PACKAGEINTERNAL)) + syntaxerror("invalid combination of access levels"); + access = ACCESS_PROTECTED; + } else { + access = ACCESS_PACKAGEINTERNAL; + } + return access; +} + + +static memberinfo_t*registerfunction(enum yytokentype getset, int flags, char*name, params_t*params, classinfo_t*return_type, int slot) +{ + memberinfo_t*minfo = 0; + if(!state->cls) { + //package method + minfo = memberinfo_register_global(flags2access(flags), state->package, name, MEMBER_METHOD); + minfo->return_type = return_type; + } else if(getset != KW_GET && getset != KW_SET) { + //class method + if((minfo = registry_findmember(state->cls->info, name, 0))) { + if(minfo->parent == state->cls->info) { + syntaxerror("class already contains a member/method called '%s'", name); + } else if(!minfo->parent) { + syntaxerror("internal error: overriding method %s, which doesn't have parent", name); + } else { + if(!(minfo->flags&(FLAG_STATIC|FLAG_PRIVATE))) + syntaxerror("function %s already exists in superclass. Did you forget the 'override' keyword?"); + } + } + minfo = memberinfo_register(state->cls->info, name, MEMBER_METHOD); + minfo->return_type = return_type; + // getslot on a member slot only returns "undefined", so no need + // to actually store these + //state->minfo->slot = state->method->abc->method->trait->slot_id; + } else { + //class getter/setter + int gs = getset==KW_GET?MEMBER_GET:MEMBER_SET; + classinfo_t*type=0; + if(getset == KW_GET) + type = return_type; + else if(params->list) + type = params->list->param->type; + // not sure wether to look into superclasses here, too + if((minfo=registry_findmember(state->cls->info, name, 0))) { + if(minfo->kind & ~(MEMBER_GET|MEMBER_SET)) + syntaxerror("class already contains a member or method called '%s'", name); + if(minfo->kind & gs) + syntaxerror("getter/setter for '%s' already defined", name); + /* make a setter or getter into a getset */ + minfo->kind |= gs; + if(!minfo->type) + minfo->type = type; + else + if(type && minfo->type != type) + syntaxerror("different type in getter and setter"); + } else { + minfo = memberinfo_register(state->cls->info, name, gs); + minfo->type = type; + } + /* can't assign a slot as getter and setter might have different slots */ + //minfo->slot = slot; + } + if(flags&FLAG_STATIC) minfo->flags |= FLAG_STATIC; + if(flags&FLAG_PUBLIC) minfo->flags |= FLAG_PUBLIC; + if(flags&FLAG_PRIVATE) minfo->flags |= FLAG_PRIVATE; + if(flags&FLAG_PROTECTED) minfo->flags |= FLAG_PROTECTED; + if(flags&FLAG_PACKAGEINTERNAL) minfo->flags |= FLAG_PACKAGEINTERNAL; + if(flags&FLAG_OVERRIDE) minfo->flags |= FLAG_OVERRIDE; + return minfo; +} + +static void startfunction(token_t*ns, int flags, enum yytokentype getset, char*name, + params_t*params, classinfo_t*return_type) +{ + if(state->method && state->method->info) { + syntaxerror("not able to start another method scope"); + } + new_state(); + global->variable_count = 0; + state->method = rfx_calloc(sizeof(methodstate_t)); + state->method->has_super = 0; + + if(state->cls) { + state->method->is_constructor = !strcmp(state->cls->info->name,name); + state->cls->has_constructor |= state->method->is_constructor; + + new_variable((flags&FLAG_STATIC)?"class":"this", state->cls->info, 0); + } else { + state->method->is_global = 1; + state->method->late_binding = 1; // for global methods, always push local_0 on the scope stack + + new_variable("globalscope", 0, 0); + } + + /* state->vars is initialized by state_new */ + + param_list_t*p=0; + for(p=params->list;p;p=p->next) { + new_variable(p->param->name, p->param->type, 0); + } + if(state->method->is_constructor) + name = "__as3_constructor__"; + state->method->info = registerfunction(getset, flags, name, params, return_type, 0); +} + +static void endfunction(token_t*ns, int flags, enum yytokentype getset, char*name, + params_t*params, classinfo_t*return_type, code_t*body) +{ + abc_method_t*f = 0; + + multiname_t*type2 = sig2mname(return_type); + int slot = 0; + if(state->method->is_constructor) { + f = abc_class_getconstructor(state->cls->abc, type2); + } else if(!state->method->is_global) { + namespace_t mname_ns = flags2namespace(flags, ""); + multiname_t mname = {QNAME, &mname_ns, 0, name}; + + if(flags&FLAG_STATIC) + f = abc_class_staticmethod(state->cls->abc, type2, &mname); + else + f = abc_class_method(state->cls->abc, type2, &mname); + slot = f->trait->slot_id; + } else { + namespace_t mname_ns = flags2namespace(flags, state->package); + multiname_t mname = {QNAME, &mname_ns, 0, name}; + + f = abc_method_new(global->file, type2, 1); + trait_t*t = trait_new_method(&global->init->traits, multiname_clone(&mname), f); + //abc_code_t*c = global->init->method->body->code; + } + //flash doesn't seem to allow us to access function slots + //state->method->info->slot = slot; + + if(flags&FLAG_OVERRIDE) f->trait->attributes |= TRAIT_ATTR_OVERRIDE; + if(getset == KW_GET) f->trait->kind = TRAIT_GETTER; + if(getset == KW_SET) f->trait->kind = TRAIT_SETTER; + if(params->varargs) f->flags |= METHOD_NEED_REST; + + char opt=0; + param_list_t*p=0; + for(p=params->list;p;p=p->next) { + if(params->varargs && !p->next) { + break; //varargs: omit last parameter in function signature + } + multiname_t*m = sig2mname(p->param->type); + list_append(f->parameters, m); + if(p->param->value) { + check_constant_against_type(p->param->type, p->param->value); + opt=1;list_append(f->optional_parameters, p->param->value); + } else if(opt) { + syntaxerror("non-optional parameter not allowed after optional parameters"); + } + } + check_code_for_break(body); + + if(f->body) { + f->body->code = body; + f->body->exceptions = state->method->exceptions; + } else { //interface + if(body) + syntaxerror("interface methods can't have a method body"); + } + + free(state->method);state->method=0; + old_state(); +} + + + +char is_subtype_of(classinfo_t*type, classinfo_t*supertype) +{ + return 1; // FIXME +} + +void breakjumpsto(code_t*c, char*name, code_t*jump) +{ + while(c) { + if(c->opcode == OPCODE___BREAK__) { + string_t*name2 = c->data[0]; + if(!name2->len || !strncmp(name2->str, name, name2->len)) { + c->opcode = OPCODE_JUMP; + c->branch = jump; + } + } + c=c->prev; + } +} +void continuejumpsto(code_t*c, char*name, code_t*jump) +{ + while(c) { + if(c->opcode == OPCODE___CONTINUE__) { + string_t*name2 = c->data[0]; + if(!name2->len || !strncmp(name2->str, name, name2->len)) { + c->opcode = OPCODE_JUMP; + c->branch = jump; + } + } + c = c->prev; + } +} + +#define IS_INT(a) (TYPE_IS_INT((a)) || TYPE_IS_UINT((a))) +#define IS_NUMBER_OR_INT(a) (TYPE_IS_INT((a)) || TYPE_IS_UINT((a)) || TYPE_IS_NUMBER((a))) +#define BOTH_INT(a,b) (IS_INT(a) && IS_INT(b)) + +classinfo_t*join_types(classinfo_t*type1, classinfo_t*type2, char op) +{ + if(!type1 || !type2) + return registry_getanytype(); + if(TYPE_IS_ANY(type1) || TYPE_IS_ANY(type2)) + return registry_getanytype(); + + if(op=='+') { + if(IS_NUMBER_OR_INT(type1) && IS_NUMBER_OR_INT(type2)) { + return TYPE_NUMBER; + } else { + return TYPE_ANY; + } + } + + if(type1 == type2) + return type1; + return registry_getanytype(); +} +code_t*converttype(code_t*c, classinfo_t*from, classinfo_t*to) +{ + if(from==to) + return c; + if(!to) { + return abc_coerce_a(c); + } + MULTINAME(m, to); + if(!from) { + // cast an "any" type to a specific type. subject to + // runtime exceptions + return abc_coerce2(c, &m); + } + + if((TYPE_IS_NUMBER(from) || TYPE_IS_UINT(from) || TYPE_IS_INT(from)) && + (TYPE_IS_NUMBER(to) || TYPE_IS_UINT(to) || TYPE_IS_INT(to))) { + // allow conversion between number types + return abc_coerce2(c, &m); + } + //printf("%s.%s\n", from.package, from.name); + //printf("%s.%s\n", to.package, to.name); + + classinfo_t*supertype = from; + while(supertype) { + if(supertype == to) { + // target type is one of from's superclasses + return abc_coerce2(c, &m); + } + int t=0; + while(supertype->interfaces[t]) { + if(supertype->interfaces[t]==to) { + // target type is one of from's interfaces + return abc_coerce2(c, &m); + } + t++; + } + supertype = supertype->superclass; + } + if(TYPE_IS_FUNCTION(from) && TYPE_IS_FUNCTION(to)) + return c; + if(TYPE_IS_CLASS(from) && TYPE_IS_CLASS(to)) + return c; + syntaxerror("can't convert type %s to %s", from->name, to->name); + return 0; // make gcc happy +} + +code_t*defaultvalue(code_t*c, classinfo_t*type) +{ + if(TYPE_IS_INT(type)) { + c = abc_pushbyte(c, 0); + } else if(TYPE_IS_UINT(type)) { + c = abc_pushuint(c, 0); + } else if(TYPE_IS_FLOAT(type)) { + c = abc_pushnan(c); + } else if(TYPE_IS_BOOLEAN(type)) { + c = abc_pushfalse(c); + } else if(!type) { + //c = abc_pushundefined(c); + } else { + c = abc_pushnull(c); + MULTINAME(m, type); + c = abc_coerce2(c, &m); + } + return c; +} + +char is_pushundefined(code_t*c) +{ + return (c && !c->prev && !c->next && c->opcode == OPCODE_PUSHUNDEFINED); +} + +void parserassert(int b) +{ + if(!b) syntaxerror("internal error: assertion failed"); +} + +static classinfo_t* find_class(char*name) +{ + classinfo_t*c=0; + + c = registry_findclass(state->package, name); + if(c) return c; + + /* try explicit imports */ + dictentry_t* e = dict_get_slot(state->imports, name); + if(c) return c; + while(e) { + if(!strcmp(e->key, name)) { + c = (classinfo_t*)e->data; + if(c) return c; + } + e = e->next; + } + + /* try package.* imports */ + import_list_t*l = state->wildcard_imports; + while(l) { + //printf("does package %s contain a class %s?\n", l->import->package, name); + c = registry_findclass(l->import->package, name); + if(c) return c; + l = l->next; + } + + /* try global package */ + c = registry_findclass("", name); + if(c) return c; + + /* try local "filename" package */ + c = registry_findclass(current_filename, name); + if(c) return c; + + return 0; +} + +static char is_getlocal(code_t*c) +{ + if(!c || c->prev || c->next) + return 0; + return(c->opcode == OPCODE_GETLOCAL + || c->opcode == OPCODE_GETLOCAL_0 + || c->opcode == OPCODE_GETLOCAL_1 + || c->opcode == OPCODE_GETLOCAL_2 + || c->opcode == OPCODE_GETLOCAL_3); +} +static int getlocalnr(code_t*c) +{ + if(c->opcode == OPCODE_GETLOCAL) {return (ptroff_t)c->data[0];} + else if(c->opcode == OPCODE_GETLOCAL_0) {return 0;} + else if(c->opcode == OPCODE_GETLOCAL_1) {return 1;} + else if(c->opcode == OPCODE_GETLOCAL_2) {return 2;} + else if(c->opcode == OPCODE_GETLOCAL_3) {return 3;} + else syntaxerror("Internal error: opcode %02x is not a getlocal call", c->opcode); + return 0; +} + +static code_t* toreadwrite(code_t*in, code_t*middlepart, char justassign, char readbefore) +{ + /* converts this: + + [prefix code] [read instruction] + + to this: + + [prefix code] ([dup]) [read instruction] [middlepart] [setvar] [write instruction] [getvar] + */ + + if(in && in->opcode == OPCODE_COERCE_A) { + in = code_cutlast(in); + } + if(in->next) + syntaxerror("internal error"); + + /* chop off read instruction */ + code_t*prefix = in; + code_t*r = in; + if(r->prev) { + prefix = r->prev;r->prev = 0; + prefix->next=0; + } else { + prefix = 0; + } + + char use_temp_var = readbefore; + + /* generate the write instruction, and maybe append a dup to the prefix code */ + code_t* write = abc_nop(0); + if(r->opcode == OPCODE_GETPROPERTY) { + write->opcode = OPCODE_SETPROPERTY; + multiname_t*m = (multiname_t*)r->data[0]; + write->data[0] = multiname_clone(m); + if(m->type == QNAME || m->type == MULTINAME) { + if(!justassign) { + prefix = abc_dup(prefix); // we need the object, too + } + use_temp_var = 1; + } else if(m->type == MULTINAMEL) { + if(!justassign) { + /* dupping two values on the stack requires 5 operations and one register- + couldn't adobe just have given us a dup2? */ + int temp = gettempvar(); + prefix = abc_setlocal(prefix, temp); + prefix = abc_dup(prefix); + prefix = abc_getlocal(prefix, temp); + prefix = abc_swap(prefix); + prefix = abc_getlocal(prefix, temp); + if(!use_temp_var); + prefix = abc_kill(prefix, temp); + } + use_temp_var = 1; + } else { + syntaxerror("illegal lvalue: can't assign a value to this expression (not a qname/multiname)"); + } + } else if(r->opcode == OPCODE_GETSLOT) { + write->opcode = OPCODE_SETSLOT; + write->data[0] = r->data[0]; + if(!justassign) { + prefix = abc_dup(prefix); // we need the object, too + } + use_temp_var = 1; + } else if(r->opcode == OPCODE_GETLOCAL) { + write->opcode = OPCODE_SETLOCAL; + write->data[0] = r->data[0]; + } else if(r->opcode == OPCODE_GETLOCAL_0) { + write->opcode = OPCODE_SETLOCAL_0; + } else if(r->opcode == OPCODE_GETLOCAL_1) { + write->opcode = OPCODE_SETLOCAL_1; + } else if(r->opcode == OPCODE_GETLOCAL_2) { + write->opcode = OPCODE_SETLOCAL_2; + } else if(r->opcode == OPCODE_GETLOCAL_3) { + write->opcode = OPCODE_SETLOCAL_3; + } else { + code_dump(r); + syntaxerror("illegal lvalue: can't assign a value to this expression"); + } + code_t* c = 0; + + int temp = -1; + if(!justassign) { + if(use_temp_var) { + /* with getproperty/getslot, we have to be extra careful not + to execute the read code twice, as it might have side-effects + (e.g. if the property is in fact a setter/getter combination) + + So read the value, modify it, and write it again, + using prefix only once and making sure (by using a temporary + register) that the return value is what we just wrote */ + temp = gettempvar(); + c = code_append(c, prefix); + c = code_append(c, r); + if(readbefore) { + c = abc_dup(c); + c = abc_setlocal(c, temp); + } + c = code_append(c, middlepart); + if(!readbefore) { + c = abc_dup(c); + c = abc_setlocal(c, temp); + } + c = code_append(c, write); + c = abc_getlocal(c, temp); + c = abc_kill(c, temp); + } else { + /* if we're allowed to execute the read code twice *and* + the middlepart doesn't modify the code, things are easier. + */ + code_t* r2 = code_dup(r); + //c = code_append(c, prefix); + parserassert(!prefix); + c = code_append(c, r); + c = code_append(c, middlepart); + c = code_append(c, write); + c = code_append(c, r2); + } + } else { + /* even smaller version: overwrite the value without reading + it out first */ + if(!use_temp_var) { + if(prefix) { + c = code_append(c, prefix); + c = abc_dup(c); + } + c = code_append(c, middlepart); + c = code_append(c, write); + c = code_append(c, r); + } else { + temp = gettempvar(); + if(prefix) { + c = code_append(c, prefix); + } + c = code_append(c, middlepart); + c = abc_dup(c); + c = abc_setlocal(c, temp); + c = code_append(c, write); + c = abc_getlocal(c, temp); + c = abc_kill(c, temp); + } + } + return c; +} + +char is_break_or_jump(code_t*c) +{ + if(!c) + return 0; + if(c->opcode == OPCODE_JUMP || + c->opcode == OPCODE___BREAK__ || + c->opcode == OPCODE___CONTINUE__ || + c->opcode == OPCODE_THROW || + c->opcode == OPCODE_RETURNVOID || + c->opcode == OPCODE_RETURNVALUE) { + return 1; + } + return 0; +} + + +#define IS_FINALLY_TARGET(op) \ + ((op) == OPCODE___CONTINUE__ || \ + (op) == OPCODE___BREAK__ || \ + (op) == OPCODE_RETURNVOID || \ + (op) == OPCODE_RETURNVALUE || \ + (op) == OPCODE___RETHROW__) + +static code_t* insert_finally_lookup(code_t*c, code_t*finally, int tempvar) +{ +#define NEED_EXTRA_STACK_ARG + code_t*finally_label = abc_nop(0); + NEW(lookupswitch_t, l); + //_lookupswitch + + code_t*i = c; + int count=0; + while(i) { + code_t*prev = i->prev; + if(IS_FINALLY_TARGET(i->opcode)) { + code_t*p = prev; + char needvalue=0; + if(i->opcode == OPCODE___RETHROW__ || + i->opcode == OPCODE_RETURNVALUE) { + if(i->opcode == OPCODE___RETHROW__) + i->opcode = OPCODE_THROW; + needvalue=1; + p = abc_coerce_a(p); + p = abc_setlocal(p, tempvar); + } + p = abc_pushbyte(p, count++); + p = abc_jump(p, finally_label); + code_t*target = p = abc_label(p); +#ifdef NEED_EXTRA_STACK_ARG + p = abc_pop(p); +#endif + if(needvalue) { + p = abc_getlocal(p, tempvar); + } + + p->next = i;i->prev = p; + list_append(l->targets, target); + } + i = prev; + } + + code_t*j,*f; + c = abc_pushbyte(c, -1); + c = code_append(c, finally_label); + c = code_append(c, finally); + +#ifdef NEED_EXTRA_STACK_ARG + c = abc_dup(c); +#endif + c = abc_lookupswitch(c, l); + c = l->def = abc_label(c); +#ifdef NEED_EXTRA_STACK_ARG + c = abc_pop(c); +#endif + + return c; +} + +static code_t* insert_finally_simple(code_t*c, code_t*finally, int tempvar) +{ + code_t*i = c; + while(i) { + code_t*prev = i->prev; + if(IS_FINALLY_TARGET(i->opcode)) { + if(i->opcode == OPCODE___RETHROW__) + i->opcode = OPCODE_THROW; + code_t*end = code_dup(finally); + code_t*start = code_start(end); + if(prev) prev->next = start; + start->prev = prev; + i->prev = end; + end->next = i; + } + i = prev; + } + return code_append(c, finally); +} + +code_t* insert_finally(code_t*c, code_t*finally, int tempvar) +{ + if(!finally) + return c; + code_t*i = c; + char cantdup=0; + int num_insertion_points=0; + while(i) { + if(IS_FINALLY_TARGET(i->opcode)) + num_insertion_points++; + i = i->prev; + } + i = finally; + int code_size=0; + while(i) { + code_size++; + if(i->branch || i->opcode == OPCODE_LOOKUPSWITCH) { + cantdup=1; + } + i = i->prev; + } + int simple_version_cost = (1+num_insertion_points)*code_size; + int lookup_version_cost = 4*num_insertion_points + 5; + + if(cantdup || simple_version_cost > lookup_version_cost) { + printf("lookup %d > *%d*\n", simple_version_cost, lookup_version_cost); + return insert_finally_lookup(c, finally, tempvar); + } else { + printf("simple *%d* < %d\n", simple_version_cost, lookup_version_cost); + return insert_finally_simple(c, finally, tempvar); + } +} + + + +/* Line 264 of yacc.c */ +#line 1509 "parser.tab.c" + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int yyi) +#else +static int +YYID (yyi) + int yyi; +#endif +{ + return yyi; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 119 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 2463 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 130 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 105 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 285 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 478 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 360 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 116, 2, 2, 2, 114, 106, 2, + 126, 129, 113, 111, 97, 110, 123, 112, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 103, 96, + 107, 99, 108, 102, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 120, 2, 121, 105, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 122, 104, 128, 115, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 98, 100, 101, 109, 117, 118, 119, 124, 125, + 127 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint16 yyprhs[] = +{ + 0, 0, 3, 5, 6, 8, 10, 13, 15, 17, + 19, 21, 23, 25, 27, 28, 30, 32, 35, 37, + 39, 41, 43, 45, 47, 49, 50, 53, 55, 57, + 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, + 79, 81, 83, 85, 87, 89, 91, 93, 97, 100, + 103, 105, 107, 110, 111, 114, 117, 119, 123, 127, + 128, 131, 132, 140, 141, 143, 145, 149, 151, 154, + 158, 167, 174, 175, 182, 183, 191, 193, 196, 198, + 201, 202, 204, 206, 209, 211, 214, 219, 223, 224, + 233, 234, 244, 245, 251, 253, 256, 258, 261, 263, + 264, 271, 274, 276, 282, 284, 286, 290, 292, 293, + 300, 301, 307, 310, 315, 316, 318, 320, 323, 325, + 327, 329, 331, 333, 335, 337, 339, 341, 342, 345, + 346, 349, 350, 353, 354, 364, 365, 374, 375, 377, + 379, 382, 384, 386, 388, 390, 391, 393, 395, 398, + 400, 403, 412, 414, 416, 422, 423, 426, 428, 430, + 432, 434, 436, 438, 440, 442, 443, 445, 448, 453, + 457, 459, 464, 467, 469, 471, 472, 473, 486, 488, + 489, 499, 501, 505, 507, 509, 511, 515, 517, 519, + 521, 524, 525, 526, 530, 531, 533, 535, 539, 543, + 548, 553, 556, 558, 561, 563, 565, 569, 571, 573, + 575, 577, 579, 581, 583, 585, 587, 589, 591, 593, + 595, 597, 599, 601, 603, 605, 609, 613, 617, 621, + 625, 629, 633, 637, 641, 645, 648, 651, 655, 659, + 663, 667, 671, 675, 679, 683, 687, 691, 695, 699, + 703, 707, 711, 716, 719, 721, 725, 728, 733, 737, + 738, 740, 744, 750, 754, 758, 762, 766, 770, 774, + 778, 782, 786, 790, 794, 800, 803, 806, 809, 812, + 816, 820, 822, 826, 832, 838 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int16 yyrhs[] = +{ + 131, 0, -1, 132, -1, -1, 133, -1, 134, -1, + 133, 134, -1, 180, -1, 192, -1, 190, -1, 208, + -1, 201, -1, 143, -1, 96, -1, -1, 136, -1, + 137, -1, 136, 137, -1, 192, -1, 190, -1, 208, + -1, 201, -1, 143, -1, 96, -1, 139, -1, -1, + 139, 141, -1, 141, -1, 183, -1, 154, -1, 155, + -1, 156, -1, 158, -1, 166, -1, 149, -1, 177, + -1, 174, -1, 227, -1, 96, -1, 140, -1, 145, + -1, 160, -1, 161, -1, 224, -1, 176, -1, 233, + -1, 234, -1, 122, 139, 128, -1, 122, 128, -1, + 141, 96, -1, 141, -1, 140, -1, 99, 225, -1, + -1, 45, 146, -1, 31, 146, -1, 147, -1, 146, + 97, 147, -1, 3, 217, 144, -1, -1, 64, 142, + -1, -1, 63, 126, 150, 226, 129, 142, 148, -1, + -1, 145, -1, 227, -1, 45, 3, 217, -1, 3, + -1, 12, 126, -1, 12, 49, 126, -1, 153, 151, + 96, 226, 96, 227, 129, 142, -1, 153, 152, 67, + 226, 129, 142, -1, -1, 13, 126, 157, 226, 129, + 142, -1, -1, 14, 159, 142, 13, 126, 226, 129, + -1, 65, -1, 65, 3, -1, 29, -1, 29, 3, + -1, -1, 163, -1, 165, -1, 163, 165, -1, 164, + -1, 163, 164, -1, 33, 228, 103, 138, -1, 61, + 103, 138, -1, -1, 15, 126, 167, 228, 129, 122, + 162, 128, -1, -1, 32, 126, 3, 217, 129, 169, + 122, 138, 128, -1, -1, 27, 122, 171, 138, 128, + -1, 168, -1, 172, 168, -1, 172, -1, 172, 170, + -1, 170, -1, -1, 51, 122, 175, 138, 128, 173, + -1, 36, 226, -1, 36, -1, 38, 126, 226, 129, + 142, -1, 3, -1, 18, -1, 179, 123, 178, -1, + 178, -1, -1, 18, 179, 122, 181, 135, 128, -1, + -1, 18, 122, 182, 135, 128, -1, 40, 214, -1, + 40, 179, 123, 113, -1, -1, 185, -1, 186, -1, + 185, 186, -1, 20, -1, 21, -1, 19, -1, 37, + -1, 46, -1, 48, -1, 47, -1, 25, -1, 23, + -1, -1, 53, 214, -1, -1, 53, 215, -1, -1, + 16, 215, -1, -1, 184, 30, 3, 187, 189, 122, + 191, 194, 128, -1, -1, 184, 43, 3, 188, 122, + 193, 197, 128, -1, -1, 195, -1, 196, -1, 195, + 196, -1, 96, -1, 201, -1, 208, -1, 140, -1, + -1, 198, -1, 199, -1, 198, 199, -1, 96, -1, + 45, 3, -1, 184, 26, 207, 3, 126, 204, 129, + 217, -1, 45, -1, 31, -1, 184, 200, 3, 217, + 144, -1, -1, 99, 203, -1, 9, -1, 7, -1, + 8, -1, 11, -1, 4, -1, 55, -1, 54, -1, + 44, -1, -1, 205, -1, 90, 206, -1, 205, 97, + 90, 206, -1, 205, 97, 206, -1, 206, -1, 3, + 103, 216, 202, -1, 3, 202, -1, 50, -1, 34, + -1, -1, -1, 184, 26, 207, 3, 126, 204, 129, + 217, 122, 209, 138, 128, -1, 3, -1, -1, 26, + 210, 126, 204, 129, 217, 122, 138, 128, -1, 3, + -1, 179, 123, 3, -1, 213, -1, 212, -1, 214, + -1, 215, 97, 214, -1, 214, -1, 113, -1, 35, + -1, 103, 216, -1, -1, -1, 126, 219, 129, -1, + -1, 220, -1, 225, -1, 220, 97, 225, -1, 24, + 212, 218, -1, 228, 126, 219, 129, -1, 52, 126, + 219, 129, -1, 62, 228, -1, 41, -1, 41, 226, + -1, 228, -1, 228, -1, 226, 97, 228, -1, 226, + -1, 211, -1, 229, -1, 232, -1, 221, -1, 223, + -1, 5, -1, 9, -1, 10, -1, 7, -1, 8, + -1, 11, -1, 4, -1, 28, -1, 55, -1, 54, + -1, 44, -1, 222, -1, 228, 107, 228, -1, 228, + 108, 228, -1, 228, 73, 228, -1, 228, 74, 228, + -1, 228, 69, 228, -1, 228, 70, 228, -1, 228, + 72, 228, -1, 228, 71, 228, -1, 228, 84, 228, + -1, 228, 85, 228, -1, 116, 228, -1, 115, 228, + -1, 228, 106, 228, -1, 228, 105, 228, -1, 228, + 104, 228, -1, 228, 93, 228, -1, 228, 92, 228, + -1, 228, 91, 228, -1, 228, 112, 228, -1, 228, + 114, 228, -1, 228, 111, 228, -1, 228, 110, 228, + -1, 228, 113, 228, -1, 228, 67, 228, -1, 228, + 68, 228, -1, 228, 39, 228, -1, 228, 66, 228, + -1, 42, 126, 228, 129, -1, 35, 228, -1, 35, + -1, 126, 226, 129, -1, 110, 228, -1, 228, 120, + 228, 121, -1, 120, 219, 121, -1, -1, 231, -1, + 225, 103, 225, -1, 231, 97, 225, 103, 225, -1, + 122, 230, 128, -1, 228, 78, 228, -1, 228, 77, + 228, -1, 228, 82, 228, -1, 228, 81, 228, -1, + 228, 83, 228, -1, 228, 76, 228, -1, 228, 75, + 228, -1, 228, 79, 228, -1, 228, 80, 228, -1, + 228, 99, 228, -1, 228, 102, 228, 103, 228, -1, + 228, 88, -1, 228, 87, -1, 88, 228, -1, 87, + 228, -1, 52, 123, 3, -1, 228, 123, 3, -1, + 3, -1, 184, 17, 3, -1, 184, 17, 3, 99, + 3, -1, 184, 17, 3, 99, 4, -1, 22, 17, + 3, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 1484, 1484, 1486, 1486, 1487, 1488, 1490, 1491, 1492, + 1493, 1494, 1495, 1496, 1498, 1498, 1499, 1500, 1502, 1503, + 1504, 1505, 1506, 1507, 1509, 1510, 1512, 1513, 1516, 1517, + 1518, 1519, 1520, 1521, 1522, 1523, 1524, 1525, 1528, 1529, + 1530, 1531, 1532, 1533, 1534, 1536, 1537, 1539, 1540, 1541, + 1542, 1546, 1552, 1553, 1557, 1558, 1560, 1561, 1563, 1604, + 1605, 1608, 1608, 1627, 1628, 1629, 1632, 1635, 1639, 1640, + 1642, 1662, 1705, 1705, 1724, 1724, 1739, 1742, 1745, 1748, + 1752, 1753, 1754, 1755, 1756, 1757, 1759, 1770, 1773, 1773, + 1802, 1802, 1822, 1822, 1839, 1840, 1841, 1842, 1850, 1859, + 1859, 1904, 1908, 1919, 1928, 1929, 1931, 1932, 1934, 1934, + 1935, 1935, 1937, 1945, 1955, 1956, 1957, 1958, 1960, 1961, + 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1970, 1971, 1973, + 1974, 1976, 1977, 1981, 1979, 1987, 1985, 1993, 1994, 1995, + 1996, 1997, 1998, 1999, 2001, 2007, 2008, 2009, 2010, 2011, + 2012, 2015, 2026, 2026, 2028, 2086, 2087, 2089, 2090, 2091, + 2092, 2093, 2095, 2096, 2097, 2102, 2105, 2110, 2115, 2122, + 2126, 2131, 2137, 2143, 2144, 2145, 2148, 2147, 2165, 2166, + 2167, 2175, 2182, 2188, 2189, 2191, 2192, 2194, 2195, 2196, + 2205, 2206, 2210, 2211, 2213, 2214, 2215, 2218, 2223, 2247, + 2295, 2315, 2336, 2339, 2346, 2347, 2348, 2354, 2360, 2362, + 2364, 2366, 2368, 2370, 2387, 2392, 2395, 2398, 2401, 2404, + 2407, 2410, 2413, 2416, 2420, 2421, 2424, 2427, 2430, 2433, + 2436, 2439, 2442, 2446, 2457, 2475, 2480, 2485, 2490, 2495, + 2500, 2504, 2508, 2513, 2517, 2521, 2530, 2539, 2549, 2554, + 2566, 2572, 2577, 2583, 2589, 2593, 2595, 2606, 2615, 2622, + 2623, 2625, 2631, 2640, 2647, 2659, 2665, 2671, 2677, 2683, + 2689, 2695, 2708, 2719, 2726, 2739, 2766, 2780, 2794, 2808, + 2823, 2857, 2944, 2945, 2946, 2948 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "T_IDENTIFIER", "T_STRING", "T_REGEXP", + "T_EMPTY", "T_INT", "T_UINT", "T_BYTE", "T_SHORT", "T_FLOAT", "\"for\"", + "\"while\"", "\"do\"", "\"switch\"", "\"implements\"", "\"namespace\"", + "\"package\"", "\"protected\"", "\"public\"", "\"private\"", "\"use\"", + "\"internal\"", "\"new\"", "\"native\"", "\"function\"", "\"finally\"", + "\"undefined\"", "\"continue\"", "\"class\"", "\"const\"", "\"catch\"", + "\"case\"", "\"set\"", "\"void\"", "\"throw\"", "\"static\"", "\"with\"", + "\"instanceof\"", "\"import\"", "\"return\"", "\"typeof\"", + "\"interface\"", "\"null\"", "\"var\"", "\"dynamic\"", "\"override\"", + "\"final\"", "\"each\"", "\"get\"", "\"try\"", "\"super\"", + "\"extends\"", "\"false\"", "\"true\"", "\"Boolean\"", "\"uint\"", + "\"int\"", "\"Number\"", "\"String\"", "\"default\"", "\"delete\"", + "\"if\"", "\"else\"", "\"break\"", "\"is\"", "\"in\"", "\"as\"", + "\"==\"", "\"===\"", "\"!=\"", "\"!==\"", "\"<=\"", "\">=\"", "\"|=\"", + "\"/=\"", "\"%=\"", "\"*=\"", "\"+=\"", "\"-=\"", "\">>=\"", "\"<<=\"", + "\">>>=\"", "\"||\"", "\"&&\"", "\"::\"", "\"--\"", "\"++\"", "\"..\"", + "\"...\"", "\"<<\"", "\">>>\"", "\">>\"", "prec_none", "below_semicolon", + "';'", "','", "below_assignment", "'='", "\"&=\"", "\"^=\"", "'?'", + "':'", "'|'", "'^'", "'&'", "'<'", "'>'", "below_minus", "'-'", "'+'", + "'/'", "'*'", "'%'", "'~'", "'!'", "minusminus_prefix", + "plusplus_prefix", "below_curly", "'['", "']'", "'{'", "'.'", + "above_identifier", "below_else", "'('", "above_function", "'}'", "')'", + "$accept", "PROGRAM", "MAYBE_PROGRAM_CODE_LIST", "PROGRAM_CODE_LIST", + "PROGRAM_CODE", "MAYBE_INPACKAGE_CODE_LIST", "INPACKAGE_CODE_LIST", + "INPACKAGE_CODE", "MAYBECODE", "CODE", "CODE_STATEMENT", "CODEPIECE", + "CODEBLOCK", "PACKAGE_INITCODE", "MAYBEEXPRESSION", + "VARIABLE_DECLARATION", "VARIABLE_LIST", "ONE_VARIABLE", "MAYBEELSE", + "IF", "$@1", "FOR_INIT", "FOR_IN_INIT", "FOR_START", "FOR", "FOR_IN", + "WHILE", "$@2", "DO_WHILE", "$@3", "BREAK", "CONTINUE", + "MAYBE_CASE_LIST", "CASE_LIST", "CASE", "DEFAULT", "SWITCH", "$@4", + "CATCH", "$@5", "FINALLY", "$@6", "CATCH_LIST", "CATCH_FINALLY_LIST", + "TRY", "$@7", "THROW", "WITH", "X_IDENTIFIER", "PACKAGE", + "PACKAGE_DECLARATION", "$@8", "$@9", "IMPORT", "MAYBE_MODIFIERS", + "MODIFIER_LIST", "MODIFIER", "EXTENDS", "EXTENDS_LIST", + "IMPLEMENTS_LIST", "CLASS_DECLARATION", "$@10", "INTERFACE_DECLARATION", + "$@11", "MAYBE_CLASS_BODY", "CLASS_BODY", "CLASS_BODY_ITEM", + "MAYBE_INTERFACE_BODY", "INTERFACE_BODY", "IDECLARATION", "VARCONST", + "SLOT_DECLARATION", "MAYBESTATICCONSTANT", "STATICCONSTANT", + "MAYBE_PARAM_LIST", "PARAM_LIST", "PARAM", "GETSET", + "FUNCTION_DECLARATION", "$@12", "MAYBE_IDENTIFIER", "INNERFUNCTION", + "CLASS", "PACKAGEANDCLASS", "QNAME", "QNAME_LIST", "TYPE", "MAYBETYPE", + "MAYBE_PARAM_VALUES", "MAYBE_EXPRESSION_LIST", "EXPRESSION_LIST", "NEW", + "FUNCTIONCALL", "DELETE", "RETURN", "NONCOMMAEXPRESSION", "EXPRESSION", + "VOIDEXPRESSION", "E", "CONSTANT", "MAYBE_EXPRPAIR_LIST", + "EXPRPAIR_LIST", "VAR_READ", "NAMESPACE_DECLARATION", "USE_NAMESPACE", 0 +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 59, 44, 351, 61, + 352, 353, 63, 58, 124, 94, 38, 60, 62, 354, + 45, 43, 47, 42, 37, 126, 33, 355, 356, 357, + 91, 93, 123, 46, 358, 359, 40, 360, 125, 41 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 130, 131, 132, 132, 133, 133, 134, 134, 134, + 134, 134, 134, 134, 135, 135, 136, 136, 137, 137, + 137, 137, 137, 137, 138, 138, 139, 139, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 140, 141, 141, + 141, 141, 141, 141, 141, 141, 141, 142, 142, 142, + 142, 143, 144, 144, 145, 145, 146, 146, 147, 148, + 148, 150, 149, 151, 151, 151, 152, 152, 153, 153, + 154, 155, 157, 156, 159, 158, 160, 160, 161, 161, + 162, 162, 162, 162, 163, 163, 164, 165, 167, 166, + 169, 168, 171, 170, 172, 172, 173, 173, 173, 175, + 174, 176, 176, 177, 178, 178, 179, 179, 181, 180, + 182, 180, 183, 183, 184, 184, 185, 185, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 187, 187, 188, + 188, 189, 189, 191, 190, 193, 192, 194, 194, 195, + 195, 196, 196, 196, 196, 197, 197, 198, 198, 199, + 199, 199, 200, 200, 201, 202, 202, 203, 203, 203, + 203, 203, 203, 203, 203, 204, 204, 204, 204, 205, + 205, 206, 206, 207, 207, 207, 209, 208, 210, 210, + 211, 212, 213, 214, 214, 215, 215, 216, 216, 216, + 217, 217, 218, 218, 219, 219, 220, 220, 221, 222, + 222, 223, 224, 224, 225, 226, 226, 227, 228, 228, + 228, 228, 228, 228, 229, 229, 229, 229, 229, 229, + 229, 229, 229, 229, 228, 228, 228, 228, 228, 228, + 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, + 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, + 228, 228, 228, 228, 228, 228, 228, 228, 228, 230, + 230, 231, 231, 228, 228, 228, 228, 228, 228, 228, + 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, + 228, 232, 233, 233, 233, 234 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 1, 0, 1, 1, 2, 1, 1, 1, + 1, 1, 1, 1, 0, 1, 1, 2, 1, 1, + 1, 1, 1, 1, 1, 0, 2, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 3, 2, 2, + 1, 1, 2, 0, 2, 2, 1, 3, 3, 0, + 2, 0, 7, 0, 1, 1, 3, 1, 2, 3, + 8, 6, 0, 6, 0, 7, 1, 2, 1, 2, + 0, 1, 1, 2, 1, 2, 4, 3, 0, 8, + 0, 9, 0, 5, 1, 2, 1, 2, 1, 0, + 6, 2, 1, 5, 1, 1, 3, 1, 0, 6, + 0, 5, 2, 4, 0, 1, 1, 2, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 0, 2, 0, + 2, 0, 2, 0, 9, 0, 8, 0, 1, 1, + 2, 1, 1, 1, 1, 0, 1, 1, 2, 1, + 2, 8, 1, 1, 5, 0, 2, 1, 1, 1, + 1, 1, 1, 1, 1, 0, 1, 2, 4, 3, + 1, 4, 2, 1, 1, 0, 0, 12, 1, 0, + 9, 1, 3, 1, 1, 1, 3, 1, 1, 1, + 2, 0, 0, 3, 0, 1, 1, 3, 3, 4, + 4, 2, 1, 2, 1, 1, 3, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 2, 2, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 4, 2, 1, 3, 2, 4, 3, 0, + 1, 3, 5, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 5, 2, 2, 2, 2, 3, + 3, 1, 3, 5, 5, 3 +}; + +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const yytype_uint16 yydefact[] = +{ + 114, 281, 219, 213, 216, 217, 214, 215, 218, 0, + 0, 74, 0, 0, 120, 118, 119, 126, 0, 125, + 179, 220, 254, 121, 0, 0, 0, 223, 122, 124, + 123, 0, 0, 222, 221, 0, 0, 0, 0, 13, + 0, 0, 0, 194, 259, 0, 0, 2, 114, 5, + 51, 12, 34, 63, 29, 30, 31, 32, 33, 36, + 35, 7, 28, 0, 115, 116, 9, 8, 11, 10, + 208, 211, 224, 212, 207, 37, 205, 209, 210, 0, + 68, 72, 114, 88, 104, 105, 110, 107, 0, 181, + 192, 178, 0, 253, 0, 181, 0, 184, 183, 112, + 0, 99, 0, 194, 201, 61, 278, 277, 256, 236, + 235, 0, 195, 196, 204, 0, 0, 260, 0, 1, + 6, 281, 0, 0, 64, 0, 0, 65, 175, 0, + 153, 0, 152, 0, 117, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 276, 275, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 194, 69, 0, 0, + 78, 102, 202, 0, 76, 38, 114, 39, 50, 0, + 40, 41, 42, 44, 0, 43, 45, 46, 0, 114, + 108, 0, 194, 198, 165, 0, 0, 0, 25, 279, + 0, 0, 258, 0, 0, 263, 0, 255, 191, 55, + 56, 191, 54, 0, 0, 174, 173, 0, 127, 129, + 191, 206, 250, 251, 248, 249, 229, 230, 232, 231, + 227, 228, 270, 269, 265, 264, 271, 272, 267, 266, + 268, 233, 234, 242, 241, 240, 273, 0, 239, 238, + 237, 225, 226, 246, 245, 243, 247, 244, 0, 280, + 0, 0, 0, 79, 101, 203, 77, 48, 114, 27, + 205, 49, 0, 0, 0, 23, 0, 114, 16, 22, + 19, 18, 21, 20, 114, 106, 0, 155, 0, 0, + 166, 170, 114, 182, 113, 252, 0, 24, 200, 0, + 197, 261, 0, 0, 53, 0, 53, 0, 0, 0, + 0, 131, 0, 0, 53, 0, 257, 199, 114, 285, + 47, 26, 0, 282, 0, 111, 17, 0, 193, 0, + 0, 172, 167, 191, 0, 103, 0, 114, 0, 189, + 188, 0, 187, 190, 0, 58, 57, 0, 114, 165, + 128, 0, 0, 185, 130, 135, 154, 274, 73, 0, + 0, 80, 109, 161, 158, 159, 157, 160, 164, 163, + 162, 156, 155, 0, 0, 169, 0, 0, 94, 98, + 96, 100, 59, 262, 0, 52, 0, 71, 0, 132, + 133, 0, 114, 75, 283, 284, 0, 0, 0, 81, + 84, 82, 171, 25, 168, 92, 0, 95, 97, 114, + 62, 114, 191, 114, 186, 0, 149, 0, 0, 114, + 147, 0, 25, 89, 85, 83, 0, 25, 191, 60, + 70, 0, 141, 144, 0, 0, 114, 139, 142, 143, + 150, 175, 136, 148, 25, 87, 180, 0, 0, 176, + 134, 140, 0, 86, 93, 90, 25, 0, 0, 0, + 165, 25, 177, 0, 0, 191, 91, 151 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 46, 47, 48, 49, 286, 287, 288, 306, 307, + 187, 279, 189, 289, 355, 190, 222, 220, 420, 52, + 211, 125, 126, 53, 54, 55, 56, 178, 57, 82, + 191, 192, 408, 409, 410, 411, 58, 198, 388, 468, + 389, 437, 390, 391, 59, 208, 193, 60, 87, 351, + 61, 294, 199, 62, 194, 64, 65, 321, 323, 362, + 290, 423, 291, 402, 445, 446, 447, 428, 429, 430, + 133, 292, 341, 381, 299, 300, 301, 227, 293, 466, + 92, 70, 97, 98, 352, 364, 353, 314, 203, 111, + 112, 71, 72, 73, 195, 113, 74, 75, 76, 77, + 116, 117, 78, 196, 197 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -308 +static const yytype_int16 yypact[] = +{ + 349, -308, -308, -308, -308, -308, -308, -308, -308, -38, + -86, -308, -72, 35, -308, -308, -308, -308, 30, -308, + 97, -308, 52, -308, -14, 18, 36, -308, -308, -308, + -308, 57, 44, -308, -308, 1538, 40, 1538, 1538, -308, + 1538, 1538, 1538, 1538, 1538, 1538, 102, -308, 473, -308, + -308, -308, -308, 211, -308, -308, -308, -308, -308, -308, + -308, -308, -308, 275, 640, -308, -308, -308, -308, -308, + -308, -308, -308, -308, 96, -308, 1971, -308, -308, 82, + -308, -308, 1469, -308, -308, -308, -308, -308, -32, -308, + 83, -308, 84, 104, 1538, 88, 89, -308, -308, -308, + 1538, -308, 186, 1538, 104, -308, 104, 104, 163, 104, + 104, 108, 116, -308, 1971, 114, 105, 128, -88, -308, + -308, 165, 231, 233, -308, 144, 174, -308, -5, 240, + -308, 241, -308, 244, -308, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, -308, -308, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 245, 1538, -308, 1538, 232, + 255, 1538, 1538, 231, 256, -308, 593, -308, 164, 248, + -308, -308, -308, -308, 247, -308, -308, -308, 1538, 845, + -308, 90, 1538, -308, 9, -82, 68, 1599, 1349, -308, + 138, 1538, -308, 1538, 1538, -308, 1538, -308, 166, 171, + -308, 166, 171, 1538, 1538, -308, -308, 267, 219, 221, + 166, 1971, 962, 836, 836, 836, 2337, 2337, 2337, 2337, + 962, 962, 1971, 1971, 1971, 1971, 1971, 1971, 1971, 1971, + 1971, 2032, 2093, 340, 340, 340, 1971, 1727, 2154, 2215, + 2276, 962, 962, 163, 163, 104, 104, 104, 1788, -308, + 149, -62, 276, -308, 96, 96, -308, -308, 719, -308, + 1849, -308, 154, 278, 1663, -308, 156, 971, -308, -308, + -308, -308, -308, -308, 845, -308, 161, -69, 282, 167, + 195, -308, 1469, 88, -308, -308, 169, 1349, -308, -55, + -308, -308, 190, 63, 204, 231, -24, 86, 74, 178, + 18, 292, 18, 187, 204, 1538, -308, -308, 1469, -308, + -308, -308, 1538, 213, 188, -308, -308, 185, -308, 61, + 63, -308, -308, 166, 11, -308, 62, 1469, 1538, -308, + -308, 191, -308, -308, 1538, -308, -308, 1538, 1469, 9, + -308, 18, 194, -308, 220, -308, -308, 1971, -308, 76, + 182, 136, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, 224, 197, 282, -308, 202, 199, -308, -308, + 62, -308, 265, -308, 92, -308, 203, -308, 205, 220, + -308, 18, 394, -308, -308, -308, 1538, 235, 207, 136, + -308, -308, -308, 1349, -308, -308, 336, -308, -308, 1469, + -308, 1469, 166, 1097, -308, 337, -308, 316, 216, 529, + -308, 1910, 1349, -308, -308, -308, 218, 1349, 166, -308, + -308, 225, -308, -308, 66, 222, 1223, -308, -308, -308, + -308, -5, -308, -308, 1349, -308, -308, 223, 226, -308, + -308, -308, 345, -308, -308, -308, 1349, 239, 249, 238, + 9, 1349, -308, 246, 250, 166, -308, -308 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -308, -308, -308, -308, 328, 85, -308, 93, -209, 196, + 1, -76, -244, 16, 59, 332, 268, 77, -308, -308, + -308, -308, -308, -308, -308, -308, -308, -308, -308, -308, + -308, -308, -308, -308, -15, -11, -308, -308, 15, -308, + 17, -308, -308, -308, -308, -308, -308, -308, -193, 19, + -308, -308, -308, -308, 0, -308, 335, -308, -308, -308, + 31, -308, 39, -308, -308, -308, -40, -308, -308, -21, + -308, 2, 27, -308, -307, -308, -271, -41, 3, -308, + -308, -308, 398, -308, -20, 60, 78, -184, -308, -93, + -308, -308, -308, -308, -308, -26, -17, -46, -18, -308, + -308, -308, -308, -308, -308 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -205 +static const yytype_int16 yytable[] = +{ + 63, 50, 68, 69, 93, 99, 188, 127, 295, 135, + 210, 79, 297, 295, 297, 135, 51, 104, 115, 106, + 107, 95, 108, 109, 110, 114, 114, 342, 118, 225, + 339, 66, 88, 89, 340, 135, 85, 316, 84, 67, + 81, 217, 135, -66, 96, 226, 324, 302, 63, 50, + 68, 69, 398, 85, 83, 1, 2, 3, 345, 4, + 5, 6, 7, 8, 51, 373, 95, 328, 374, 375, + 376, 303, 377, 385, 347, 354, 18, 205, 20, 66, + 21, 85, 207, 270, 368, 114, 85, 67, 80, 386, + 200, 201, 128, 84, 387, 303, 27, 130, 349, 298, + 91, 384, 119, 392, 32, 378, 33, 34, 85, 296, + 85, 132, 94, 414, 397, 379, 380, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 37, + 38, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 86, 114, 383, + 115, 271, 100, 473, 274, 275, 105, 102, 280, 406, + 103, 135, 43, 135, 44, 439, 350, 440, 45, 101, + 284, 304, 357, 135, 114, 404, 405, 310, 311, 209, + 312, 157, 158, 135, 309, 114, 114, 407, 114, 63, + 50, 295, 331, 358, 436, 403, 317, 318, 177, 202, + 204, -104, 206, 213, 121, 2, 3, 214, 4, 5, + 6, 7, 8, 455, 174, 216, 188, 175, 457, 212, + 176, 331, -67, 215, 218, 18, 221, 20, 441, 21, + 223, 224, 122, 228, 229, 463, 22, 230, 269, 272, + 157, 158, 188, 26, 458, 27, 123, 469, 273, 276, + 281, 282, 474, 32, 283, 33, 34, 308, 315, 313, + 319, 188, 320, 35, 322, 171, 172, 173, 327, 329, + 332, 333, 188, 174, 335, 297, 175, 63, 50, 176, + 338, 477, 344, 348, 63, 50, 343, 346, 37, 38, + 360, 128, 363, 354, 359, 129, 130, 367, 361, 365, + 371, 396, 370, 372, 394, 369, 400, 401, 131, 413, + 132, 40, 393, 339, 415, 416, 41, 42, 395, 419, + 114, 43, 421, 44, 422, 433, 114, 45, 432, 438, + 450, 363, 451, 188, 452, 188, 456, 459, 467, -3, + 460, 464, 1, 2, 3, 465, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 470, 472, 13, 14, 15, + 16, 471, 17, 18, 19, 475, 120, 21, 476, 337, + 336, 424, 278, 366, 22, 124, 23, 24, 431, 25, + 219, 26, 356, 27, 434, 28, 29, 30, 435, 134, + 31, 32, 427, 33, 34, 417, 461, 418, 453, 412, + 462, 35, 36, 14, 15, 16, 90, 17, 382, 19, + 0, 399, 0, 444, 443, 448, 449, 157, 158, 427, + 0, 23, 0, 0, 0, 0, 37, 38, 0, 425, + 28, 29, 30, 0, 0, 39, 444, 443, 448, 449, + 169, 170, 171, 172, 173, 0, 0, 0, 0, 40, + 174, 0, 0, 175, 41, 42, 176, 0, 0, 43, + 0, 44, 0, -4, 0, 45, 1, 2, 3, 0, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 0, + 426, 13, 14, 15, 16, 0, 17, 18, 19, 0, + 0, 21, 0, 0, 0, 0, 0, 0, 22, 0, + 23, 24, 0, 25, 0, 26, 0, 27, 0, 28, + 29, 30, -145, 0, 31, 32, 0, 33, 34, 0, + 0, 0, 0, 0, 0, 35, 36, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 14, 15, + 16, 0, 17, 0, 19, 0, 0, 0, 0, 0, + 37, 38, 0, 0, 0, 0, 23, 0, 0, 39, + 0, 0, 0, 0, 425, 28, 29, 30, 0, 0, + 0, 0, 0, 40, 0, 0, 0, 0, 41, 42, + 0, 0, 0, 43, 0, 44, 1, 2, 3, 45, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 0, + 0, 0, 14, 15, 16, 179, 17, 18, 19, 20, + 0, 21, 180, 0, 122, 426, 0, 0, 22, 181, + 23, 24, 0, 25, 182, 26, 0, 27, 183, 28, + 29, 30, 0, 0, 31, 32, 0, 33, 34, 0, + 0, 0, 0, 0, 0, 35, 36, -146, 184, 14, + 15, 16, 0, 17, 0, 19, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, + 37, 38, 0, 0, 0, 0, 28, 29, 30, 185, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 40, 0, 0, 0, 0, 41, 42, + 0, 0, 0, 43, 0, 44, 0, 0, 0, 45, + 0, 277, 1, 2, 3, 0, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 0, 0, 0, 14, 15, + 16, 179, 17, 18, 19, 20, 0, 21, 180, 0, + 122, 0, 0, 0, 22, 181, 23, 24, 0, 25, + 182, 26, 0, 27, 183, 28, 29, 30, 0, 0, + 31, 32, 0, 33, 34, 0, 0, 0, 0, 0, + 0, 35, 36, 0, 184, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 37, 38, 0, 0, + 0, 0, 0, 0, 0, 185, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, + 0, 0, 0, 0, 41, 42, 0, 0, 0, 43, + 0, 44, 0, 0, 0, 45, 0, 330, 1, 2, + 3, 0, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 0, 0, 0, 14, 15, 16, 0, 17, 18, + 19, 0, 0, 21, 0, 136, 0, 0, 0, 0, + 22, 0, 23, 24, 0, 25, 0, 26, 0, 27, + 0, 28, 29, 30, 0, 0, 31, 32, 0, 33, + 34, 0, -205, -205, -205, 0, 0, 35, 36, 144, + 145, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 157, 158, 0, 0, 159, 160, 161, + 0, 0, 37, 38, 0, 0, 0, 0, 0, 0, + 0, 285, 0, 167, 168, 0, 169, 170, 171, 172, + 173, 0, 0, 0, 0, 40, 174, 0, 0, 175, + 41, 42, 176, 0, 0, 43, 0, 44, 0, 0, + 0, 45, 0, -14, 1, 2, 3, 0, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 0, 0, 0, + 14, 15, 16, 0, 17, 18, 19, 0, 0, 21, + 0, -205, 0, 0, 0, 0, 22, 0, 23, 24, + 0, 25, 0, 26, 0, 27, 0, 28, 29, 30, + 0, 0, 31, 32, 0, 33, 34, 0, 0, 0, + 0, 0, 0, 35, 36, -205, -205, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 157, + 158, 0, 0, 159, 160, 161, 0, 0, 37, 38, + 0, 0, 0, 0, 0, 0, 0, 285, 0, -205, + -205, 0, 169, 170, 171, 172, 173, 0, 0, 0, + 0, 40, 174, 0, 0, 175, 41, 42, 176, 0, + 0, 43, 0, 44, 0, 0, 0, 45, 0, -15, + 1, 2, 3, 0, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 0, 0, 0, 14, 15, 16, 0, + 17, 18, 19, 0, 0, 21, 0, 0, 0, 0, + 0, 0, 22, 0, 23, 24, 0, 25, 0, 26, + 0, 27, 0, 28, 29, 30, 0, 0, 31, 32, + 0, 33, 34, 0, 0, 0, 0, 0, 0, 35, + 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 37, 38, 0, 0, 0, 0, + 0, 0, 0, 442, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, + 0, 0, 41, 42, 0, 0, 0, 43, 0, 44, + 0, 0, 0, 45, 0, -137, 1, 2, 3, 0, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 0, + 0, 0, 14, 15, 16, 0, 17, 18, 19, 0, + 0, 21, 0, 0, 0, 0, 0, 0, 22, 0, + 23, 24, 0, 25, 0, 26, 0, 27, 0, 28, + 29, 30, 0, 0, 31, 32, 0, 33, 34, 0, + 0, 0, 0, 0, 0, 35, 36, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 37, 38, 0, 0, 0, 0, 0, 0, 0, 442, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 40, 0, 0, 0, 0, 41, 42, + 0, 0, 0, 43, 0, 44, 0, 0, 0, 45, + 0, -138, 1, 2, 3, 0, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 0, -114, 0, 14, 15, + 16, 179, 17, 18, 19, 20, 0, 21, 180, 0, + 122, 0, 0, 0, 22, 181, 23, 24, 0, 25, + 182, 26, 0, 27, 183, 28, 29, 30, 0, 0, + 31, 32, 0, 33, 34, 0, 0, 0, 0, 0, + 0, 35, 36, 0, 184, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 37, 38, 0, 0, + 0, 0, 0, 0, 0, 185, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, + 0, 0, 0, 0, 41, 42, 0, 0, 0, 43, + 0, 44, 1, 2, 3, 45, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 0, 0, 0, 14, 15, + 16, 179, 17, 18, 19, 20, 0, 21, 180, 0, + 122, 0, 0, 0, 22, 181, 23, 24, 0, 25, + 182, 26, 0, 27, 183, 28, 29, 30, 0, 0, + 31, 32, 0, 33, 34, 0, 0, 0, 0, 0, + 0, 35, 36, 0, 184, 0, 0, 0, 0, 0, + 0, 1, 2, 3, 0, 4, 5, 6, 7, 8, + 0, 0, 0, 0, 0, 0, 37, 38, 0, 0, + 0, 0, 18, 0, 20, 185, 21, 0, 0, 0, + 0, 0, 0, 22, 0, 0, 0, 0, 0, 40, + 26, 0, 27, 0, 41, 42, 0, 0, 0, 43, + 32, 186, 33, 34, 0, 45, 0, 0, 0, 0, + 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 37, 38, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 136, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, + 0, 0, 0, 41, 42, 0, 0, 0, 43, 0, + 44, 0, 0, 0, 45, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 0, 157, 158, 0, 0, + 159, 160, 161, 0, 0, 0, 0, 0, 162, 0, + 0, 163, 136, 164, 165, 166, 167, 168, 0, 169, + 170, 171, 172, 173, 0, 0, 0, 0, 0, 174, + 0, 0, 175, 0, 0, 176, 0, 0, 305, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 0, + 157, 158, 0, 0, 159, 160, 161, 0, 0, 0, + 0, 0, 162, 0, 0, 163, 136, 164, 165, 166, + 167, 168, 0, 169, 170, 171, 172, 173, 0, 0, + 0, 0, 0, 174, 0, 0, 175, 0, 0, 176, + 0, 0, 334, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 0, 157, 158, 0, 0, 159, 160, + 161, 0, 0, 0, 0, 0, 162, 136, 0, 163, + 325, 164, 165, 166, 167, 168, 0, 169, 170, 171, + 172, 173, 0, 0, 0, 0, 0, 174, 0, 0, + 175, 0, 0, 176, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 0, 157, 158, 0, 0, 159, + 160, 161, 0, 0, 0, 0, 0, 162, 136, 0, + 163, 0, 164, 165, 166, 167, 168, 0, 169, 170, + 171, 172, 173, 0, 0, 0, 0, 0, 174, 326, + 0, 175, 0, 0, 176, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 0, 157, 158, 0, 0, + 159, 160, 161, 0, 0, 0, 0, 0, 162, 136, + 0, 163, -204, 164, 165, 166, 167, 168, 0, 169, + 170, 171, 172, 173, 0, 0, 0, 0, 0, 174, + 0, 0, 175, 0, 0, 176, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 0, 157, 158, 0, + 0, 159, 160, 161, 0, 0, 0, 0, 0, 162, + 136, 0, 163, 454, 164, 165, 166, 167, 168, 0, + 169, 170, 171, 172, 173, 0, 0, 0, 0, 0, + 174, 0, 0, 175, 0, 0, 176, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 0, 157, 158, + 0, 0, 159, 160, 161, 0, 0, 0, 0, 0, + 162, 136, 0, 163, 0, 164, 165, 166, 167, 168, + 0, 169, 170, 171, 172, 173, 0, 0, 0, 0, + 0, 174, 0, 0, 175, 0, 0, 176, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 156, 0, 157, + 158, 0, 0, 159, 160, 161, 0, 0, 0, 0, + 0, 0, 136, 0, 0, 0, 164, 165, 166, 167, + 168, 0, 169, 170, 171, 172, 173, 0, 0, 0, + 0, 0, 174, 0, 0, 175, 0, 0, 176, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 157, 158, 0, 0, 159, 160, 161, 0, 0, 0, + 0, 0, 0, 136, 0, 0, 0, 164, 165, 166, + 167, 168, 0, 169, 170, 171, 172, 173, 0, 0, + 0, 0, 0, 174, 0, 0, 175, 0, 0, 176, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 157, 158, 0, 0, 159, 160, 161, 0, 0, + 0, 0, 0, 0, 136, 0, 0, 0, 0, 165, + 166, 167, 168, 0, 169, 170, 171, 172, 173, 0, + 0, 0, 0, 0, 174, 0, 0, 175, 0, 0, + 176, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 157, 158, 0, 0, 159, 160, 161, 0, + 0, 0, 0, 0, 0, 136, 0, 0, 0, 0, + 0, 166, 167, 168, 0, 169, 170, 171, 172, 173, + 0, 0, 0, 0, 0, 174, 0, 0, 175, 0, + 0, 176, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 157, 158, 0, 0, 159, 160, 161, + 0, 0, 0, 0, 0, 0, 136, 0, 0, 0, + 0, 0, -205, 167, 168, 0, 169, 170, 171, 172, + 173, 0, 0, 0, 0, 0, 174, 0, 0, 175, + 0, 0, 176, 137, 138, 139, -205, -205, -205, -205, + 144, 145, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 157, 158, 0, 0, 159, 160, + 161, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 167, 168, 0, 169, 170, 171, + 172, 173, 0, 0, 0, 0, 0, 174, 0, 0, + 175, 0, 0, 176 +}; + +static const yytype_int16 yycheck[] = +{ + 0, 0, 0, 0, 22, 25, 82, 53, 201, 97, + 103, 49, 3, 206, 3, 97, 0, 35, 44, 37, + 38, 3, 40, 41, 42, 43, 44, 298, 45, 34, + 99, 0, 13, 3, 103, 97, 18, 221, 3, 0, + 126, 129, 97, 67, 25, 50, 230, 129, 48, 48, + 48, 48, 359, 18, 126, 3, 4, 5, 302, 7, + 8, 9, 10, 11, 48, 4, 3, 129, 7, 8, + 9, 3, 11, 344, 129, 99, 24, 94, 26, 48, + 28, 18, 100, 176, 328, 103, 18, 48, 126, 27, + 122, 123, 26, 3, 32, 3, 44, 31, 35, 90, + 3, 90, 0, 347, 52, 44, 54, 55, 18, 202, + 18, 45, 126, 384, 358, 54, 55, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 87, + 88, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 122, 176, 343, + 186, 178, 126, 470, 181, 182, 126, 123, 186, 33, + 126, 97, 120, 97, 122, 419, 113, 421, 126, 122, + 198, 113, 96, 97, 202, 3, 4, 213, 214, 3, + 216, 87, 88, 97, 211, 213, 214, 61, 216, 199, + 199, 394, 278, 129, 413, 129, 223, 224, 126, 126, + 126, 123, 123, 97, 3, 4, 5, 103, 7, 8, + 9, 10, 11, 432, 120, 97, 302, 123, 437, 121, + 126, 307, 67, 128, 3, 24, 3, 26, 422, 28, + 96, 67, 31, 3, 3, 454, 35, 3, 3, 17, + 87, 88, 328, 42, 438, 44, 45, 466, 3, 3, + 96, 13, 471, 52, 17, 54, 55, 129, 97, 103, + 3, 347, 53, 62, 53, 112, 113, 114, 129, 3, + 126, 3, 358, 120, 128, 3, 123, 287, 287, 126, + 129, 475, 97, 103, 294, 294, 129, 128, 87, 88, + 320, 26, 322, 99, 126, 30, 31, 325, 16, 122, + 122, 357, 99, 128, 123, 332, 122, 97, 43, 122, + 45, 110, 348, 99, 122, 126, 115, 116, 354, 64, + 348, 120, 129, 122, 129, 128, 354, 126, 103, 3, + 3, 361, 26, 419, 128, 421, 128, 122, 3, 0, + 128, 128, 3, 4, 5, 129, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 126, 128, 18, 19, 20, + 21, 122, 23, 24, 25, 129, 48, 28, 128, 294, + 287, 401, 186, 324, 35, 53, 37, 38, 406, 40, + 122, 42, 315, 44, 409, 46, 47, 48, 409, 64, + 51, 52, 402, 54, 55, 390, 446, 390, 429, 382, + 451, 62, 63, 19, 20, 21, 18, 23, 340, 25, + -1, 361, -1, 423, 423, 423, 423, 87, 88, 429, + -1, 37, -1, -1, -1, -1, 87, 88, -1, 45, + 46, 47, 48, -1, -1, 96, 446, 446, 446, 446, + 110, 111, 112, 113, 114, -1, -1, -1, -1, 110, + 120, -1, -1, 123, 115, 116, 126, -1, -1, 120, + -1, 122, -1, 0, -1, 126, 3, 4, 5, -1, + 7, 8, 9, 10, 11, 12, 13, 14, 15, -1, + 96, 18, 19, 20, 21, -1, 23, 24, 25, -1, + -1, 28, -1, -1, -1, -1, -1, -1, 35, -1, + 37, 38, -1, 40, -1, 42, -1, 44, -1, 46, + 47, 48, 128, -1, 51, 52, -1, 54, 55, -1, + -1, -1, -1, -1, -1, 62, 63, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 19, 20, + 21, -1, 23, -1, 25, -1, -1, -1, -1, -1, + 87, 88, -1, -1, -1, -1, 37, -1, -1, 96, + -1, -1, -1, -1, 45, 46, 47, 48, -1, -1, + -1, -1, -1, 110, -1, -1, -1, -1, 115, 116, + -1, -1, -1, 120, -1, 122, 3, 4, 5, 126, + 7, 8, 9, 10, 11, 12, 13, 14, 15, -1, + -1, -1, 19, 20, 21, 22, 23, 24, 25, 26, + -1, 28, 29, -1, 31, 96, -1, -1, 35, 36, + 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, + 47, 48, -1, -1, 51, 52, -1, 54, 55, -1, + -1, -1, -1, -1, -1, 62, 63, 128, 65, 19, + 20, 21, -1, 23, -1, 25, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 37, -1, -1, + 87, 88, -1, -1, -1, -1, 46, 47, 48, 96, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 110, -1, -1, -1, -1, 115, 116, + -1, -1, -1, 120, -1, 122, -1, -1, -1, 126, + -1, 128, 3, 4, 5, -1, 7, 8, 9, 10, + 11, 12, 13, 14, 15, -1, -1, -1, 19, 20, + 21, 22, 23, 24, 25, 26, -1, 28, 29, -1, + 31, -1, -1, -1, 35, 36, 37, 38, -1, 40, + 41, 42, -1, 44, 45, 46, 47, 48, -1, -1, + 51, 52, -1, 54, 55, -1, -1, -1, -1, -1, + -1, 62, 63, -1, 65, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 87, 88, -1, -1, + -1, -1, -1, -1, -1, 96, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 110, + -1, -1, -1, -1, 115, 116, -1, -1, -1, 120, + -1, 122, -1, -1, -1, 126, -1, 128, 3, 4, + 5, -1, 7, 8, 9, 10, 11, 12, 13, 14, + 15, -1, -1, -1, 19, 20, 21, -1, 23, 24, + 25, -1, -1, 28, -1, 39, -1, -1, -1, -1, + 35, -1, 37, 38, -1, 40, -1, 42, -1, 44, + -1, 46, 47, 48, -1, -1, 51, 52, -1, 54, + 55, -1, 66, 67, 68, -1, -1, 62, 63, 73, + 74, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 87, 88, -1, -1, 91, 92, 93, + -1, -1, 87, 88, -1, -1, -1, -1, -1, -1, + -1, 96, -1, 107, 108, -1, 110, 111, 112, 113, + 114, -1, -1, -1, -1, 110, 120, -1, -1, 123, + 115, 116, 126, -1, -1, 120, -1, 122, -1, -1, + -1, 126, -1, 128, 3, 4, 5, -1, 7, 8, + 9, 10, 11, 12, 13, 14, 15, -1, -1, -1, + 19, 20, 21, -1, 23, 24, 25, -1, -1, 28, + -1, 39, -1, -1, -1, -1, 35, -1, 37, 38, + -1, 40, -1, 42, -1, 44, -1, 46, 47, 48, + -1, -1, 51, 52, -1, 54, 55, -1, -1, -1, + -1, -1, -1, 62, 63, 73, 74, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 87, + 88, -1, -1, 91, 92, 93, -1, -1, 87, 88, + -1, -1, -1, -1, -1, -1, -1, 96, -1, 107, + 108, -1, 110, 111, 112, 113, 114, -1, -1, -1, + -1, 110, 120, -1, -1, 123, 115, 116, 126, -1, + -1, 120, -1, 122, -1, -1, -1, 126, -1, 128, + 3, 4, 5, -1, 7, 8, 9, 10, 11, 12, + 13, 14, 15, -1, -1, -1, 19, 20, 21, -1, + 23, 24, 25, -1, -1, 28, -1, -1, -1, -1, + -1, -1, 35, -1, 37, 38, -1, 40, -1, 42, + -1, 44, -1, 46, 47, 48, -1, -1, 51, 52, + -1, 54, 55, -1, -1, -1, -1, -1, -1, 62, + 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 87, 88, -1, -1, -1, -1, + -1, -1, -1, 96, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 110, -1, -1, + -1, -1, 115, 116, -1, -1, -1, 120, -1, 122, + -1, -1, -1, 126, -1, 128, 3, 4, 5, -1, + 7, 8, 9, 10, 11, 12, 13, 14, 15, -1, + -1, -1, 19, 20, 21, -1, 23, 24, 25, -1, + -1, 28, -1, -1, -1, -1, -1, -1, 35, -1, + 37, 38, -1, 40, -1, 42, -1, 44, -1, 46, + 47, 48, -1, -1, 51, 52, -1, 54, 55, -1, + -1, -1, -1, -1, -1, 62, 63, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 87, 88, -1, -1, -1, -1, -1, -1, -1, 96, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 110, -1, -1, -1, -1, 115, 116, + -1, -1, -1, 120, -1, 122, -1, -1, -1, 126, + -1, 128, 3, 4, 5, -1, 7, 8, 9, 10, + 11, 12, 13, 14, 15, -1, 17, -1, 19, 20, + 21, 22, 23, 24, 25, 26, -1, 28, 29, -1, + 31, -1, -1, -1, 35, 36, 37, 38, -1, 40, + 41, 42, -1, 44, 45, 46, 47, 48, -1, -1, + 51, 52, -1, 54, 55, -1, -1, -1, -1, -1, + -1, 62, 63, -1, 65, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 87, 88, -1, -1, + -1, -1, -1, -1, -1, 96, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 110, + -1, -1, -1, -1, 115, 116, -1, -1, -1, 120, + -1, 122, 3, 4, 5, 126, 7, 8, 9, 10, + 11, 12, 13, 14, 15, -1, -1, -1, 19, 20, + 21, 22, 23, 24, 25, 26, -1, 28, 29, -1, + 31, -1, -1, -1, 35, 36, 37, 38, -1, 40, + 41, 42, -1, 44, 45, 46, 47, 48, -1, -1, + 51, 52, -1, 54, 55, -1, -1, -1, -1, -1, + -1, 62, 63, -1, 65, -1, -1, -1, -1, -1, + -1, 3, 4, 5, -1, 7, 8, 9, 10, 11, + -1, -1, -1, -1, -1, -1, 87, 88, -1, -1, + -1, -1, 24, -1, 26, 96, 28, -1, -1, -1, + -1, -1, -1, 35, -1, -1, -1, -1, -1, 110, + 42, -1, 44, -1, 115, 116, -1, -1, -1, 120, + 52, 122, 54, 55, -1, 126, -1, -1, -1, -1, + 62, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 87, 88, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 39, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 110, -1, + -1, -1, -1, 115, 116, -1, -1, -1, 120, -1, + 122, -1, -1, -1, 126, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, -1, 87, 88, -1, -1, + 91, 92, 93, -1, -1, -1, -1, -1, 99, -1, + -1, 102, 39, 104, 105, 106, 107, 108, -1, 110, + 111, 112, 113, 114, -1, -1, -1, -1, -1, 120, + -1, -1, 123, -1, -1, 126, -1, -1, 129, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, -1, + 87, 88, -1, -1, 91, 92, 93, -1, -1, -1, + -1, -1, 99, -1, -1, 102, 39, 104, 105, 106, + 107, 108, -1, 110, 111, 112, 113, 114, -1, -1, + -1, -1, -1, 120, -1, -1, 123, -1, -1, 126, + -1, -1, 129, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, -1, 87, 88, -1, -1, 91, 92, + 93, -1, -1, -1, -1, -1, 99, 39, -1, 102, + 103, 104, 105, 106, 107, 108, -1, 110, 111, 112, + 113, 114, -1, -1, -1, -1, -1, 120, -1, -1, + 123, -1, -1, 126, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, -1, 87, 88, -1, -1, 91, + 92, 93, -1, -1, -1, -1, -1, 99, 39, -1, + 102, -1, 104, 105, 106, 107, 108, -1, 110, 111, + 112, 113, 114, -1, -1, -1, -1, -1, 120, 121, + -1, 123, -1, -1, 126, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, -1, 87, 88, -1, -1, + 91, 92, 93, -1, -1, -1, -1, -1, 99, 39, + -1, 102, 103, 104, 105, 106, 107, 108, -1, 110, + 111, 112, 113, 114, -1, -1, -1, -1, -1, 120, + -1, -1, 123, -1, -1, 126, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, -1, 87, 88, -1, + -1, 91, 92, 93, -1, -1, -1, -1, -1, 99, + 39, -1, 102, 103, 104, 105, 106, 107, 108, -1, + 110, 111, 112, 113, 114, -1, -1, -1, -1, -1, + 120, -1, -1, 123, -1, -1, 126, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, -1, 87, 88, + -1, -1, 91, 92, 93, -1, -1, -1, -1, -1, + 99, 39, -1, 102, -1, 104, 105, 106, 107, 108, + -1, 110, 111, 112, 113, 114, -1, -1, -1, -1, + -1, 120, -1, -1, 123, -1, -1, 126, 66, 67, + 68, 69, 70, 71, 72, 73, 74, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 85, -1, 87, + 88, -1, -1, 91, 92, 93, -1, -1, -1, -1, + -1, -1, 39, -1, -1, -1, 104, 105, 106, 107, + 108, -1, 110, 111, 112, 113, 114, -1, -1, -1, + -1, -1, 120, -1, -1, 123, -1, -1, 126, 66, + 67, 68, 69, 70, 71, 72, 73, 74, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 87, 88, -1, -1, 91, 92, 93, -1, -1, -1, + -1, -1, -1, 39, -1, -1, -1, 104, 105, 106, + 107, 108, -1, 110, 111, 112, 113, 114, -1, -1, + -1, -1, -1, 120, -1, -1, 123, -1, -1, 126, + 66, 67, 68, 69, 70, 71, 72, 73, 74, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 87, 88, -1, -1, 91, 92, 93, -1, -1, + -1, -1, -1, -1, 39, -1, -1, -1, -1, 105, + 106, 107, 108, -1, 110, 111, 112, 113, 114, -1, + -1, -1, -1, -1, 120, -1, -1, 123, -1, -1, + 126, 66, 67, 68, 69, 70, 71, 72, 73, 74, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 87, 88, -1, -1, 91, 92, 93, -1, + -1, -1, -1, -1, -1, 39, -1, -1, -1, -1, + -1, 106, 107, 108, -1, 110, 111, 112, 113, 114, + -1, -1, -1, -1, -1, 120, -1, -1, 123, -1, + -1, 126, 66, 67, 68, 69, 70, 71, 72, 73, + 74, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 87, 88, -1, -1, 91, 92, 93, + -1, -1, -1, -1, -1, -1, 39, -1, -1, -1, + -1, -1, 106, 107, 108, -1, 110, 111, 112, 113, + 114, -1, -1, -1, -1, -1, 120, -1, -1, 123, + -1, -1, 126, 66, 67, 68, 69, 70, 71, 72, + 73, 74, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 87, 88, -1, -1, 91, 92, + 93, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 107, 108, -1, 110, 111, 112, + 113, 114, -1, -1, -1, -1, -1, 120, -1, -1, + 123, -1, -1, 126 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 3, 4, 5, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 18, 19, 20, 21, 23, 24, 25, + 26, 28, 35, 37, 38, 40, 42, 44, 46, 47, + 48, 51, 52, 54, 55, 62, 63, 87, 88, 96, + 110, 115, 116, 120, 122, 126, 131, 132, 133, 134, + 140, 143, 149, 153, 154, 155, 156, 158, 166, 174, + 177, 180, 183, 184, 185, 186, 190, 192, 201, 208, + 211, 221, 222, 223, 226, 227, 228, 229, 232, 49, + 126, 126, 159, 126, 3, 18, 122, 178, 179, 3, + 212, 3, 210, 228, 126, 3, 179, 212, 213, 214, + 126, 122, 123, 126, 228, 126, 228, 228, 228, 228, + 228, 219, 220, 225, 228, 225, 230, 231, 226, 0, + 134, 3, 31, 45, 145, 151, 152, 227, 26, 30, + 31, 43, 45, 200, 186, 97, 39, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 87, 88, 91, + 92, 93, 99, 102, 104, 105, 106, 107, 108, 110, + 111, 112, 113, 114, 120, 123, 126, 126, 157, 22, + 29, 36, 41, 45, 65, 96, 122, 140, 141, 142, + 145, 160, 161, 176, 184, 224, 233, 234, 167, 182, + 122, 123, 126, 218, 126, 226, 123, 228, 175, 3, + 219, 150, 121, 97, 103, 128, 97, 129, 3, 146, + 147, 3, 146, 96, 67, 34, 50, 207, 3, 3, + 3, 228, 228, 228, 228, 228, 228, 228, 228, 228, + 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, + 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, + 228, 228, 228, 228, 228, 228, 228, 228, 228, 3, + 219, 226, 17, 3, 226, 226, 3, 128, 139, 141, + 228, 96, 13, 17, 228, 96, 135, 136, 137, 143, + 190, 192, 201, 208, 181, 178, 219, 3, 90, 204, + 205, 206, 129, 3, 113, 129, 138, 139, 129, 226, + 225, 225, 225, 103, 217, 97, 217, 226, 226, 3, + 53, 187, 53, 188, 217, 103, 121, 129, 129, 3, + 128, 141, 126, 3, 129, 128, 137, 135, 129, 99, + 103, 202, 206, 129, 97, 142, 128, 129, 103, 35, + 113, 179, 214, 216, 99, 144, 147, 96, 129, 126, + 214, 16, 189, 214, 215, 122, 144, 228, 142, 226, + 99, 122, 128, 4, 7, 8, 9, 11, 44, 54, + 55, 203, 216, 217, 90, 206, 27, 32, 168, 170, + 172, 173, 142, 225, 123, 225, 227, 142, 204, 215, + 122, 97, 193, 129, 3, 4, 33, 61, 162, 163, + 164, 165, 202, 122, 206, 122, 126, 168, 170, 64, + 148, 129, 129, 191, 214, 45, 96, 184, 197, 198, + 199, 228, 103, 128, 164, 165, 138, 171, 3, 142, + 142, 217, 96, 140, 184, 194, 195, 196, 201, 208, + 3, 26, 128, 199, 103, 138, 128, 138, 217, 122, + 128, 196, 207, 138, 128, 129, 209, 3, 169, 138, + 126, 122, 128, 204, 138, 129, 128, 217 +}; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ + +#define YYFAIL goto yyerrlab + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (YYID (0)) + + +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) +#endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#ifdef YYLEX_PARAM +# define YYLEX yylex (YYLEX_PARAM) +#else +# define YYLEX yylex () +#endif + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +#else +static void +yy_stack_print (yybottom, yytop) + yytype_int16 *yybottom; + yytype_int16 *yytop; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +#else +static void +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; + int yyrule; +#endif +{ + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static YYSIZE_T +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static char * +yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) +{ + int yyn = yypact[yystate]; + + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } +} +#endif /* YYERROR_VERBOSE */ + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + YYUSE (yyvaluep); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { + + default: + break; + } +} + +/* Prevent warnings from -Wmissing-prototypes. */ +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + +/* The lookahead symbol. */ +int yychar; + +/* The semantic value of the lookahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; + + + +/*-------------------------. +| yyparse or yypush_parse. | +`-------------------------*/ + +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void) +#else +int +yyparse () + +#endif +#endif +{ + + + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + /* The stacks and their tools: + `yyss': related to states. + `yyvs': related to semantic values. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + YYSIZE_T yystacksize; + + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + yytoken = 0; + yyss = yyssa; + yyvs = yyvsa; + yystacksize = YYINITDEPTH; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + yyssp = yyss; + yyvsp = yyvs; + + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token. */ + yychar = YYEMPTY; + + yystate = yyn; + *++yyvsp = yylval; + + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 24: + +/* Line 1455 of yacc.c */ +#line 1509 "parser.y" + {(yyval.code)=(yyvsp[(1) - (1)].code);;} + break; + + case 25: + +/* Line 1455 of yacc.c */ +#line 1510 "parser.y" + {(yyval.code)=code_new();;} + break; + + case 26: + +/* Line 1455 of yacc.c */ +#line 1512 "parser.y" + {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));;} + break; + + case 27: + +/* Line 1455 of yacc.c */ +#line 1513 "parser.y" + {(yyval.code)=(yyvsp[(1) - (1)].code);;} + break; + + case 38: + +/* Line 1455 of yacc.c */ +#line 1528 "parser.y" + {(yyval.code)=0;;} + break; + + case 45: + +/* Line 1455 of yacc.c */ +#line 1536 "parser.y" + {/*TODO*/(yyval.code)=0;;} + break; + + case 46: + +/* Line 1455 of yacc.c */ +#line 1537 "parser.y" + {/*TODO*/(yyval.code)=0;;} + break; + + case 47: + +/* Line 1455 of yacc.c */ +#line 1539 "parser.y" + {(yyval.code)=(yyvsp[(2) - (3)].code);;} + break; + + case 48: + +/* Line 1455 of yacc.c */ +#line 1540 "parser.y" + {(yyval.code)=0;;} + break; + + case 49: + +/* Line 1455 of yacc.c */ +#line 1541 "parser.y" + {(yyval.code)=(yyvsp[(1) - (2)].code);;} + break; + + case 50: + +/* Line 1455 of yacc.c */ +#line 1542 "parser.y" + {(yyval.code)=(yyvsp[(1) - (1)].code);;} + break; + + case 51: + +/* Line 1455 of yacc.c */ +#line 1546 "parser.y" + { + if((yyvsp[(1) - (1)].code)) as3_warning("code ignored"); +;} + break; + + case 52: + +/* Line 1455 of yacc.c */ +#line 1552 "parser.y" + {(yyval.value)=(yyvsp[(2) - (2)].value);;} + break; + + case 53: + +/* Line 1455 of yacc.c */ +#line 1553 "parser.y" + {(yyval.value).c=abc_pushundefined(0); + (yyval.value).t=TYPE_ANY; + ;} + break; + + case 54: + +/* Line 1455 of yacc.c */ +#line 1557 "parser.y" + {(yyval.code)=(yyvsp[(2) - (2)].code);;} + break; + + case 55: + +/* Line 1455 of yacc.c */ +#line 1558 "parser.y" + {(yyval.code)=(yyvsp[(2) - (2)].code);;} + break; + + case 56: + +/* Line 1455 of yacc.c */ +#line 1560 "parser.y" + {(yyval.code) = (yyvsp[(1) - (1)].code);;} + break; + + case 57: + +/* Line 1455 of yacc.c */ +#line 1561 "parser.y" + {(yyval.code) = code_append((yyvsp[(1) - (3)].code), (yyvsp[(3) - (3)].code));;} + break; + + case 58: + +/* Line 1455 of yacc.c */ +#line 1564 "parser.y" + { + if(variable_exists((yyvsp[(1) - (3)].id))) + syntaxerror("Variable %s already defined", (yyvsp[(1) - (3)].id)); + + if(!is_subtype_of((yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo))) { + syntaxerror("Can't convert %s to %s", (yyvsp[(3) - (3)].value).t->name, + (yyvsp[(2) - (3)].classinfo)->name); + } + + int index = new_variable((yyvsp[(1) - (3)].id), (yyvsp[(2) - (3)].classinfo), 1); + + if((yyvsp[(2) - (3)].classinfo)) { + if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) { + (yyval.code) = (yyvsp[(3) - (3)].value).c; + (yyval.code) = converttype((yyval.code), (yyvsp[(3) - (3)].value).t, (yyvsp[(2) - (3)].classinfo)); + (yyval.code) = abc_setlocal((yyval.code), index); + } else { + (yyval.code) = defaultvalue(0, (yyvsp[(2) - (3)].classinfo)); + (yyval.code) = abc_setlocal((yyval.code), index); + } + } else { + if((yyvsp[(3) - (3)].value).c->prev || (yyvsp[(3) - (3)].value).c->opcode != OPCODE_PUSHUNDEFINED) { + (yyval.code) = (yyvsp[(3) - (3)].value).c; + (yyval.code) = abc_coerce_a((yyval.code)); + (yyval.code) = abc_setlocal((yyval.code), index); + } else { + (yyval.code) = code_new(); + } + } + + /* that's the default for a local register, anyway + else { + state->method->initcode = abc_pushundefined(state->method->initcode); + state->method->initcode = abc_setlocal(state->method->initcode, index); + }*/ + //printf("variable %s -> %d (%s)\n", $2->text, index, $4.t?$4.t->name:""); +;} + break; + + case 59: + +/* Line 1455 of yacc.c */ +#line 1604 "parser.y" + {(yyval.code) = code_new();;} + break; + + case 60: + +/* Line 1455 of yacc.c */ +#line 1605 "parser.y" + {(yyval.code)=(yyvsp[(2) - (2)].code);;} + break; + + case 61: + +/* Line 1455 of yacc.c */ +#line 1608 "parser.y" + {new_state();;} + break; + + case 62: + +/* Line 1455 of yacc.c */ +#line 1608 "parser.y" + { + + (yyval.code) = code_new(); + (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (7)].value).c); + code_t*myjmp,*myif = (yyval.code) = abc_iffalse((yyval.code), 0); + + (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].code)); + if((yyvsp[(7) - (7)].code)) { + myjmp = (yyval.code) = abc_jump((yyval.code), 0); + } + myif->branch = (yyval.code) = abc_nop((yyval.code)); + if((yyvsp[(7) - (7)].code)) { + (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (7)].code)); + myjmp->branch = (yyval.code) = abc_nop((yyval.code)); + } + (yyval.code) = var_block((yyval.code)); + old_state(); +;} + break; + + case 63: + +/* Line 1455 of yacc.c */ +#line 1627 "parser.y" + {(yyval.code)=code_new();;} + break; + + case 66: + +/* Line 1455 of yacc.c */ +#line 1632 "parser.y" + { + (yyval.id)=(yyvsp[(2) - (3)].id);new_variable((yyvsp[(2) - (3)].id),(yyvsp[(3) - (3)].classinfo),1); +;} + break; + + case 67: + +/* Line 1455 of yacc.c */ +#line 1635 "parser.y" + { + (yyval.id)=(yyvsp[(1) - (1)].id); +;} + break; + + case 68: + +/* Line 1455 of yacc.c */ +#line 1639 "parser.y" + {new_state();(yyval.for_start).name=(yyvsp[(1) - (2)].id);(yyval.for_start).each=0;;} + break; + + case 69: + +/* Line 1455 of yacc.c */ +#line 1640 "parser.y" + {new_state();(yyval.for_start).name=(yyvsp[(1) - (3)].id);(yyval.for_start).each=1;;} + break; + + case 70: + +/* Line 1455 of yacc.c */ +#line 1642 "parser.y" + { + if((yyvsp[(1) - (8)].for_start).each) syntaxerror("invalid syntax: ; not allowed in for each statement"); + (yyval.code) = code_new(); + (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (8)].code)); + code_t*loopstart = (yyval.code) = abc_label((yyval.code)); + (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (8)].value).c); + code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0); + (yyval.code) = code_append((yyval.code), (yyvsp[(8) - (8)].code)); + code_t*cont = (yyval.code) = abc_nop((yyval.code)); + (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (8)].code)); + (yyval.code) = abc_jump((yyval.code), loopstart); + code_t*out = (yyval.code) = abc_nop((yyval.code)); + breakjumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, out); + continuejumpsto((yyval.code), (yyvsp[(1) - (8)].for_start).name, cont); + myif->branch = out; + + (yyval.code) = var_block((yyval.code)); + old_state(); +;} + break; + + case 71: + +/* Line 1455 of yacc.c */ +#line 1662 "parser.y" + { + variable_t*var = find_variable((yyvsp[(2) - (6)].id)); + char*tmp1name = concat2((yyvsp[(2) - (6)].id), "__tmp1__"); + int it = new_variable(tmp1name, TYPE_INT, 0); + char*tmp2name = concat2((yyvsp[(2) - (6)].id), "__array__"); + int array = new_variable(tmp1name, 0, 0); + + (yyval.code) = code_new(); + (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c); + (yyval.code) = abc_coerce_a((yyval.code)); + (yyval.code) = abc_setlocal((yyval.code), array); + (yyval.code) = abc_pushbyte((yyval.code), 0); + (yyval.code) = abc_setlocal((yyval.code), it); + + code_t*loopstart = (yyval.code) = abc_label((yyval.code)); + + (yyval.code) = abc_hasnext2((yyval.code), array, it); + code_t*myif = (yyval.code) = abc_iffalse((yyval.code), 0); + (yyval.code) = abc_getlocal((yyval.code), array); + (yyval.code) = abc_getlocal((yyval.code), it); + if(!(yyvsp[(1) - (6)].for_start).each) + (yyval.code) = abc_nextname((yyval.code)); + else + (yyval.code) = abc_nextvalue((yyval.code)); + (yyval.code) = converttype((yyval.code), 0, var->type); + (yyval.code) = abc_setlocal((yyval.code), var->index); + + (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code)); + (yyval.code) = abc_jump((yyval.code), loopstart); + + code_t*out = (yyval.code) = abc_nop((yyval.code)); + breakjumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, out); + continuejumpsto((yyval.code), (yyvsp[(1) - (6)].for_start).name, loopstart); + + myif->branch = out; + + (yyval.code) = var_block((yyval.code)); + old_state(); + + free(tmp1name); + free(tmp2name); +;} + break; + + case 72: + +/* Line 1455 of yacc.c */ +#line 1705 "parser.y" + {new_state();;} + break; + + case 73: + +/* Line 1455 of yacc.c */ +#line 1705 "parser.y" + { + + (yyval.code) = code_new(); + + code_t*myjmp = (yyval.code) = abc_jump((yyval.code), 0); + code_t*loopstart = (yyval.code) = abc_label((yyval.code)); + (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (6)].code)); + code_t*cont = (yyval.code) = abc_nop((yyval.code)); + myjmp->branch = cont; + (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (6)].value).c); + (yyval.code) = abc_iftrue((yyval.code), loopstart); + code_t*out = (yyval.code) = abc_nop((yyval.code)); + breakjumpsto((yyval.code), (yyvsp[(1) - (6)].id), out); + continuejumpsto((yyval.code), (yyvsp[(1) - (6)].id), cont); + + (yyval.code) = var_block((yyval.code)); + old_state(); +;} + break; + + case 74: + +/* Line 1455 of yacc.c */ +#line 1724 "parser.y" + {new_state();;} + break; + + case 75: + +/* Line 1455 of yacc.c */ +#line 1724 "parser.y" + { + (yyval.code) = code_new(); + code_t*loopstart = (yyval.code) = abc_label((yyval.code)); + (yyval.code) = code_append((yyval.code), (yyvsp[(3) - (7)].code)); + code_t*cont = (yyval.code) = abc_nop((yyval.code)); + (yyval.code) = code_append((yyval.code), (yyvsp[(6) - (7)].value).c); + (yyval.code) = abc_iftrue((yyval.code), loopstart); + code_t*out = (yyval.code) = abc_nop((yyval.code)); + breakjumpsto((yyval.code), (yyvsp[(1) - (7)].id), out); + continuejumpsto((yyval.code), (yyvsp[(1) - (7)].id), cont); + + (yyval.code) = var_block((yyval.code)); + old_state(); +;} + break; + + case 76: + +/* Line 1455 of yacc.c */ +#line 1739 "parser.y" + { + (yyval.code) = abc___break__(0, ""); +;} + break; + + case 77: + +/* Line 1455 of yacc.c */ +#line 1742 "parser.y" + { + (yyval.code) = abc___break__(0, (yyvsp[(2) - (2)].id)); +;} + break; + + case 78: + +/* Line 1455 of yacc.c */ +#line 1745 "parser.y" + { + (yyval.code) = abc___continue__(0, ""); +;} + break; + + case 79: + +/* Line 1455 of yacc.c */ +#line 1748 "parser.y" + { + (yyval.code) = abc___continue__(0, (yyvsp[(2) - (2)].id)); +;} + break; + + case 80: + +/* Line 1455 of yacc.c */ +#line 1752 "parser.y" + {(yyval.code)=0;;} + break; + + case 81: + +/* Line 1455 of yacc.c */ +#line 1753 "parser.y" + {(yyval.code)=(yyvsp[(1) - (1)].code);;} + break; + + case 82: + +/* Line 1455 of yacc.c */ +#line 1754 "parser.y" + {(yyval.code)=(yyvsp[(1) - (1)].code);;} + break; + + case 83: + +/* Line 1455 of yacc.c */ +#line 1755 "parser.y" + {(yyval.code)=code_append((yyvsp[(1) - (2)].code),(yyvsp[(2) - (2)].code));;} + break; + + case 84: + +/* Line 1455 of yacc.c */ +#line 1756 "parser.y" + {(yyval.code)=(yyvsp[(1) - (1)].code);} + break; + + case 85: + +/* Line 1455 of yacc.c */ +#line 1757 "parser.y" + {(yyval.code)=code_append((yyval.code),(yyvsp[(2) - (2)].code));;} + break; + + case 86: + +/* Line 1455 of yacc.c */ +#line 1759 "parser.y" + { + (yyval.code) = abc_dup(0); + (yyval.code) = code_append((yyval.code), (yyvsp[(2) - (4)].value).c); + code_t*j = (yyval.code) = abc_ifne((yyval.code), 0); + (yyval.code) = code_append((yyval.code), (yyvsp[(4) - (4)].code)); + if((yyval.code)->opcode != OPCODE___BREAK__) { + (yyval.code) = abc___fallthrough__((yyval.code), ""); + } + code_t*e = (yyval.code) = abc_nop((yyval.code)); + j->branch = e; +;} + break; + + case 87: + +/* Line 1455 of yacc.c */ +#line 1770 "parser.y" + { + (yyval.code) = (yyvsp[(3) - (3)].code); +;} + break; + + case 88: + +/* Line 1455 of yacc.c */ +#line 1773 "parser.y" + {new_state();;} + break; + + case 89: + +/* Line 1455 of yacc.c */ +#line 1773 "parser.y" + { + (yyval.code)=(yyvsp[(4) - (8)].value).c; + (yyval.code) = code_append((yyval.code), (yyvsp[(7) - (8)].code)); + code_t*out = (yyval.code) = abc_pop((yyval.code)); + breakjumpsto((yyval.code), (yyvsp[(1) - (8)].id), out); + + code_t*c = (yyval.code),*lastblock=0; + while(c) { + if(c->opcode == OPCODE_IFNE) { + if(!c->next) syntaxerror("internal error in fallthrough handling"); + lastblock=c->next; + } else if(c->opcode == OPCODE___FALLTHROUGH__) { + if(lastblock) { + c->opcode = OPCODE_JUMP; + c->branch = lastblock; + } else { + /* fall through end of switch */ + c->opcode = OPCODE_NOP; + } + } + c=c->prev; + } + + (yyval.code) = var_block((yyval.code)); + old_state(); +;} + break; + + case 90: + +/* Line 1455 of yacc.c */ +#line 1802 "parser.y" + {new_state();state->exception_name=(yyvsp[(3) - (5)].id);new_variable((yyvsp[(3) - (5)].id), (yyvsp[(4) - (5)].classinfo), 0);;} + break; + + case 91: + +/* Line 1455 of yacc.c */ +#line 1803 "parser.y" + { + namespace_t name_ns = {ACCESS_PACKAGE, ""}; + multiname_t name = {QNAME, &name_ns, 0, (yyvsp[(3) - (9)].id)}; + + NEW(abc_exception_t, e) + e->exc_type = sig2mname((yyvsp[(4) - (9)].classinfo)); + e->var_name = multiname_clone(&name); + (yyval.exception) = e; + + code_t*c = 0; + int i = find_variable_safe((yyvsp[(3) - (9)].id))->index; + e->target = c = abc_nop(0); + c = abc_setlocal(c, i); + c = code_append(c, (yyvsp[(8) - (9)].code)); + c = abc_kill(c, i); + + c = var_block(c); + old_state(); +;} + break; + + case 92: + +/* Line 1455 of yacc.c */ +#line 1822 "parser.y" + {new_state();state->exception_name=0;;} + break; + + case 93: + +/* Line 1455 of yacc.c */ +#line 1822 "parser.y" + { + (yyvsp[(4) - (5)].code) = var_block((yyvsp[(4) - (5)].code)); + if(!(yyvsp[(4) - (5)].code)) { + (yyval.exception)=0; + old_state(); + } else { + NEW(abc_exception_t, e) + e->exc_type = 0; //all exceptions + e->var_name = 0; //no name + e->target = 0; + e->to = abc_nop(0); + e->to = code_append(e->to, (yyvsp[(4) - (5)].code)); + old_state(); + (yyval.exception) = e; + } +;} + break; + + case 94: + +/* Line 1455 of yacc.c */ +#line 1839 "parser.y" + {(yyval.catch_list).l=list_new();(yyval.catch_list).finally=0;list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception));;} + break; + + case 95: + +/* Line 1455 of yacc.c */ +#line 1840 "parser.y" + {(yyval.catch_list)=(yyvsp[(1) - (2)].catch_list);list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception));;} + break; + + case 96: + +/* Line 1455 of yacc.c */ +#line 1841 "parser.y" + {(yyval.catch_list)=(yyvsp[(1) - (1)].catch_list);} + break; + + case 97: + +/* Line 1455 of yacc.c */ +#line 1842 "parser.y" + { + (yyval.catch_list) = (yyvsp[(1) - (2)].catch_list); + (yyval.catch_list).finally = 0; + if((yyvsp[(2) - (2)].exception)) { + list_append((yyval.catch_list).l,(yyvsp[(2) - (2)].exception)); + (yyval.catch_list).finally = (yyvsp[(2) - (2)].exception)->to;(yyvsp[(2) - (2)].exception)->to=0; + } +;} + break; + + case 98: + +/* Line 1455 of yacc.c */ +#line 1850 "parser.y" + { + (yyval.catch_list).l=list_new(); + (yyval.catch_list).finally = 0; + if((yyvsp[(1) - (1)].exception)) { + list_append((yyval.catch_list).l,(yyvsp[(1) - (1)].exception)); + (yyval.catch_list).finally = (yyvsp[(1) - (1)].exception)->to;(yyvsp[(1) - (1)].exception)->to=0; + } +;} + break; + + case 99: + +/* Line 1455 of yacc.c */ +#line 1859 "parser.y" + {new_state();;} + break; + + case 100: + +/* Line 1455 of yacc.c */ +#line 1859 "parser.y" + { + code_t*out = abc_nop(0); + + code_t*start = abc_nop(0); + (yyval.code) = code_append(start, (yyvsp[(4) - (6)].code)); + if(!is_break_or_jump((yyvsp[(4) - (6)].code))) { + (yyval.code) = abc_jump((yyval.code), out); + } + code_t*end = (yyval.code) = abc_nop((yyval.code)); + + int tmp; + if((yyvsp[(6) - (6)].catch_list).finally) + tmp = new_variable("__finally__", 0, 0); + + abc_exception_list_t*l = (yyvsp[(6) - (6)].catch_list).l; + int count=0; + while(l) { + abc_exception_t*e = l->abc_exception; + if(e->var_name) { + (yyval.code) = code_append((yyval.code), e->target); + (yyval.code) = abc_jump((yyval.code), out); + } else { + parserassert((ptroff_t)(yyvsp[(6) - (6)].catch_list).finally); + // finally block + e->target = (yyval.code) = abc_nop((yyval.code)); + (yyval.code) = abc___rethrow__((yyval.code)); + } + + e->from = start; + e->to = end; + + l = l->next; + } + (yyval.code) = code_append((yyval.code), out); + + (yyval.code) = insert_finally((yyval.code), (yyvsp[(6) - (6)].catch_list).finally, tmp); + + list_concat(state->method->exceptions, (yyvsp[(6) - (6)].catch_list).l); + + (yyval.code) = var_block((yyval.code)); + old_state(); +;} + break; + + case 101: + +/* Line 1455 of yacc.c */ +#line 1904 "parser.y" + { + (yyval.code)=(yyvsp[(2) - (2)].value).c; + (yyval.code)=abc_throw((yyval.code)); +;} + break; + + case 102: + +/* Line 1455 of yacc.c */ +#line 1908 "parser.y" + { + if(!state->exception_name) + syntaxerror("re-throw only possible within a catch block"); + variable_t*v = find_variable(state->exception_name); + (yyval.code)=code_new(); + (yyval.code)=abc_getlocal((yyval.code), v->index); + (yyval.code)=abc_throw((yyval.code)); +;} + break; + + case 103: + +/* Line 1455 of yacc.c */ +#line 1919 "parser.y" + { + (yyval.code) = (yyvsp[(3) - (5)].value).c; + (yyval.code) = abc_pushscope((yyval.code)); + (yyval.code) = code_append((yyval.code), (yyvsp[(5) - (5)].code)); + (yyval.code) = abc_popscope((yyval.code)); +;} + break; + + case 105: + +/* Line 1455 of yacc.c */ +#line 1929 "parser.y" + {(yyval.id)="package";;} + break; + + case 106: + +/* Line 1455 of yacc.c */ +#line 1931 "parser.y" + {(yyval.id) = concat3((yyvsp[(1) - (3)].id),".",(yyvsp[(3) - (3)].id));free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0;;} + break; + + case 107: + +/* Line 1455 of yacc.c */ +#line 1932 "parser.y" + {(yyval.id)=strdup((yyvsp[(1) - (1)].id));;} + break; + + case 108: + +/* Line 1455 of yacc.c */ +#line 1934 "parser.y" + {startpackage((yyvsp[(2) - (3)].id));free((yyvsp[(2) - (3)].id));(yyvsp[(2) - (3)].id)=0;;} + break; + + case 109: + +/* Line 1455 of yacc.c */ +#line 1934 "parser.y" + {endpackage();(yyval.code)=0;;} + break; + + case 110: + +/* Line 1455 of yacc.c */ +#line 1935 "parser.y" + {startpackage("");} + break; + + case 111: + +/* Line 1455 of yacc.c */ +#line 1935 "parser.y" + {endpackage();(yyval.code)=0;;} + break; + + case 112: + +/* Line 1455 of yacc.c */ +#line 1937 "parser.y" + { + classinfo_t*c = (yyvsp[(2) - (2)].classinfo); + if(!c) + syntaxerror("Couldn't import class\n"); + state_has_imports(); + dict_put(state->imports, c->name, c); + (yyval.code)=0; +;} + break; + + case 113: + +/* Line 1455 of yacc.c */ +#line 1945 "parser.y" + { + NEW(import_t,i); + i->package = (yyvsp[(2) - (4)].id); + state_has_imports(); + list_append(state->wildcard_imports, i); + (yyval.code)=0; +;} + break; + + case 114: + +/* Line 1455 of yacc.c */ +#line 1955 "parser.y" + {(yyval.flags)=0;;} + break; + + case 115: + +/* Line 1455 of yacc.c */ +#line 1956 "parser.y" + {(yyval.flags)=(yyvsp[(1) - (1)].flags);} + break; + + case 116: + +/* Line 1455 of yacc.c */ +#line 1957 "parser.y" + {(yyval.flags)=(yyvsp[(1) - (1)].token);;} + break; + + case 117: + +/* Line 1455 of yacc.c */ +#line 1958 "parser.y" + {(yyval.flags)=(yyvsp[(1) - (2)].flags)|(yyvsp[(2) - (2)].token);;} + break; + + case 118: + +/* Line 1455 of yacc.c */ +#line 1960 "parser.y" + {(yyval.token)=FLAG_PUBLIC;;} + break; + + case 119: + +/* Line 1455 of yacc.c */ +#line 1961 "parser.y" + {(yyval.token)=FLAG_PRIVATE;;} + break; + + case 120: + +/* Line 1455 of yacc.c */ +#line 1962 "parser.y" + {(yyval.token)=FLAG_PROTECTED;;} + break; + + case 121: + +/* Line 1455 of yacc.c */ +#line 1963 "parser.y" + {(yyval.token)=FLAG_STATIC;;} + break; + + case 122: + +/* Line 1455 of yacc.c */ +#line 1964 "parser.y" + {(yyval.token)=FLAG_DYNAMIC;;} + break; + + case 123: + +/* Line 1455 of yacc.c */ +#line 1965 "parser.y" + {(yyval.token)=FLAG_FINAL;;} + break; + + case 124: + +/* Line 1455 of yacc.c */ +#line 1966 "parser.y" + {(yyval.token)=FLAG_OVERRIDE;;} + break; + + case 125: + +/* Line 1455 of yacc.c */ +#line 1967 "parser.y" + {(yyval.token)=FLAG_NATIVE;;} + break; + + case 126: + +/* Line 1455 of yacc.c */ +#line 1968 "parser.y" + {(yyval.token)=FLAG_PACKAGEINTERNAL;;} + break; + + case 127: + +/* Line 1455 of yacc.c */ +#line 1970 "parser.y" + {(yyval.classinfo)=registry_getobjectclass();;} + break; + + case 128: + +/* Line 1455 of yacc.c */ +#line 1971 "parser.y" + {(yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);;} + break; + + case 129: + +/* Line 1455 of yacc.c */ +#line 1973 "parser.y" + {(yyval.classinfo_list)=list_new();;} + break; + + case 130: + +/* Line 1455 of yacc.c */ +#line 1974 "parser.y" + {(yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);;} + break; + + case 131: + +/* Line 1455 of yacc.c */ +#line 1976 "parser.y" + {(yyval.classinfo_list)=list_new();;} + break; + + case 132: + +/* Line 1455 of yacc.c */ +#line 1977 "parser.y" + {(yyval.classinfo_list)=(yyvsp[(2) - (2)].classinfo_list);;} + break; + + case 133: + +/* Line 1455 of yacc.c */ +#line 1981 "parser.y" + {startclass((yyvsp[(1) - (6)].flags),(yyvsp[(3) - (6)].id),(yyvsp[(4) - (6)].classinfo),(yyvsp[(5) - (6)].classinfo_list), 0);;} + break; + + case 134: + +/* Line 1455 of yacc.c */ +#line 1983 "parser.y" + {endclass();(yyval.code)=0;;} + break; + + case 135: + +/* Line 1455 of yacc.c */ +#line 1987 "parser.y" + {startclass((yyvsp[(1) - (5)].flags),(yyvsp[(3) - (5)].id),0,(yyvsp[(4) - (5)].classinfo_list),1);;} + break; + + case 136: + +/* Line 1455 of yacc.c */ +#line 1989 "parser.y" + {endclass();(yyval.code)=0;;} + break; + + case 144: + +/* Line 1455 of yacc.c */ +#line 2001 "parser.y" + { + code_t*c = state->cls->static_init; + c = code_append(c, (yyvsp[(1) - (1)].code)); + state->cls->static_init = c; +;} + break; + + case 150: + +/* Line 1455 of yacc.c */ +#line 2012 "parser.y" + { + syntaxerror("variable declarations not allowed in interfaces"); +;} + break; + + case 151: + +/* Line 1455 of yacc.c */ +#line 2015 "parser.y" + { + (yyvsp[(1) - (8)].flags) |= FLAG_PUBLIC; + if((yyvsp[(1) - (8)].flags)&(FLAG_PRIVATE|FLAG_PACKAGEINTERNAL|FLAG_PROTECTED)) { + syntaxerror("invalid method modifiers: interface methods always need to be public"); + } + startfunction(0,(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo)); + endfunction(0,(yyvsp[(1) - (8)].flags),(yyvsp[(3) - (8)].token),(yyvsp[(4) - (8)].id),&(yyvsp[(6) - (8)].params),(yyvsp[(8) - (8)].classinfo), 0); +;} + break; + + case 154: + +/* Line 1455 of yacc.c */ +#line 2028 "parser.y" + { + int flags = (yyvsp[(1) - (5)].flags); + memberinfo_t* info = state->cls? + memberinfo_register(state->cls->info, (yyvsp[(3) - (5)].id), MEMBER_SLOT): + memberinfo_register_global(flags2access((yyvsp[(1) - (5)].flags)), state->package, (yyvsp[(3) - (5)].id), MEMBER_SLOT); + + info->type = (yyvsp[(4) - (5)].classinfo); + info->flags = flags; + + /* slot name */ + namespace_t mname_ns = {flags2access(flags), ""}; + multiname_t mname = {QNAME, &mname_ns, 0, (yyvsp[(3) - (5)].id)}; + + trait_list_t**traits; + code_t**code; + if(!state->cls) { + // global variable + traits = &global->init->traits; + code = &global->init->method->body->code; + } else if(flags&FLAG_STATIC) { + // static variable + traits = &state->cls->abc->static_traits; + code = &state->cls->static_init; + } else { + // instance variable + traits = &state->cls->abc->traits; + code = &state->cls->init; + } + + trait_t*t=0; + if((yyvsp[(4) - (5)].classinfo)) { + MULTINAME(m, (yyvsp[(4) - (5)].classinfo)); + t = trait_new_member(traits, multiname_clone(&m), multiname_clone(&mname), 0); + } else { + t = trait_new_member(traits, 0, multiname_clone(&mname), 0); + } + info->slot = t->slot_id; + + /* initalization code (if needed) */ + code_t*c = 0; + if((yyvsp[(5) - (5)].value).c && !is_pushundefined((yyvsp[(5) - (5)].value).c)) { + c = abc_getlocal_0(c); + c = code_append(c, (yyvsp[(5) - (5)].value).c); + c = converttype(c, (yyvsp[(5) - (5)].value).t, (yyvsp[(4) - (5)].classinfo)); + c = abc_setslot(c, t->slot_id); + } + + *code = code_append(*code, c); + + if((yyvsp[(2) - (5)].token)==KW_CONST) { + t->kind= TRAIT_CONST; + } + + (yyval.code)=0; +;} + break; + + case 155: + +/* Line 1455 of yacc.c */ +#line 2086 "parser.y" + {(yyval.constant)=0;;} + break; + + case 156: + +/* Line 1455 of yacc.c */ +#line 2087 "parser.y" + {(yyval.constant)=(yyvsp[(2) - (2)].constant);;} + break; + + case 157: + +/* Line 1455 of yacc.c */ +#line 2089 "parser.y" + {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_uint));;} + break; + + case 158: + +/* Line 1455 of yacc.c */ +#line 2090 "parser.y" + {(yyval.constant) = constant_new_int((yyvsp[(1) - (1)].number_int));;} + break; + + case 159: + +/* Line 1455 of yacc.c */ +#line 2091 "parser.y" + {(yyval.constant) = constant_new_uint((yyvsp[(1) - (1)].number_uint));;} + break; + + case 160: + +/* Line 1455 of yacc.c */ +#line 2092 "parser.y" + {(yyval.constant) = constant_new_float((yyvsp[(1) - (1)].number_float));;} + break; + + case 161: + +/* Line 1455 of yacc.c */ +#line 2093 "parser.y" + {(yyval.constant) = constant_new_string2((yyvsp[(1) - (1)].str).str,(yyvsp[(1) - (1)].str).len);;} + break; + + case 162: + +/* Line 1455 of yacc.c */ +#line 2095 "parser.y" + {(yyval.constant) = constant_new_true((yyvsp[(1) - (1)].token));;} + break; + + case 163: + +/* Line 1455 of yacc.c */ +#line 2096 "parser.y" + {(yyval.constant) = constant_new_false((yyvsp[(1) - (1)].token));;} + break; + + case 164: + +/* Line 1455 of yacc.c */ +#line 2097 "parser.y" + {(yyval.constant) = constant_new_null((yyvsp[(1) - (1)].token));;} + break; + + case 165: + +/* Line 1455 of yacc.c */ +#line 2102 "parser.y" + { + memset(&(yyval.params),0,sizeof((yyval.params))); +;} + break; + + case 166: + +/* Line 1455 of yacc.c */ +#line 2105 "parser.y" + { + (yyval.params)=(yyvsp[(1) - (1)].params); +;} + break; + + case 167: + +/* Line 1455 of yacc.c */ +#line 2110 "parser.y" + { + memset(&(yyval.params),0,sizeof((yyval.params))); + (yyval.params).varargs=1; + list_append((yyval.params).list, (yyvsp[(2) - (2)].param)); +;} + break; + + case 168: + +/* Line 1455 of yacc.c */ +#line 2115 "parser.y" + { + (yyval.params) =(yyvsp[(1) - (4)].params); + (yyval.params).varargs=1; + list_append((yyval.params).list, (yyvsp[(4) - (4)].param)); +;} + break; + + case 169: + +/* Line 1455 of yacc.c */ +#line 2122 "parser.y" + { + (yyval.params) = (yyvsp[(1) - (3)].params); + list_append((yyval.params).list, (yyvsp[(3) - (3)].param)); +;} + break; + + case 170: + +/* Line 1455 of yacc.c */ +#line 2126 "parser.y" + { + memset(&(yyval.params),0,sizeof((yyval.params))); + list_append((yyval.params).list, (yyvsp[(1) - (1)].param)); +;} + break; + + case 171: + +/* Line 1455 of yacc.c */ +#line 2131 "parser.y" + { + (yyval.param) = malloc(sizeof(param_t)); + (yyval.param)->name=(yyvsp[(1) - (4)].id); + (yyval.param)->type = (yyvsp[(3) - (4)].classinfo); + (yyval.param)->value = (yyvsp[(4) - (4)].constant); +;} + break; + + case 172: + +/* Line 1455 of yacc.c */ +#line 2137 "parser.y" + { + (yyval.param) = malloc(sizeof(param_t)); + (yyval.param)->name=(yyvsp[(1) - (2)].id); + (yyval.param)->type = TYPE_ANY; + (yyval.param)->value = (yyvsp[(2) - (2)].constant); +;} + break; + + case 173: + +/* Line 1455 of yacc.c */ +#line 2143 "parser.y" + {(yyval.token)=(yyvsp[(1) - (1)].token);;} + break; + + case 174: + +/* Line 1455 of yacc.c */ +#line 2144 "parser.y" + {(yyval.token)=(yyvsp[(1) - (1)].token);;} + break; + + case 175: + +/* Line 1455 of yacc.c */ +#line 2145 "parser.y" + {(yyval.token)=0;;} + break; + + case 176: + +/* Line 1455 of yacc.c */ +#line 2148 "parser.y" + {startfunction(0,(yyvsp[(1) - (9)].flags),(yyvsp[(3) - (9)].token),(yyvsp[(4) - (9)].id),&(yyvsp[(6) - (9)].params),(yyvsp[(8) - (9)].classinfo));} + break; + + case 177: + +/* Line 1455 of yacc.c */ +#line 2149 "parser.y" + { + code_t*c = 0; + if(state->method->late_binding) { + c = abc_getlocal_0(c); + c = abc_pushscope(c); + } + if(state->method->is_constructor && !state->method->has_super) { + // call default constructor + c = abc_getlocal_0(c); + c = abc_constructsuper(c, 0); + } + c = wrap_function(c, 0, (yyvsp[(11) - (12)].code)); + endfunction(0,(yyvsp[(1) - (12)].flags),(yyvsp[(3) - (12)].token),(yyvsp[(4) - (12)].id),&(yyvsp[(6) - (12)].params),(yyvsp[(8) - (12)].classinfo),c); + (yyval.code)=0; +;} + break; + + case 179: + +/* Line 1455 of yacc.c */ +#line 2166 "parser.y" + {(yyval.id)=0;;} + break; + + case 180: + +/* Line 1455 of yacc.c */ +#line 2168 "parser.y" + { + syntaxerror("nested functions not supported yet"); +;} + break; + + case 181: + +/* Line 1455 of yacc.c */ +#line 2175 "parser.y" + { + + /* try current package */ + (yyval.classinfo) = find_class((yyvsp[(1) - (1)].id)); + if(!(yyval.classinfo)) syntaxerror("Could not find class %s\n", (yyvsp[(1) - (1)].id)); +;} + break; + + case 182: + +/* Line 1455 of yacc.c */ +#line 2182 "parser.y" + { + (yyval.classinfo) = registry_findclass((yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id)); + if(!(yyval.classinfo)) syntaxerror("Couldn't find class %s.%s\n", (yyvsp[(1) - (3)].id), (yyvsp[(3) - (3)].id)); + free((yyvsp[(1) - (3)].id));(yyvsp[(1) - (3)].id)=0; +;} + break; + + case 185: + +/* Line 1455 of yacc.c */ +#line 2191 "parser.y" + {(yyval.classinfo_list)=list_new();list_append((yyval.classinfo_list), (yyvsp[(1) - (1)].classinfo));;} + break; + + case 186: + +/* Line 1455 of yacc.c */ +#line 2192 "parser.y" + {(yyval.classinfo_list)=(yyvsp[(1) - (3)].classinfo_list);list_append((yyval.classinfo_list),(yyvsp[(3) - (3)].classinfo));;} + break; + + case 187: + +/* Line 1455 of yacc.c */ +#line 2194 "parser.y" + {(yyval.classinfo)=(yyvsp[(1) - (1)].classinfo);;} + break; + + case 188: + +/* Line 1455 of yacc.c */ +#line 2195 "parser.y" + {(yyval.classinfo)=registry_getanytype();;} + break; + + case 189: + +/* Line 1455 of yacc.c */ +#line 2196 "parser.y" + {(yyval.classinfo)=registry_getanytype();;} + break; + + case 190: + +/* Line 1455 of yacc.c */ +#line 2205 "parser.y" + {(yyval.classinfo)=(yyvsp[(2) - (2)].classinfo);;} + break; + + case 191: + +/* Line 1455 of yacc.c */ +#line 2206 "parser.y" + {(yyval.classinfo)=0;;} + break; + + case 192: + +/* Line 1455 of yacc.c */ +#line 2210 "parser.y" + {(yyval.value_list).cc=0;(yyval.value_list).len=0;;} + break; + + case 193: + +/* Line 1455 of yacc.c */ +#line 2211 "parser.y" + {(yyval.value_list)=(yyvsp[(2) - (3)].value_list);} + break; + + case 194: + +/* Line 1455 of yacc.c */ +#line 2213 "parser.y" + {(yyval.value_list).cc=0;(yyval.value_list).len=0;;} + break; + + case 196: + +/* Line 1455 of yacc.c */ +#line 2215 "parser.y" + {(yyval.value_list).len=1; + (yyval.value_list).cc = (yyvsp[(1) - (1)].value).c; + ;} + break; + + case 197: + +/* Line 1455 of yacc.c */ +#line 2218 "parser.y" + { + (yyval.value_list).len= (yyvsp[(1) - (3)].value_list).len+1; + (yyval.value_list).cc = code_append((yyvsp[(1) - (3)].value_list).cc, (yyvsp[(3) - (3)].value).c); + ;} + break; + + case 198: + +/* Line 1455 of yacc.c */ +#line 2223 "parser.y" + { + MULTINAME(m, (yyvsp[(2) - (3)].classinfo)); + (yyval.value).c = code_new(); + + if((yyvsp[(2) - (3)].classinfo)->slot) { + (yyval.value).c = abc_getglobalscope((yyval.value).c); + (yyval.value).c = abc_getslot((yyval.value).c, (yyvsp[(2) - (3)].classinfo)->slot); + } else { + (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m); + } + + (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (3)].value_list).cc); + + if((yyvsp[(2) - (3)].classinfo)->slot) + (yyval.value).c = abc_construct((yyval.value).c, (yyvsp[(3) - (3)].value_list).len); + else + (yyval.value).c = abc_constructprop2((yyval.value).c, &m, (yyvsp[(3) - (3)].value_list).len); + (yyval.value).t = (yyvsp[(2) - (3)].classinfo); +;} + break; + + case 199: + +/* Line 1455 of yacc.c */ +#line 2247 "parser.y" + { + + (yyval.value).c = (yyvsp[(1) - (4)].value).c; + if((yyval.value).c->opcode == OPCODE_COERCE_A) { + (yyval.value).c = code_cutlast((yyval.value).c); + } + code_t*paramcode = (yyvsp[(3) - (4)].value_list).cc; + + (yyval.value).t = TYPE_ANY; + if((yyval.value).c->opcode == OPCODE_GETPROPERTY) { + multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0; + (yyval.value).c = code_cutlast((yyval.value).c); + (yyval.value).c = code_append((yyval.value).c, paramcode); + (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).len); + multiname_destroy(name); + } else if((yyval.value).c->opcode == OPCODE_GETSLOT) { + int slot = (int)(ptroff_t)(yyval.value).c->data[0]; + trait_t*t = abc_class_find_slotid(state->cls->abc,slot);//FIXME + if(t->kind!=TRAIT_METHOD) { + //ok: flash allows to assign closures to members. + } + multiname_t*name = t->name; + (yyval.value).c = code_cutlast((yyval.value).c); + (yyval.value).c = code_append((yyval.value).c, paramcode); + //$$.c = abc_callmethod($$.c, t->method, len); //#1051 illegal early access binding + (yyval.value).c = abc_callproperty2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).len); + } else if((yyval.value).c->opcode == OPCODE_GETSUPER) { + multiname_t*name = (yyval.value).c->data[0];(yyval.value).c->data[0]=0; + (yyval.value).c = code_cutlast((yyval.value).c); + (yyval.value).c = code_append((yyval.value).c, paramcode); + (yyval.value).c = abc_callsuper2((yyval.value).c, name, (yyvsp[(3) - (4)].value_list).len); + multiname_destroy(name); + } else { + (yyval.value).c = abc_getlocal_0((yyval.value).c); + (yyval.value).c = code_append((yyval.value).c, paramcode); + (yyval.value).c = abc_call((yyval.value).c, (yyvsp[(3) - (4)].value_list).len); + } + + memberinfo_t*f = 0; + + if(TYPE_IS_FUNCTION((yyvsp[(1) - (4)].value).t) && (yyvsp[(1) - (4)].value).t->function) { + (yyval.value).t = (yyvsp[(1) - (4)].value).t->function->return_type; + } else { + (yyval.value).c = abc_coerce_a((yyval.value).c); + (yyval.value).t = TYPE_ANY; + } + +;} + break; + + case 200: + +/* Line 1455 of yacc.c */ +#line 2295 "parser.y" + { + if(!state->cls) syntaxerror("super() not allowed outside of a class"); + if(!state->method) syntaxerror("super() not allowed outside of a function"); + if(!state->method->is_constructor) syntaxerror("super() not allowed outside of a constructor"); + + (yyval.value).c = code_new(); + (yyval.value).c = abc_getlocal_0((yyval.value).c); + + (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value_list).cc); + /* + this is dependent on the control path, check this somewhere else + if(state->method->has_super) + syntaxerror("constructor may call super() only once"); + */ + state->method->has_super = 1; + (yyval.value).c = abc_constructsuper((yyval.value).c, (yyvsp[(3) - (4)].value_list).len); + (yyval.value).c = abc_pushundefined((yyval.value).c); + (yyval.value).t = TYPE_ANY; +;} + break; + + case 201: + +/* Line 1455 of yacc.c */ +#line 2315 "parser.y" + { + (yyval.value).c = (yyvsp[(2) - (2)].value).c; + if((yyval.value).c->opcode == OPCODE_COERCE_A) { + (yyval.value).c = code_cutlast((yyval.value).c); + } + multiname_t*name = 0; + if((yyval.value).c->opcode == OPCODE_GETPROPERTY) { + (yyval.value).c->opcode = OPCODE_DELETEPROPERTY; + } else if((yyval.value).c->opcode == OPCODE_GETSLOT) { + int slot = (int)(ptroff_t)(yyval.value).c->data[0]; + multiname_t*name = abc_class_find_slotid(state->cls->abc,slot)->name; + (yyval.value).c = code_cutlast((yyval.value).c); + (yyval.value).c = abc_deleteproperty2((yyval.value).c, name); + } else { + (yyval.value).c = abc_getlocal_0((yyval.value).c); + MULTINAME_LATE(m, (yyvsp[(2) - (2)].value).t?(yyvsp[(2) - (2)].value).t->access:ACCESS_PACKAGE, ""); + (yyval.value).c = abc_deleteproperty2((yyval.value).c, &m); + } + (yyval.value).t = TYPE_BOOLEAN; +;} + break; + + case 202: + +/* Line 1455 of yacc.c */ +#line 2336 "parser.y" + { + (yyval.code) = abc_returnvoid(0); +;} + break; + + case 203: + +/* Line 1455 of yacc.c */ +#line 2339 "parser.y" + { + (yyval.code) = (yyvsp[(2) - (2)].value).c; + (yyval.code) = abc_returnvalue((yyval.code)); +;} + break; + + case 204: + +/* Line 1455 of yacc.c */ +#line 2346 "parser.y" + {(yyval.value)=(yyvsp[(1) - (1)].value);;} + break; + + case 205: + +/* Line 1455 of yacc.c */ +#line 2347 "parser.y" + {(yyval.value) = (yyvsp[(1) - (1)].value);;} + break; + + case 206: + +/* Line 1455 of yacc.c */ +#line 2348 "parser.y" + { + (yyval.value).c = (yyvsp[(1) - (3)].value).c; + (yyval.value).c = cut_last_push((yyval.value).c); + (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c); + (yyval.value).t = (yyvsp[(3) - (3)].value).t; +;} + break; + + case 207: + +/* Line 1455 of yacc.c */ +#line 2354 "parser.y" + { + (yyval.code)=cut_last_push((yyvsp[(1) - (1)].value).c); +;} + break; + + case 208: + +/* Line 1455 of yacc.c */ +#line 2360 "parser.y" + {(yyval.value) = (yyvsp[(1) - (1)].value);;} + break; + + case 210: + +/* Line 1455 of yacc.c */ +#line 2364 "parser.y" + {(yyval.value) = (yyvsp[(1) - (1)].value);;} + break; + + case 211: + +/* Line 1455 of yacc.c */ +#line 2366 "parser.y" + {(yyval.value) = (yyvsp[(1) - (1)].value);;} + break; + + case 212: + +/* Line 1455 of yacc.c */ +#line 2368 "parser.y" + {(yyval.value) = (yyvsp[(1) - (1)].value);;} + break; + + case 213: + +/* Line 1455 of yacc.c */ +#line 2370 "parser.y" + { + (yyval.value).c = 0; + namespace_t ns = {ACCESS_PACKAGE, ""}; + multiname_t m = {QNAME, &ns, 0, "RegExp"}; + if(!(yyvsp[(1) - (1)].regexp).options) { + (yyval.value).c = abc_getlex2((yyval.value).c, &m); + (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern); + (yyval.value).c = abc_construct((yyval.value).c, 1); + } else { + (yyval.value).c = abc_getlex2((yyval.value).c, &m); + (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).pattern); + (yyval.value).c = abc_pushstring((yyval.value).c, (yyvsp[(1) - (1)].regexp).options); + (yyval.value).c = abc_construct((yyval.value).c, 2); + } + (yyval.value).t = TYPE_REGEXP; +;} + break; + + case 214: + +/* Line 1455 of yacc.c */ +#line 2387 "parser.y" + {(yyval.value).c = abc_pushbyte(0, (yyvsp[(1) - (1)].number_uint)); + //MULTINAME(m, registry_getintclass()); + //$$.c = abc_coerce2($$.c, &m); // FIXME + (yyval.value).t = TYPE_INT; + ;} + break; + + case 215: + +/* Line 1455 of yacc.c */ +#line 2392 "parser.y" + {(yyval.value).c = abc_pushshort(0, (yyvsp[(1) - (1)].number_uint)); + (yyval.value).t = TYPE_INT; + ;} + break; + + case 216: + +/* Line 1455 of yacc.c */ +#line 2395 "parser.y" + {(yyval.value).c = abc_pushint(0, (yyvsp[(1) - (1)].number_int)); + (yyval.value).t = TYPE_INT; + ;} + break; + + case 217: + +/* Line 1455 of yacc.c */ +#line 2398 "parser.y" + {(yyval.value).c = abc_pushuint(0, (yyvsp[(1) - (1)].number_uint)); + (yyval.value).t = TYPE_UINT; + ;} + break; + + case 218: + +/* Line 1455 of yacc.c */ +#line 2401 "parser.y" + {(yyval.value).c = abc_pushdouble(0, (yyvsp[(1) - (1)].number_float)); + (yyval.value).t = TYPE_FLOAT; + ;} + break; + + case 219: + +/* Line 1455 of yacc.c */ +#line 2404 "parser.y" + {(yyval.value).c = abc_pushstring2(0, &(yyvsp[(1) - (1)].str)); + (yyval.value).t = TYPE_STRING; + ;} + break; + + case 220: + +/* Line 1455 of yacc.c */ +#line 2407 "parser.y" + {(yyval.value).c = abc_pushundefined(0); + (yyval.value).t = TYPE_ANY; + ;} + break; + + case 221: + +/* Line 1455 of yacc.c */ +#line 2410 "parser.y" + {(yyval.value).c = abc_pushtrue(0); + (yyval.value).t = TYPE_BOOLEAN; + ;} + break; + + case 222: + +/* Line 1455 of yacc.c */ +#line 2413 "parser.y" + {(yyval.value).c = abc_pushfalse(0); + (yyval.value).t = TYPE_BOOLEAN; + ;} + break; + + case 223: + +/* Line 1455 of yacc.c */ +#line 2416 "parser.y" + {(yyval.value).c = abc_pushnull(0); + (yyval.value).t = TYPE_NULL; + ;} + break; + + case 225: + +/* Line 1455 of yacc.c */ +#line 2421 "parser.y" + {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterequals((yyval.value).c);(yyval.value).c=abc_not((yyval.value).c); + (yyval.value).t = TYPE_BOOLEAN; + ;} + break; + + case 226: + +/* Line 1455 of yacc.c */ +#line 2424 "parser.y" + {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterthan((yyval.value).c); + (yyval.value).t = TYPE_BOOLEAN; + ;} + break; + + case 227: + +/* Line 1455 of yacc.c */ +#line 2427 "parser.y" + {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterthan((yyval.value).c);(yyval.value).c=abc_not((yyval.value).c); + (yyval.value).t = TYPE_BOOLEAN; + ;} + break; + + case 228: + +/* Line 1455 of yacc.c */ +#line 2430 "parser.y" + {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_greaterequals((yyval.value).c); + (yyval.value).t = TYPE_BOOLEAN; + ;} + break; + + case 229: + +/* Line 1455 of yacc.c */ +#line 2433 "parser.y" + {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_equals((yyval.value).c); + (yyval.value).t = TYPE_BOOLEAN; + ;} + break; + + case 230: + +/* Line 1455 of yacc.c */ +#line 2436 "parser.y" + {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_strictequals((yyval.value).c); + (yyval.value).t = TYPE_BOOLEAN; + ;} + break; + + case 231: + +/* Line 1455 of yacc.c */ +#line 2439 "parser.y" + {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_strictequals((yyval.value).c);(yyval.value).c = abc_not((yyval.value).c); + (yyval.value).t = TYPE_BOOLEAN; + ;} + break; + + case 232: + +/* Line 1455 of yacc.c */ +#line 2442 "parser.y" + {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c);(yyval.value).c = abc_equals((yyval.value).c);(yyval.value).c = abc_not((yyval.value).c); + (yyval.value).t = TYPE_BOOLEAN; + ;} + break; + + case 233: + +/* Line 1455 of yacc.c */ +#line 2446 "parser.y" + {(yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'O'); + (yyval.value).c = (yyvsp[(1) - (3)].value).c; + (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t); + (yyval.value).c = abc_dup((yyval.value).c); + code_t*jmp = (yyval.value).c = abc_iftrue((yyval.value).c, 0); + (yyval.value).c = cut_last_push((yyval.value).c); + (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c); + (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t); + code_t*label = (yyval.value).c = abc_label((yyval.value).c); + jmp->branch = label; + ;} + break; + + case 234: + +/* Line 1455 of yacc.c */ +#line 2457 "parser.y" + { + (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'A'); + /*printf("%08x:\n",$1.t); + code_dump($1.c, 0, 0, "", stdout); + printf("%08x:\n",$3.t); + code_dump($3.c, 0, 0, "", stdout); + printf("joining %08x and %08x to %08x\n", $1.t, $3.t, $$.t);*/ + (yyval.value).c = (yyvsp[(1) - (3)].value).c; + (yyval.value).c = converttype((yyval.value).c, (yyvsp[(1) - (3)].value).t, (yyval.value).t); + (yyval.value).c = abc_dup((yyval.value).c); + code_t*jmp = (yyval.value).c = abc_iffalse((yyval.value).c, 0); + (yyval.value).c = cut_last_push((yyval.value).c); + (yyval.value).c = code_append((yyval.value).c,(yyvsp[(3) - (3)].value).c); + (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (3)].value).t, (yyval.value).t); + code_t*label = (yyval.value).c = abc_label((yyval.value).c); + jmp->branch = label; + ;} + break; + + case 235: + +/* Line 1455 of yacc.c */ +#line 2475 "parser.y" + {(yyval.value).c=(yyvsp[(2) - (2)].value).c; + (yyval.value).c = abc_not((yyval.value).c); + (yyval.value).t = TYPE_BOOLEAN; + ;} + break; + + case 236: + +/* Line 1455 of yacc.c */ +#line 2480 "parser.y" + {(yyval.value).c=(yyvsp[(2) - (2)].value).c; + (yyval.value).c = abc_bitnot((yyval.value).c); + (yyval.value).t = TYPE_INT; + ;} + break; + + case 237: + +/* Line 1455 of yacc.c */ +#line 2485 "parser.y" + {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); + (yyval.value).c = abc_bitand((yyval.value).c); + (yyval.value).t = TYPE_INT; + ;} + break; + + case 238: + +/* Line 1455 of yacc.c */ +#line 2490 "parser.y" + {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); + (yyval.value).c = abc_bitxor((yyval.value).c); + (yyval.value).t = TYPE_INT; + ;} + break; + + case 239: + +/* Line 1455 of yacc.c */ +#line 2495 "parser.y" + {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); + (yyval.value).c = abc_bitor((yyval.value).c); + (yyval.value).t = TYPE_INT; + ;} + break; + + case 240: + +/* Line 1455 of yacc.c */ +#line 2500 "parser.y" + {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); + (yyval.value).c = abc_rshift((yyval.value).c); + (yyval.value).t = TYPE_INT; + ;} + break; + + case 241: + +/* Line 1455 of yacc.c */ +#line 2504 "parser.y" + {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); + (yyval.value).c = abc_urshift((yyval.value).c); + (yyval.value).t = TYPE_INT; + ;} + break; + + case 242: + +/* Line 1455 of yacc.c */ +#line 2508 "parser.y" + {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); + (yyval.value).c = abc_lshift((yyval.value).c); + (yyval.value).t = TYPE_INT; + ;} + break; + + case 243: + +/* Line 1455 of yacc.c */ +#line 2513 "parser.y" + {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); + (yyval.value).c = abc_divide((yyval.value).c); + (yyval.value).t = TYPE_NUMBER; + ;} + break; + + case 244: + +/* Line 1455 of yacc.c */ +#line 2517 "parser.y" + {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); + (yyval.value).c = abc_modulo((yyval.value).c); + (yyval.value).t = TYPE_NUMBER; + ;} + break; + + case 245: + +/* Line 1455 of yacc.c */ +#line 2521 "parser.y" + {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); + if(BOTH_INT((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t)) { + (yyval.value).c = abc_add_i((yyval.value).c); + (yyval.value).t = TYPE_INT; + } else { + (yyval.value).c = abc_add((yyval.value).c); + (yyval.value).t = join_types((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t,'+'); + } + ;} + break; + + case 246: + +/* Line 1455 of yacc.c */ +#line 2530 "parser.y" + {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); + if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) { + (yyval.value).c = abc_subtract_i((yyval.value).c); + (yyval.value).t = TYPE_INT; + } else { + (yyval.value).c = abc_subtract((yyval.value).c); + (yyval.value).t = TYPE_NUMBER; + } + ;} + break; + + case 247: + +/* Line 1455 of yacc.c */ +#line 2539 "parser.y" + {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); + if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) { + (yyval.value).c = abc_multiply_i((yyval.value).c); + (yyval.value).t = TYPE_INT; + } else { + (yyval.value).c = abc_multiply((yyval.value).c); + (yyval.value).t = TYPE_NUMBER; + } + ;} + break; + + case 248: + +/* Line 1455 of yacc.c */ +#line 2549 "parser.y" + {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c,(yyvsp[(3) - (3)].value).c); + (yyval.value).c = abc_in((yyval.value).c); + (yyval.value).t = TYPE_BOOLEAN; + ;} + break; + + case 249: + +/* Line 1455 of yacc.c */ +#line 2554 "parser.y" + {char use_astype=0; // flash player's astype works differently than astypelate + if(use_astype && TYPE_IS_CLASS((yyvsp[(3) - (3)].value).t)) { + MULTINAME(m,(yyvsp[(3) - (3)].value).t->cls); + (yyval.value).c = abc_astype2((yyvsp[(1) - (3)].value).c, &m); + (yyval.value).t = (yyvsp[(3) - (3)].value).t->cls; + } else { + (yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c); + (yyval.value).c = abc_astypelate((yyval.value).c); + (yyval.value).t = TYPE_ANY; + } + ;} + break; + + case 250: + +/* Line 1455 of yacc.c */ +#line 2567 "parser.y" + {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c); + (yyval.value).c = abc_instanceof((yyval.value).c); + (yyval.value).t = TYPE_BOOLEAN; + ;} + break; + + case 251: + +/* Line 1455 of yacc.c */ +#line 2572 "parser.y" + {(yyval.value).c = code_append((yyvsp[(1) - (3)].value).c, (yyvsp[(3) - (3)].value).c); + (yyval.value).c = abc_istypelate((yyval.value).c); + (yyval.value).t = TYPE_BOOLEAN; + ;} + break; + + case 252: + +/* Line 1455 of yacc.c */ +#line 2577 "parser.y" + { + (yyval.value).c = (yyvsp[(3) - (4)].value).c; + (yyval.value).c = abc_typeof((yyval.value).c); + (yyval.value).t = TYPE_STRING; + ;} + break; + + case 253: + +/* Line 1455 of yacc.c */ +#line 2583 "parser.y" + { + (yyval.value).c = cut_last_push((yyvsp[(2) - (2)].value).c); + (yyval.value).c = abc_pushundefined((yyval.value).c); + (yyval.value).t = TYPE_ANY; + ;} + break; + + case 254: + +/* Line 1455 of yacc.c */ +#line 2589 "parser.y" + { (yyval.value).c = abc_pushundefined(0); + (yyval.value).t = TYPE_ANY; + ;} + break; + + case 255: + +/* Line 1455 of yacc.c */ +#line 2593 "parser.y" + {(yyval.value)=(yyvsp[(2) - (3)].value);;} + break; + + case 256: + +/* Line 1455 of yacc.c */ +#line 2595 "parser.y" + { + (yyval.value)=(yyvsp[(2) - (2)].value); + if(IS_INT((yyvsp[(2) - (2)].value).t)) { + (yyval.value).c=abc_negate_i((yyval.value).c); + (yyval.value).t = TYPE_INT; + } else { + (yyval.value).c=abc_negate((yyval.value).c); + (yyval.value).t = TYPE_NUMBER; + } +;} + break; + + case 257: + +/* Line 1455 of yacc.c */ +#line 2606 "parser.y" + { + (yyval.value).c = (yyvsp[(1) - (4)].value).c; + (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (4)].value).c); + + MULTINAME_LATE(m, (yyvsp[(1) - (4)].value).t?(yyvsp[(1) - (4)].value).t->access:ACCESS_PACKAGE, ""); + (yyval.value).c = abc_getproperty2((yyval.value).c, &m); + (yyval.value).t = 0; // array elements have unknown type +;} + break; + + case 258: + +/* Line 1455 of yacc.c */ +#line 2615 "parser.y" + { + (yyval.value).c = code_new(); + (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc); + (yyval.value).c = abc_newarray((yyval.value).c, (yyvsp[(2) - (3)].value_list).len); + (yyval.value).t = registry_getarrayclass(); +;} + break; + + case 259: + +/* Line 1455 of yacc.c */ +#line 2622 "parser.y" + {(yyval.value_list).cc=0;(yyval.value_list).len=0;;} + break; + + case 260: + +/* Line 1455 of yacc.c */ +#line 2623 "parser.y" + {(yyval.value_list)=(yyvsp[(1) - (1)].value_list);} + break; + + case 261: + +/* Line 1455 of yacc.c */ +#line 2625 "parser.y" + { + (yyval.value_list).cc = 0; + (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(1) - (3)].value).c); + (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (3)].value).c); + (yyval.value_list).len = 2; +;} + break; + + case 262: + +/* Line 1455 of yacc.c */ +#line 2631 "parser.y" + { + (yyval.value_list).cc = (yyvsp[(1) - (5)].value_list).cc; + (yyval.value_list).len = (yyvsp[(1) - (5)].value_list).len+2; + (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(3) - (5)].value).c); + (yyval.value_list).cc = code_append((yyval.value_list).cc, (yyvsp[(5) - (5)].value).c); +;} + break; + + case 263: + +/* Line 1455 of yacc.c */ +#line 2640 "parser.y" + { + (yyval.value).c = code_new(); + (yyval.value).c = code_append((yyval.value).c, (yyvsp[(2) - (3)].value_list).cc); + (yyval.value).c = abc_newobject((yyval.value).c, (yyvsp[(2) - (3)].value_list).len/2); + (yyval.value).t = registry_getobjectclass(); +;} + break; + + case 264: + +/* Line 1455 of yacc.c */ +#line 2647 "parser.y" + { + code_t*c = (yyvsp[(3) - (3)].value).c; + if(BOTH_INT((yyvsp[(1) - (3)].value).t,(yyvsp[(3) - (3)].value).t)) { + c=abc_multiply_i(c); + } else { + c=abc_multiply(c); + } + c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '*'), (yyvsp[(1) - (3)].value).t); + (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0); + (yyval.value).t = (yyvsp[(1) - (3)].value).t; + ;} + break; + + case 265: + +/* Line 1455 of yacc.c */ +#line 2659 "parser.y" + { + code_t*c = abc_modulo((yyvsp[(3) - (3)].value).c); + c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '%'), (yyvsp[(1) - (3)].value).t); + (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0); + (yyval.value).t = (yyvsp[(1) - (3)].value).t; + ;} + break; + + case 266: + +/* Line 1455 of yacc.c */ +#line 2665 "parser.y" + { + code_t*c = abc_lshift((yyvsp[(3) - (3)].value).c); + c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '<'), (yyvsp[(1) - (3)].value).t); + (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0); + (yyval.value).t = (yyvsp[(1) - (3)].value).t; + ;} + break; + + case 267: + +/* Line 1455 of yacc.c */ +#line 2671 "parser.y" + { + code_t*c = abc_rshift((yyvsp[(3) - (3)].value).c); + c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '>'), (yyvsp[(1) - (3)].value).t); + (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0); + (yyval.value).t = (yyvsp[(1) - (3)].value).t; + ;} + break; + + case 268: + +/* Line 1455 of yacc.c */ +#line 2677 "parser.y" + { + code_t*c = abc_urshift((yyvsp[(3) - (3)].value).c); + c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, 'U'), (yyvsp[(1) - (3)].value).t); + (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0); + (yyval.value).t = (yyvsp[(1) - (3)].value).t; + ;} + break; + + case 269: + +/* Line 1455 of yacc.c */ +#line 2683 "parser.y" + { + code_t*c = abc_divide((yyvsp[(3) - (3)].value).c); + c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '/'), (yyvsp[(1) - (3)].value).t); + (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0); + (yyval.value).t = (yyvsp[(1) - (3)].value).t; + ;} + break; + + case 270: + +/* Line 1455 of yacc.c */ +#line 2689 "parser.y" + { + code_t*c = abc_bitor((yyvsp[(3) - (3)].value).c); + c=converttype(c, TYPE_INT, (yyvsp[(1) - (3)].value).t); + (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0); + (yyval.value).t = (yyvsp[(1) - (3)].value).t; + ;} + break; + + case 271: + +/* Line 1455 of yacc.c */ +#line 2695 "parser.y" + { + code_t*c = (yyvsp[(3) - (3)].value).c; + + if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) { + c=abc_add_i(c); + } else { + c=abc_add(c); + c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '+'), (yyvsp[(1) - (3)].value).t); + } + + (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0); + (yyval.value).t = (yyvsp[(1) - (3)].value).t; + ;} + break; + + case 272: + +/* Line 1455 of yacc.c */ +#line 2708 "parser.y" + { code_t*c = (yyvsp[(3) - (3)].value).c; + if(TYPE_IS_INT((yyvsp[(1) - (3)].value).t)) { + c=abc_subtract_i(c); + } else { + c=abc_subtract(c); + c=converttype(c, join_types((yyvsp[(1) - (3)].value).t, (yyvsp[(3) - (3)].value).t, '-'), (yyvsp[(1) - (3)].value).t); + } + + (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 0, 0); + (yyval.value).t = (yyvsp[(1) - (3)].value).t; + ;} + break; + + case 273: + +/* Line 1455 of yacc.c */ +#line 2719 "parser.y" + { code_t*c = 0; + c = code_append(c, (yyvsp[(3) - (3)].value).c); + c = converttype(c, (yyvsp[(3) - (3)].value).t, (yyvsp[(1) - (3)].value).t); + (yyval.value).c = toreadwrite((yyvsp[(1) - (3)].value).c, c, 1, 0); + (yyval.value).t = (yyvsp[(1) - (3)].value).t; + ;} + break; + + case 274: + +/* Line 1455 of yacc.c */ +#line 2726 "parser.y" + { + (yyval.value).t = join_types((yyvsp[(3) - (5)].value).t,(yyvsp[(5) - (5)].value).t,'?'); + (yyval.value).c = (yyvsp[(1) - (5)].value).c; + code_t*j1 = (yyval.value).c = abc_iffalse((yyval.value).c, 0); + (yyval.value).c = code_append((yyval.value).c, (yyvsp[(3) - (5)].value).c); + (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (5)].value).t, (yyval.value).t); + code_t*j2 = (yyval.value).c = abc_jump((yyval.value).c, 0); + (yyval.value).c = j1->branch = abc_label((yyval.value).c); + (yyval.value).c = code_append((yyval.value).c, (yyvsp[(5) - (5)].value).c); + (yyval.value).c = converttype((yyval.value).c, (yyvsp[(3) - (5)].value).t, (yyval.value).t); + (yyval.value).c = j2->branch = abc_label((yyval.value).c); + ;} + break; + + case 275: + +/* Line 1455 of yacc.c */ +#line 2739 "parser.y" + { code_t*c = 0; + classinfo_t*type = (yyvsp[(1) - (2)].value).t; + if((is_getlocal((yyvsp[(1) - (2)].value).c) && TYPE_IS_INT((yyvsp[(1) - (2)].value).t)) || TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t)) { + int nr = getlocalnr((yyvsp[(1) - (2)].value).c); + code_free((yyvsp[(1) - (2)].value).c);(yyvsp[(1) - (2)].value).c=0; + if(TYPE_IS_INT((yyvsp[(1) - (2)].value).t)) { + (yyval.value).c = abc_getlocal(0, nr); + (yyval.value).c = abc_inclocal_i((yyval.value).c, nr); + } else if(TYPE_IS_NUMBER((yyvsp[(1) - (2)].value).t)) { + (yyval.value).c = abc_getlocal(0, nr); + (yyval.value).c = abc_inclocal((yyval.value).c, nr); + } else syntaxerror("internal error"); + } else { + if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) { + c=abc_increment_i(c); + type = TYPE_INT; + } else { + c=abc_increment(c); + type = TYPE_NUMBER; + } + c=converttype(c, type, (yyvsp[(1) - (2)].value).t); + (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1); + (yyval.value).t = (yyvsp[(1) - (2)].value).t; + } + ;} + break; + + case 276: + +/* Line 1455 of yacc.c */ +#line 2766 "parser.y" + { code_t*c = 0; + classinfo_t*type = (yyvsp[(1) - (2)].value).t; + if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) { + c=abc_decrement_i(c); + type = TYPE_INT; + } else { + c=abc_decrement(c); + type = TYPE_NUMBER; + } + c=converttype(c, type, (yyvsp[(1) - (2)].value).t); + (yyval.value).c = toreadwrite((yyvsp[(1) - (2)].value).c, c, 0, 1); + (yyval.value).t = (yyvsp[(1) - (2)].value).t; + ;} + break; + + case 277: + +/* Line 1455 of yacc.c */ +#line 2780 "parser.y" + { code_t*c = 0; + classinfo_t*type = (yyvsp[(2) - (2)].value).t; + if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) { + c=abc_increment_i(c); + type = TYPE_INT; + } else { + c=abc_increment(c); + type = TYPE_NUMBER; + } + c=converttype(c, type, (yyvsp[(2) - (2)].value).t); + (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0); + (yyval.value).t = (yyvsp[(2) - (2)].value).t; + ;} + break; + + case 278: + +/* Line 1455 of yacc.c */ +#line 2794 "parser.y" + { code_t*c = 0; + classinfo_t*type = (yyvsp[(2) - (2)].value).t; + if(TYPE_IS_INT(type) || TYPE_IS_UINT(type)) { + c=abc_decrement_i(c); + type = TYPE_INT; + } else { + c=abc_decrement(c); + type = TYPE_NUMBER; + } + c=converttype(c, type, (yyvsp[(2) - (2)].value).t); + (yyval.value).c = toreadwrite((yyvsp[(2) - (2)].value).c, c, 0, 0); + (yyval.value).t = (yyvsp[(2) - (2)].value).t; + ;} + break; + + case 279: + +/* Line 1455 of yacc.c */ +#line 2809 "parser.y" + { if(!state->cls->info) + syntaxerror("super keyword not allowed outside a class"); + classinfo_t*t = state->cls->info->superclass; + if(!t) t = TYPE_OBJECT; + + memberinfo_t*f = registry_findmember(t, (yyvsp[(3) - (3)].id), 1); + namespace_t ns = flags2namespace(f->flags, ""); + MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id)); + (yyval.value).c = 0; + (yyval.value).c = abc_getlocal_0((yyval.value).c); + (yyval.value).c = abc_getsuper2((yyval.value).c, &m); + (yyval.value).t = memberinfo_gettype(f); + ;} + break; + + case 280: + +/* Line 1455 of yacc.c */ +#line 2824 "parser.y" + {(yyval.value).c = (yyvsp[(1) - (3)].value).c; + classinfo_t*t = (yyvsp[(1) - (3)].value).t; + char is_static = 0; + if(TYPE_IS_CLASS(t) && t->cls) { + t = t->cls; + is_static = 1; + } + if(t) { + memberinfo_t*f = registry_findmember(t, (yyvsp[(3) - (3)].id), 1); + char noslot = 0; + if(f && !is_static != !(f->flags&FLAG_STATIC)) + noslot=1; + if(f && f->slot && !noslot) { + (yyval.value).c = abc_getslot((yyval.value).c, f->slot); + } else { + MEMBER_MULTINAME(m, f, (yyvsp[(3) - (3)].id)); + (yyval.value).c = abc_getproperty2((yyval.value).c, &m); + } + /* determine type */ + (yyval.value).t = memberinfo_gettype(f); + if(!(yyval.value).t) + (yyval.value).c = abc_coerce_a((yyval.value).c); + } else { + /* when resolving a property on an unknown type, we do know the + name of the property (and don't seem to need the package), but + we need to make avm2 try out all access modes */ + multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(3) - (3)].id)}; + (yyval.value).c = abc_getproperty2((yyval.value).c, &m); + (yyval.value).c = abc_coerce_a((yyval.value).c); + (yyval.value).t = registry_getanytype(); + } + ;} + break; + + case 281: + +/* Line 1455 of yacc.c */ +#line 2857 "parser.y" + { + (yyval.value).t = 0; + (yyval.value).c = 0; + classinfo_t*a = 0; + memberinfo_t*f = 0; + + variable_t*v; + /* look at variables */ + if((v = find_variable((yyvsp[(1) - (1)].id)))) { + // $1 is a local variable + (yyval.value).c = abc_getlocal((yyval.value).c, v->index); + (yyval.value).t = v->type; + + /* look at current class' members */ + } else if(state->cls && (f = registry_findmember(state->cls->info, (yyvsp[(1) - (1)].id), 1))) { + // $1 is a function in this class + int var_is_static = (f->flags&FLAG_STATIC); + int i_am_static = ((state->method && state->method->info)?(state->method->info->flags&FLAG_STATIC):FLAG_STATIC); + if(var_is_static != i_am_static) { + /* there doesn't seem to be any "static" way to access + static properties of a class */ + state->method->late_binding = 1; + (yyval.value).t = f->type; + namespace_t ns = {flags2access(f->flags), ""}; + multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)}; + (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m); + (yyval.value).c = abc_getproperty2((yyval.value).c, &m); + } else { + if(f->slot>0) { + (yyval.value).c = abc_getlocal_0((yyval.value).c); + (yyval.value).c = abc_getslot((yyval.value).c, f->slot); + } else { + namespace_t ns = {flags2access(f->flags), ""}; + multiname_t m = {QNAME, &ns, 0, (yyvsp[(1) - (1)].id)}; + (yyval.value).c = abc_getlocal_0((yyval.value).c); + (yyval.value).c = abc_getproperty2((yyval.value).c, &m); + } + } + if(f->kind == MEMBER_METHOD) { + (yyval.value).t = TYPE_FUNCTION(f); + } else { + (yyval.value).t = f->type; + } + + /* look at actual classes, in the current package and imported */ + } else if((a = find_class((yyvsp[(1) - (1)].id)))) { + if(a->flags & FLAG_METHOD) { + MULTINAME(m, a); + (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m); + (yyval.value).c = abc_getproperty2((yyval.value).c, &m); + if(a->function->kind == MEMBER_METHOD) { + (yyval.value).t = TYPE_FUNCTION(a->function); + } else { + (yyval.value).t = a->function->type; + } + } else { + if(a->slot) { + (yyval.value).c = abc_getglobalscope((yyval.value).c); + (yyval.value).c = abc_getslot((yyval.value).c, a->slot); + } else { + MULTINAME(m, a); + (yyval.value).c = abc_getlex2((yyval.value).c, &m); + } + (yyval.value).t = TYPE_CLASS(a); + } + + /* unknown object, let the avm2 resolve it */ + } else { + if(strcmp((yyvsp[(1) - (1)].id),"trace")) + as3_softwarning("Couldn't resolve '%s', doing late binding", (yyvsp[(1) - (1)].id)); + state->method->late_binding = 1; + + multiname_t m = {MULTINAME, 0, &nopackage_namespace_set, (yyvsp[(1) - (1)].id)}; + + (yyval.value).t = 0; + (yyval.value).c = abc_findpropstrict2((yyval.value).c, &m); + (yyval.value).c = abc_getproperty2((yyval.value).c, &m); + } +;} + break; + + case 282: + +/* Line 1455 of yacc.c */ +#line 2944 "parser.y" + {(yyval.code)=0;;} + break; + + case 283: + +/* Line 1455 of yacc.c */ +#line 2945 "parser.y" + {(yyval.code)=0;;} + break; + + case 284: + +/* Line 1455 of yacc.c */ +#line 2946 "parser.y" + {(yyval.code)=0;;} + break; + + case 285: + +/* Line 1455 of yacc.c */ +#line 2948 "parser.y" + {(yyval.token)=0;;} + break; + + + +/* Line 1455 of yacc.c */ +#line 6169 "parser.tab.c" + default: break; + } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + *++yyvsp = yylval; + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#if !defined(yyoverflow) || YYERROR_VERBOSE +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); +} + + + diff --git a/lib/as3/parser.tab.h b/lib/as3/parser.tab.h new file mode 100644 index 0000000..0a125af --- /dev/null +++ b/lib/as3/parser.tab.h @@ -0,0 +1,196 @@ + +/* A Bison parser, made by GNU Bison 2.4. */ + +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + T_IDENTIFIER = 258, + T_STRING = 259, + T_REGEXP = 260, + T_EMPTY = 261, + T_INT = 262, + T_UINT = 263, + T_BYTE = 264, + T_SHORT = 265, + T_FLOAT = 266, + T_FOR = 267, + T_WHILE = 268, + T_DO = 269, + T_SWITCH = 270, + KW_IMPLEMENTS = 271, + KW_NAMESPACE = 272, + KW_PACKAGE = 273, + KW_PROTECTED = 274, + KW_PUBLIC = 275, + KW_PRIVATE = 276, + KW_USE = 277, + KW_INTERNAL = 278, + KW_NEW = 279, + KW_NATIVE = 280, + KW_FUNCTION = 281, + KW_FINALLY = 282, + KW_UNDEFINED = 283, + KW_CONTINUE = 284, + KW_CLASS = 285, + KW_CONST = 286, + KW_CATCH = 287, + KW_CASE = 288, + KW_SET = 289, + KW_VOID = 290, + KW_THROW = 291, + KW_STATIC = 292, + KW_WITH = 293, + KW_INSTANCEOF = 294, + KW_IMPORT = 295, + KW_RETURN = 296, + KW_TYPEOF = 297, + KW_INTERFACE = 298, + KW_NULL = 299, + KW_VAR = 300, + KW_DYNAMIC = 301, + KW_OVERRIDE = 302, + KW_FINAL = 303, + KW_EACH = 304, + KW_GET = 305, + KW_TRY = 306, + KW_SUPER = 307, + KW_EXTENDS = 308, + KW_FALSE = 309, + KW_TRUE = 310, + KW_BOOLEAN = 311, + KW_UINT = 312, + KW_INT = 313, + KW_NUMBER = 314, + KW_STRING = 315, + KW_DEFAULT = 316, + KW_DELETE = 317, + KW_IF = 318, + KW_ELSE = 319, + KW_BREAK = 320, + KW_IS = 321, + KW_IN = 322, + KW_AS = 323, + T_EQEQ = 324, + T_EQEQEQ = 325, + T_NE = 326, + T_NEE = 327, + T_LE = 328, + T_GE = 329, + T_ORBY = 330, + T_DIVBY = 331, + T_MODBY = 332, + T_MULBY = 333, + T_PLUSBY = 334, + T_MINUSBY = 335, + T_SHRBY = 336, + T_SHLBY = 337, + T_USHRBY = 338, + T_OROR = 339, + T_ANDAND = 340, + T_COLONCOLON = 341, + T_MINUSMINUS = 342, + T_PLUSPLUS = 343, + T_DOTDOT = 344, + T_DOTDOTDOT = 345, + T_SHL = 346, + T_USHR = 347, + T_SHR = 348, + prec_none = 349, + below_semicolon = 350, + below_assignment = 351, + below_minus = 354, + minusminus_prefix = 355, + plusplus_prefix = 356, + below_curly = 357, + above_identifier = 358, + below_else = 359, + above_function = 360 + }; +#endif + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union +/* Line 1676 of yacc.c */ +#line 41 "parser.y" +tokenunion +{ + +/* Line 1676 of yacc.c */ +#line 41 "parser.y" + + enum yytokentype token; + int flags; + + classinfo_t*classinfo; + classinfo_list_t*classinfo_list; + + int number_int; + unsigned int number_uint; + double number_float; + code_t*code; + typedcode_t value; + //typedcode_list_t*value_list; + codeandnumber_t value_list; + param_t* param; + params_t params; + string_t str; + char*id; + constant_t*constant; + for_start_t for_start; + abc_exception_t *exception; + regexp_t regexp; + struct { + abc_exception_list_t *l; + code_t*finally; + } catch_list; + + + +/* Line 1676 of yacc.c */ +#line 188 "parser.tab.h" +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +#endif + +extern YYSTYPE avm2_lval; + + diff --git a/lib/as3/tokenizer.yy.c b/lib/as3/tokenizer.yy.c new file mode 100644 index 0000000..1cb0292 --- /dev/null +++ b/lib/as3/tokenizer.yy.c @@ -0,0 +1,3550 @@ +#line 2 "tokenizer.yy.c" + +#line 4 "tokenizer.yy.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define yy_create_buffer avm2__create_buffer +#define yy_delete_buffer avm2__delete_buffer +#define yy_flex_debug avm2__flex_debug +#define yy_init_buffer avm2__init_buffer +#define yy_flush_buffer avm2__flush_buffer +#define yy_load_buffer_state avm2__load_buffer_state +#define yy_switch_to_buffer avm2__switch_to_buffer +#define yyin avm2_in +#define yyleng avm2_leng +#define yylex avm2_lex +#define yylineno avm2_lineno +#define yyout avm2_out +#define yyrestart avm2_restart +#define yytext avm2_text +#define yywrap avm2_wrap +#define yyalloc avm2_alloc +#define yyrealloc avm2_realloc +#define yyfree avm2_free + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 35 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif /* ! FLEXINT_H */ + +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN (yy_start) = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START (((yy_start) - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE avm2_restart(avm2_in ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#define YY_BUF_SIZE 16384 +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +extern int avm2_leng; + +extern FILE *avm2_in, *avm2_out; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up avm2_text. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up avm2_text again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, (yytext_ptr) ) + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via avm2_restart()), so that the user can continue scanning by + * just pointing avm2_in at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) + +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] + +/* yy_hold_char holds the character lost when avm2_text is formed. */ +static char yy_hold_char; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int avm2_leng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow avm2_wrap()'s to do buffer switches + * instead of setting up a fresh avm2_in. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void avm2_restart (FILE *input_file ); +void avm2__switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE avm2__create_buffer (FILE *file,int size ); +void avm2__delete_buffer (YY_BUFFER_STATE b ); +void avm2__flush_buffer (YY_BUFFER_STATE b ); +void avm2_push_buffer_state (YY_BUFFER_STATE new_buffer ); +void avm2_pop_buffer_state (void ); + +static void avm2_ensure_buffer_stack (void ); +static void avm2__load_buffer_state (void ); +static void avm2__init_buffer (YY_BUFFER_STATE b,FILE *file ); + +#define YY_FLUSH_BUFFER avm2__flush_buffer(YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE avm2__scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE avm2__scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE avm2__scan_bytes (yyconst char *bytes,int len ); + +void *avm2_alloc (yy_size_t ); +void *avm2_realloc (void *,yy_size_t ); +void avm2_free (void * ); + +#define yy_new_buffer avm2__create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + avm2_ensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + avm2__create_buffer(avm2_in,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + avm2_ensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + avm2__create_buffer(avm2_in,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +typedef unsigned char YY_CHAR; + +FILE *avm2_in = (FILE *) 0, *avm2_out = (FILE *) 0; + +typedef int yy_state_type; + +extern int avm2_lineno; + +int avm2_lineno = 1; + +extern char *avm2_text; +#define yytext_ptr avm2_text + +static yy_state_type yy_get_previous_state (void ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); +static int yy_get_next_buffer (void ); +static void yy_fatal_error (yyconst char msg[] ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up avm2_text. + */ +#define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ + avm2_leng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; + +#define YY_NUM_RULES 106 +#define YY_END_OF_BUFFER 107 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[468] = + { 0, + 0, 0, 0, 0, 0, 0, 107, 105, 13, 13, + 103, 105, 103, 103, 103, 105, 104, 103, 103, 103, + 51, 103, 16, 16, 16, 53, 103, 103, 103, 102, + 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 103, 105, + 102, 103, 103, 51, 103, 10, 10, 10, 29, 0, + 6, 0, 40, 27, 0, 0, 41, 36, 37, 35, + 38, 50, 17, 3, 0, 39, 17, 16, 0, 0, + 52, 46, 34, 32, 33, 48, 0, 102, 0, 101, + 102, 102, 102, 102, 102, 24, 102, 102, 102, 102, + + 102, 102, 102, 102, 102, 100, 102, 99, 98, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 42, 28, 0, 99, 0, 10, 10, 11, 0, 3, + 7, 39, 0, 11, 10, 0, 30, 49, 0, 0, + 0, 0, 0, 1, 17, 15, 14, 0, 44, 31, + 43, 47, 0, 0, 0, 0, 0, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 23, 102, 94, 102, 102, 102, 102, 102, 93, 102, + 102, 102, 102, 102, 102, 102, 95, 102, 102, 102, + + 102, 102, 97, 102, 102, 92, 96, 102, 102, 102, + 12, 102, 11, 11, 0, 7, 0, 0, 0, 7, + 0, 7, 7, 11, 9, 8, 0, 0, 0, 2, + 0, 15, 0, 45, 0, 0, 0, 0, 102, 90, + 102, 102, 102, 102, 102, 102, 102, 85, 89, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 88, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 87, 102, 102, 86, 102, 91, 102, 11, 9, 8, + 7, 0, 7, 0, 0, 2, 0, 7, 7, 9, + 0, 2, 18, 20, 0, 0, 0, 83, 80, 78, + + 79, 102, 102, 102, 102, 102, 82, 81, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 84, 102, 77, 102, 102, 25, 102, 9, + 0, 0, 2, 0, 7, 7, 19, 0, 0, 102, + 102, 70, 102, 102, 102, 102, 102, 75, 102, 102, + 102, 102, 73, 102, 102, 102, 102, 72, 71, 74, + 26, 76, 102, 102, 7, 0, 0, 102, 65, 68, + 69, 64, 102, 102, 102, 102, 102, 102, 102, 66, + 67, 102, 102, 102, 7, 0, 21, 60, 63, 102, + 102, 102, 62, 102, 61, 102, 102, 0, 22, 102, + + 102, 56, 57, 58, 59, 0, 0, 0, 0, 55, + 54, 0, 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, + 0, 0, 4, 0, 0, 4, 0, 5, 0, 0, + 0, 0, 20, 5, 20, 20, 0, 0, 0, 19, + 5, 19, 19, 0, 0, 0, 0, 0, 21, 5, + 21, 21, 22, 5, 22, 22, 0 + } ; + +static yyconst flex_int32_t yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 4, 5, 6, 7, 8, 9, 10, 11, 8, + 12, 13, 14, 8, 15, 16, 17, 18, 19, 19, + 20, 19, 19, 19, 19, 19, 19, 21, 8, 22, + 23, 24, 8, 8, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 8, 26, 27, 8, 28, 7, 29, 30, 31, 32, + + 33, 34, 35, 36, 37, 25, 38, 39, 40, 41, + 42, 43, 25, 44, 45, 46, 47, 48, 49, 50, + 51, 25, 8, 52, 8, 8, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 53, 7, 7, 7, + 54, 7, 7, 7, 7, 7, 7, 7, 7, 7, + + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 55, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7 + } ; + +static yyconst flex_int32_t yy_meta[56] = + { 0, + 1, 2, 3, 2, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 5, 4, 6, 6, 6, + 2, 4, 4, 4, 7, 8, 4, 8, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 4, 4, 4, 4 + } ; + +static yyconst flex_int16_t yy_base[495] = + { 0, + 0, 420, 42, 49, 56, 63, 455, 2184, 2184, 2184, + 431, 78, 2184, 427, 436, 76, 2184, 418, 71, 73, + 73, 82, 90, 95, 100, 415, 75, 406, 98, 121, + 2184, 124, 127, 131, 108, 107, 114, 125, 143, 147, + 126, 158, 162, 170, 179, 186, 193, 200, 80, 365, + 376, 227, 233, 239, 247, 247, 256, 261, 391, 172, + 2184, 403, 2184, 2184, 155, 400, 2184, 2184, 2184, 2184, + 2184, 384, 264, 285, 393, 2184, 271, 276, 379, 344, + 2184, 362, 2184, 360, 2184, 115, 297, 264, 305, 275, + 282, 281, 283, 290, 299, 301, 305, 320, 313, 324, + + 306, 332, 336, 340, 347, 348, 355, 362, 363, 370, + 382, 384, 386, 391, 398, 409, 403, 414, 405, 423, + 430, 429, 435, 441, 446, 458, 450, 464, 470, 469, + 2184, 2184, 318, 485, 499, 516, 521, 502, 207, 541, + 565, 208, 245, 527, 532, 352, 2184, 2184, 558, 561, + 574, 350, 361, 2184, 537, 0, 344, 339, 2184, 2184, + 2184, 333, 615, 294, 274, 264, 249, 484, 540, 541, + 591, 592, 593, 611, 600, 612, 623, 628, 629, 630, + 634, 646, 650, 651, 652, 666, 667, 673, 672, 674, + 678, 689, 690, 694, 695, 706, 710, 712, 717, 718, + + 726, 733, 732, 734, 748, 740, 741, 756, 755, 757, + 2184, 762, 566, 605, 262, 0, 804, 807, 810, 252, + 836, 0, 846, 608, 0, 252, 162, 813, 839, 244, + 842, 0, 210, 2184, 0, 200, 203, 201, 790, 818, + 822, 869, 870, 876, 878, 890, 895, 899, 901, 910, + 915, 916, 917, 931, 932, 933, 938, 939, 950, 954, + 958, 962, 966, 970, 977, 978, 984, 986, 998, 1002, + 1003, 1004, 1018, 1019, 1020, 1025, 1026, 664, 0, 212, + 0, 1053, 1079, 1134, 1137, 197, 1140, 1166, 0, 0, + 1221, 2184, 2184, 2184, 0, 165, 167, 1116, 1117, 1123, + + 1197, 1201, 1202, 1216, 1217, 1218, 1222, 1223, 1234, 1238, + 1240, 1246, 1249, 1262, 1264, 1270, 1279, 1271, 1291, 1295, + 1286, 1300, 1306, 1307, 1311, 1318, 1322, 1326, 1334, 0, + 1368, 1376, 0, 1394, 0, 0, 2184, 165, 130, 1333, + 1345, 1359, 1361, 1370, 1375, 1377, 1389, 1394, 1396, 1395, + 1400, 1401, 1412, 1416, 1417, 1424, 1423, 1431, 1432, 1438, + 1439, 1443, 1447, 1454, 145, 81, 0, 1461, 1462, 1463, + 1468, 1469, 1477, 1483, 1484, 1498, 1491, 1503, 1502, 1507, + 1509, 1514, 1521, 900, 95, 0, 2184, 1523, 1528, 1529, + 1530, 1544, 1537, 1545, 1551, 1553, 1559, 1600, 2184, 1568, + + 1580, 1576, 1587, 1588, 1594, 740, 184, 1636, 1639, 1606, + 1615, 863, 866, 1032, 1072, 187, 1225, 104, 181, 1648, + 1664, 1675, 1678, 1690, 1693, 1696, 1701, 1705, 1709, 1712, + 1716, 1719, 1751, 98, 1754, 1760, 1763, 1766, 1792, 1776, + 1780, 1784, 1769, 1772, 1787, 1808, 1847, 1820, 1826, 1823, + 1829, 1832, 1835, 1873, 1839, 1876, 1912, 1967, 1879, 1882, + 1885, 1888, 1891, 1894, 1903, 1906, 2184, 2022, 2030, 2037, + 2045, 2053, 2061, 2065, 2072, 2076, 2083, 2086, 2089, 83, + 2096, 2099, 2106, 2114, 2114, 2121, 2129, 2134, 2139, 2144, + 2151, 2159, 2167, 2175 + + } ; + +static yyconst flex_int16_t yy_def[495] = + { 0, + 467, 1, 1, 1, 1, 1, 467, 467, 467, 467, + 467, 468, 467, 467, 467, 469, 467, 467, 467, 467, + 467, 467, 467, 467, 467, 467, 467, 467, 467, 470, + 467, 470, 470, 470, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 39, 34, 34, 467, 467, + 39, 467, 467, 467, 471, 467, 467, 467, 467, 468, + 467, 468, 467, 467, 469, 469, 467, 467, 467, 467, + 467, 467, 467, 472, 473, 467, 467, 467, 474, 467, + 467, 467, 467, 467, 467, 467, 467, 34, 467, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 467, 467, 467, 34, 467, 467, 467, 467, 471, 475, + 473, 471, 471, 467, 467, 476, 467, 467, 472, 472, + 477, 467, 473, 467, 467, 478, 474, 467, 467, 467, + 467, 467, 467, 467, 467, 467, 467, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 467, 34, 467, 467, 479, 480, 475, 475, 481, 480, + 475, 141, 471, 467, 482, 476, 483, 472, 477, 467, + 472, 478, 467, 467, 484, 467, 467, 467, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 467, 485, 479, + 480, 486, 467, 475, 481, 480, 475, 467, 223, 482, + 472, 467, 467, 467, 487, 467, 467, 34, 34, 34, + + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 39, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 485, + 475, 475, 480, 475, 283, 288, 467, 467, 467, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 223, 467, 488, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 470, 283, 489, 467, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 490, 467, 34, + + 34, 34, 34, 34, 34, 491, 492, 493, 491, 34, + 34, 467, 467, 491, 491, 492, 467, 492, 494, 494, + 493, 493, 491, 493, 467, 467, 491, 491, 491, 491, + 491, 467, 467, 494, 467, 467, 491, 494, 491, 491, + 491, 491, 467, 467, 491, 491, 491, 491, 491, 467, + 467, 491, 491, 491, 491, 491, 491, 491, 467, 467, + 491, 491, 467, 467, 491, 491, 0, 467, 467, 467, + 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, + 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, + 467, 467, 467, 467 + + } ; + +static yyconst flex_int16_t yy_nxt[2240] = + { 0, + 8, 9, 10, 9, 11, 12, 8, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 8, 31, 30, 32, 33, + 34, 35, 36, 37, 38, 30, 39, 30, 30, 30, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 30, + 30, 49, 8, 8, 50, 52, 53, 54, 55, 56, + 57, 58, 52, 53, 54, 55, 56, 57, 58, 52, + 53, 54, 55, 56, 57, 58, 52, 53, 54, 55, + 56, 57, 58, 61, 68, 51, 61, 70, 72, 281, + 73, 73, 73, 69, 74, 71, 82, 83, 75, 51, + + 419, 66, 131, 62, 76, 77, 416, 78, 78, 78, + 77, 152, 78, 78, 78, 77, 386, 78, 78, 78, + 85, 86, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 132, 87, 87, 87, 98, 88, 161, 162, 79, + 95, 89, 101, 80, 89, 99, 88, 89, 88, 96, + 102, 89, 88, 88, 88, 103, 100, 105, 97, 92, + 104, 385, 367, 88, 88, 61, 88, 88, 90, 93, + 91, 88, 94, 113, 291, 110, 106, 61, 292, 111, + 66, 88, 107, 108, 88, 88, 114, 109, 88, 417, + 88, 417, 417, 112, 117, 366, 88, 62, 88, 88, + + 88, 115, 118, 88, 116, 339, 434, 88, 88, 418, + 338, 88, 418, 231, 122, 119, 120, 88, 121, 88, + 88, 127, 123, 216, 216, 88, 125, 279, 88, 124, + 126, 88, 143, 143, 128, 129, 130, 297, 88, 296, + 68, 88, 135, 295, 136, 137, 137, 70, 135, 69, + 136, 137, 137, 293, 72, 71, 138, 138, 138, 140, + 231, 223, 144, 141, 145, 145, 145, 225, 231, 142, + 143, 144, 143, 145, 145, 145, 144, 279, 145, 145, + 145, 73, 73, 73, 238, 149, 149, 149, 155, 155, + 155, 77, 88, 78, 78, 78, 146, 151, 87, 87, + + 87, 152, 88, 88, 80, 88, 163, 163, 163, 88, + 88, 171, 237, 88, 168, 236, 88, 89, 88, 88, + 88, 88, 88, 88, 88, 169, 170, 88, 88, 88, + 172, 88, 173, 88, 88, 235, 164, 174, 165, 88, + 88, 88, 88, 88, 179, 175, 88, 88, 88, 166, + 176, 88, 88, 167, 88, 234, 233, 177, 88, 156, + 88, 88, 88, 154, 88, 88, 231, 225, 88, 178, + 88, 211, 180, 88, 88, 88, 88, 88, 88, 181, + 182, 88, 160, 88, 159, 88, 88, 158, 88, 88, + 88, 88, 183, 88, 156, 154, 88, 184, 88, 148, + + 88, 88, 65, 88, 88, 60, 185, 186, 88, 187, + 88, 88, 88, 147, 88, 188, 134, 133, 191, 88, + 88, 192, 190, 88, 88, 88, 88, 88, 84, 88, + 189, 88, 88, 198, 193, 81, 88, 88, 195, 194, + 67, 88, 88, 88, 88, 64, 88, 88, 196, 63, + 88, 88, 88, 59, 467, 88, 51, 88, 88, 197, + 467, 88, 467, 88, 88, 199, 200, 88, 88, 88, + 88, 88, 201, 88, 88, 467, 88, 205, 88, 88, + 467, 202, 88, 204, 88, 203, 88, 88, 88, 467, + 206, 88, 88, 207, 467, 467, 88, 88, 88, 88, + + 208, 467, 88, 467, 467, 88, 209, 88, 88, 467, + 88, 88, 239, 88, 210, 212, 213, 213, 213, 138, + 138, 138, 88, 88, 467, 88, 88, 467, 467, 185, + 186, 214, 467, 137, 137, 137, 214, 467, 137, 137, + 137, 217, 217, 149, 224, 224, 224, 144, 467, 145, + 145, 145, 467, 219, 155, 155, 155, 220, 149, 149, + 149, 149, 149, 149, 467, 215, 221, 154, 88, 88, + 227, 241, 240, 227, 228, 228, 228, 467, 88, 88, + 467, 88, 88, 213, 213, 213, 229, 467, 467, 222, + 230, 467, 467, 222, 222, 222, 222, 222, 222, 222, + + 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, + 222, 222, 222, 222, 222, 222, 163, 163, 163, 88, + 88, 245, 278, 278, 278, 224, 224, 224, 247, 88, + 88, 88, 88, 88, 88, 242, 243, 244, 88, 88, + 88, 88, 467, 246, 467, 467, 164, 248, 165, 88, + 88, 88, 88, 88, 467, 249, 88, 88, 252, 166, + 250, 88, 88, 167, 88, 467, 88, 88, 88, 88, + 88, 88, 88, 251, 88, 88, 253, 467, 88, 88, + 88, 278, 278, 278, 88, 467, 467, 88, 88, 254, + 88, 88, 255, 88, 88, 88, 467, 256, 257, 258, + + 88, 88, 88, 467, 88, 88, 88, 88, 88, 259, + 88, 88, 260, 88, 88, 88, 88, 88, 88, 88, + 467, 261, 88, 88, 467, 467, 262, 88, 88, 467, + 88, 88, 88, 265, 88, 88, 88, 263, 88, 264, + 88, 412, 413, 414, 88, 88, 88, 88, 88, 268, + 88, 88, 266, 88, 88, 88, 88, 267, 88, 88, + 88, 88, 88, 269, 88, 271, 272, 270, 88, 88, + 88, 88, 88, 88, 88, 88, 88, 467, 88, 88, + 273, 88, 88, 88, 88, 88, 88, 274, 467, 88, + 88, 467, 276, 275, 88, 88, 88, 88, 88, 467, + + 277, 467, 467, 88, 217, 217, 149, 217, 217, 149, + 284, 284, 228, 149, 149, 149, 282, 467, 88, 282, + 283, 467, 285, 283, 467, 227, 286, 298, 88, 221, + 467, 88, 221, 467, 467, 287, 217, 217, 149, 228, + 228, 228, 149, 149, 149, 467, 88, 467, 282, 467, + 88, 229, 288, 467, 227, 230, 88, 299, 152, 88, + 88, 221, 216, 88, 412, 413, 412, 412, 413, 412, + 289, 143, 467, 467, 289, 289, 289, 289, 289, 289, + 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, + 289, 289, 289, 289, 289, 289, 289, 88, 88, 467, + + 467, 398, 398, 398, 88, 467, 88, 88, 88, 467, + 88, 88, 302, 300, 88, 301, 88, 88, 88, 88, + 89, 467, 467, 88, 303, 467, 467, 88, 88, 88, + 467, 88, 467, 88, 305, 304, 88, 88, 88, 88, + 88, 467, 88, 88, 88, 88, 467, 307, 88, 467, + 306, 88, 467, 88, 308, 88, 88, 88, 88, 88, + 88, 312, 309, 310, 467, 467, 88, 88, 467, 88, + 88, 88, 88, 88, 88, 311, 88, 88, 88, 88, + 88, 313, 88, 314, 467, 467, 88, 467, 88, 467, + 317, 88, 88, 467, 318, 88, 88, 315, 88, 88, + + 88, 316, 319, 88, 88, 88, 88, 88, 88, 467, + 467, 88, 88, 320, 88, 88, 88, 467, 88, 88, + 322, 321, 88, 467, 88, 88, 88, 88, 324, 323, + 88, 88, 88, 412, 413, 414, 88, 467, 467, 88, + 88, 88, 88, 88, 88, 326, 88, 88, 88, 467, + 325, 327, 328, 88, 88, 231, 88, 88, 88, 88, + 88, 88, 467, 88, 88, 332, 88, 88, 467, 333, + 467, 467, 329, 412, 413, 414, 467, 467, 334, 149, + 149, 149, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 227, 150, 150, 150, 150, 150, 150, 150, 150, + + 150, 150, 150, 335, 150, 150, 150, 335, 335, 335, + 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, + 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, + 150, 150, 150, 150, 217, 217, 149, 284, 284, 228, + 217, 217, 149, 467, 88, 88, 282, 467, 467, 285, + 283, 88, 282, 286, 88, 88, 288, 88, 88, 221, + 467, 88, 287, 467, 88, 221, 217, 217, 149, 218, + 218, 218, 218, 218, 218, 218, 218, 218, 282, 218, + 218, 218, 283, 218, 218, 218, 218, 218, 218, 218, + 336, 221, 218, 218, 336, 336, 336, 336, 336, 336, + + 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 336, 336, 336, 218, 218, 218, + 218, 149, 149, 149, 467, 88, 432, 433, 432, 88, + 88, 467, 467, 227, 467, 88, 467, 230, 88, 88, + 341, 340, 88, 88, 88, 88, 88, 467, 342, 344, + 88, 88, 467, 343, 88, 88, 88, 88, 88, 88, + 88, 345, 88, 88, 88, 467, 88, 467, 88, 467, + 346, 467, 88, 467, 88, 88, 88, 347, 88, 88, + 467, 88, 350, 467, 88, 348, 349, 88, 88, 351, + 88, 467, 88, 88, 467, 467, 353, 467, 88, 88, + + 88, 467, 88, 88, 352, 88, 354, 88, 88, 88, + 467, 88, 88, 355, 88, 467, 356, 88, 467, 88, + 88, 357, 467, 88, 88, 358, 359, 88, 88, 88, + 360, 467, 88, 88, 88, 88, 88, 467, 88, 88, + 467, 88, 361, 467, 88, 88, 88, 88, 88, 88, + 88, 362, 88, 467, 88, 467, 88, 467, 363, 88, + 88, 88, 88, 88, 88, 364, 467, 88, 217, 217, + 149, 88, 88, 88, 88, 88, 217, 217, 149, 368, + 282, 467, 467, 88, 220, 467, 88, 88, 282, 88, + 369, 370, 286, 221, 217, 217, 149, 88, 88, 88, + + 88, 221, 88, 88, 467, 88, 282, 467, 88, 467, + 365, 88, 467, 88, 371, 88, 88, 88, 373, 221, + 467, 374, 88, 376, 88, 372, 375, 88, 377, 378, + 88, 467, 88, 88, 88, 88, 88, 88, 88, 88, + 88, 88, 88, 467, 88, 88, 467, 379, 467, 380, + 88, 88, 88, 88, 88, 88, 381, 88, 88, 88, + 88, 88, 88, 467, 88, 88, 88, 88, 382, 88, + 88, 88, 88, 88, 467, 88, 88, 88, 467, 88, + 88, 88, 88, 467, 88, 88, 384, 383, 88, 88, + 88, 88, 88, 388, 467, 88, 88, 88, 467, 88, + + 88, 88, 88, 88, 88, 88, 88, 88, 467, 88, + 88, 88, 88, 467, 467, 88, 391, 389, 88, 88, + 467, 88, 88, 390, 88, 88, 88, 467, 392, 393, + 88, 88, 88, 394, 395, 88, 88, 88, 467, 88, + 88, 88, 88, 88, 88, 88, 396, 88, 88, 88, + 88, 88, 88, 397, 467, 88, 88, 88, 88, 88, + 467, 88, 88, 467, 88, 88, 88, 88, 88, 88, + 88, 401, 88, 88, 400, 88, 402, 403, 88, 88, + 467, 88, 88, 88, 404, 88, 88, 88, 467, 88, + 405, 88, 88, 467, 88, 467, 88, 88, 467, 467, + + 88, 398, 398, 398, 88, 407, 88, 467, 88, 88, + 408, 467, 410, 411, 88, 88, 88, 88, 88, 467, + 409, 88, 88, 467, 467, 88, 88, 467, 88, 88, + 467, 467, 88, 467, 88, 88, 419, 420, 413, 421, + 425, 426, 427, 88, 88, 467, 423, 88, 467, 420, + 413, 420, 467, 88, 467, 467, 88, 467, 417, 467, + 467, 424, 467, 467, 419, 420, 413, 421, 467, 467, + 428, 467, 429, 434, 423, 419, 420, 413, 421, 435, + 436, 437, 467, 430, 467, 423, 467, 431, 467, 424, + 419, 420, 438, 421, 425, 426, 425, 425, 426, 425, + + 424, 467, 425, 426, 427, 467, 412, 413, 414, 467, + 412, 413, 414, 412, 413, 414, 467, 412, 413, 414, + 432, 433, 432, 467, 164, 467, 165, 164, 467, 165, + 467, 467, 428, 467, 429, 467, 467, 166, 467, 467, + 166, 167, 467, 467, 167, 430, 439, 467, 467, 431, + 440, 442, 432, 433, 432, 435, 436, 435, 467, 467, + 441, 435, 436, 435, 435, 436, 437, 420, 413, 420, + 412, 413, 412, 412, 413, 412, 417, 412, 413, 414, + 467, 412, 413, 414, 467, 412, 413, 414, 412, 413, + 414, 434, 294, 443, 444, 445, 446, 446, 446, 446, + + 446, 446, 446, 446, 446, 446, 446, 446, 446, 412, + 413, 414, 446, 446, 446, 446, 448, 467, 446, 447, + 449, 412, 413, 414, 412, 413, 412, 412, 413, 414, + 412, 413, 412, 412, 413, 414, 412, 413, 414, 467, + 412, 413, 414, 446, 446, 446, 446, 337, 450, 451, + 452, 453, 453, 453, 453, 453, 453, 453, 453, 453, + 453, 453, 453, 453, 455, 454, 467, 453, 453, 453, + 453, 457, 467, 453, 412, 413, 414, 412, 413, 414, + 412, 413, 412, 412, 413, 412, 412, 413, 414, 412, + 413, 414, 412, 413, 412, 412, 413, 412, 453, 453, + + 453, 453, 467, 456, 412, 413, 414, 412, 413, 414, + 467, 458, 387, 459, 460, 461, 462, 462, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 462, 462, 467, + 467, 467, 462, 462, 462, 462, 467, 467, 462, 467, + 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, + 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, + 467, 467, 467, 462, 462, 462, 462, 399, 463, 464, + 465, 466, 466, 466, 466, 466, 466, 466, 466, 466, + 466, 466, 466, 466, 467, 467, 467, 466, 466, 466, + 466, 467, 467, 466, 467, 467, 467, 467, 467, 467, + + 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, + 467, 467, 467, 467, 467, 467, 467, 467, 466, 466, + 466, 466, 60, 60, 467, 60, 60, 60, 60, 60, + 65, 65, 467, 65, 65, 65, 65, 65, 88, 88, + 467, 467, 88, 88, 88, 139, 139, 467, 139, 139, + 139, 139, 139, 150, 150, 150, 150, 150, 150, 150, + 150, 153, 153, 153, 153, 153, 153, 153, 153, 157, + 157, 157, 218, 218, 218, 218, 218, 218, 218, 218, + 226, 226, 226, 149, 149, 149, 149, 149, 149, 149, + 149, 232, 232, 280, 280, 280, 217, 217, 217, 217, + + 217, 217, 217, 217, 290, 290, 231, 231, 231, 231, + 231, 231, 231, 231, 294, 294, 294, 294, 294, 330, + 330, 331, 331, 331, 331, 331, 331, 331, 331, 337, + 337, 337, 337, 337, 387, 387, 387, 387, 387, 399, + 399, 399, 399, 399, 406, 406, 406, 406, 406, 406, + 406, 406, 415, 415, 415, 415, 415, 415, 415, 416, + 416, 467, 416, 416, 416, 416, 416, 422, 422, 422, + 422, 422, 422, 422, 422, 419, 419, 467, 419, 419, + 419, 419, 419, 7, 467, 467, 467, 467, 467, 467, + 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, + + 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, + 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, + 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, + 467, 467, 467, 467, 467, 467, 467, 467, 467 + } ; + +static yyconst flex_int16_t yy_chk[2240] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, + 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, + 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, + 6, 6, 6, 12, 19, 4, 16, 20, 21, 480, + 21, 21, 21, 19, 22, 20, 27, 27, 22, 6, + + 434, 16, 49, 12, 22, 23, 418, 23, 23, 23, + 24, 385, 24, 24, 24, 25, 366, 25, 25, 25, + 29, 29, 30, 30, 30, 32, 32, 32, 33, 33, + 33, 49, 34, 34, 34, 36, 35, 86, 86, 23, + 35, 30, 37, 25, 32, 36, 35, 33, 36, 35, + 37, 34, 37, 38, 41, 37, 36, 38, 35, 34, + 37, 365, 339, 38, 41, 65, 38, 41, 32, 34, + 33, 39, 34, 41, 227, 40, 39, 60, 227, 40, + 65, 39, 39, 39, 39, 40, 42, 39, 40, 407, + 43, 419, 416, 40, 43, 338, 42, 60, 44, 42, + + 43, 42, 44, 43, 42, 297, 419, 45, 44, 407, + 296, 44, 416, 286, 45, 44, 44, 45, 44, 46, + 45, 47, 45, 139, 142, 46, 46, 280, 48, 45, + 46, 47, 139, 142, 47, 48, 48, 238, 48, 237, + 52, 48, 52, 236, 52, 52, 52, 53, 53, 52, + 53, 53, 53, 233, 54, 53, 54, 54, 54, 55, + 230, 143, 56, 55, 56, 56, 56, 226, 220, 55, + 143, 57, 55, 57, 57, 57, 58, 215, 58, 58, + 58, 73, 73, 73, 167, 74, 74, 74, 77, 77, + 77, 78, 88, 78, 78, 78, 56, 74, 87, 87, + + 87, 74, 88, 90, 58, 88, 89, 89, 89, 92, + 91, 93, 166, 90, 91, 165, 90, 87, 94, 92, + 91, 93, 92, 91, 93, 92, 92, 95, 94, 96, + 94, 94, 95, 97, 101, 164, 89, 95, 89, 96, + 95, 99, 96, 97, 101, 97, 97, 101, 98, 89, + 98, 99, 100, 89, 99, 162, 158, 99, 98, 157, + 102, 98, 100, 153, 103, 100, 152, 146, 104, 100, + 102, 133, 102, 102, 103, 105, 106, 103, 104, 103, + 104, 104, 84, 107, 82, 105, 106, 80, 105, 106, + 108, 109, 105, 107, 79, 75, 107, 107, 110, 72, + + 108, 109, 66, 108, 109, 62, 108, 108, 110, 110, + 111, 110, 112, 59, 113, 110, 51, 50, 113, 114, + 111, 114, 112, 111, 113, 112, 115, 113, 28, 114, + 111, 117, 114, 119, 115, 26, 115, 116, 116, 115, + 18, 117, 118, 119, 117, 15, 119, 116, 117, 14, + 116, 120, 118, 11, 7, 118, 2, 122, 121, 118, + 0, 120, 0, 123, 120, 120, 121, 122, 121, 124, + 122, 121, 122, 123, 125, 0, 123, 125, 127, 124, + 0, 123, 124, 124, 125, 123, 126, 125, 127, 0, + 126, 127, 128, 127, 0, 0, 126, 130, 129, 126, + + 128, 0, 128, 0, 0, 128, 129, 130, 129, 0, + 130, 129, 168, 134, 130, 134, 135, 135, 135, 138, + 138, 138, 168, 134, 0, 168, 134, 0, 0, 134, + 134, 136, 0, 136, 136, 136, 137, 0, 137, 137, + 137, 140, 140, 140, 144, 144, 144, 145, 0, 145, + 145, 145, 0, 140, 155, 155, 155, 140, 149, 149, + 149, 150, 150, 150, 0, 136, 140, 141, 169, 170, + 149, 170, 169, 150, 151, 151, 151, 0, 169, 170, + 0, 169, 170, 213, 213, 213, 151, 0, 0, 141, + 151, 0, 0, 141, 141, 141, 141, 141, 141, 141, + + 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, + 141, 141, 141, 141, 141, 141, 163, 163, 163, 171, + 172, 173, 214, 214, 214, 224, 224, 224, 175, 171, + 172, 173, 171, 172, 173, 171, 172, 172, 175, 174, + 176, 175, 0, 174, 0, 0, 163, 176, 163, 174, + 176, 177, 174, 176, 0, 177, 178, 179, 180, 163, + 178, 177, 181, 163, 177, 0, 178, 179, 180, 178, + 179, 180, 181, 179, 182, 181, 182, 0, 183, 184, + 185, 278, 278, 278, 182, 0, 0, 182, 183, 184, + 185, 183, 184, 185, 186, 187, 0, 185, 186, 187, + + 189, 188, 190, 0, 186, 187, 191, 186, 187, 188, + 189, 188, 190, 189, 188, 190, 191, 192, 193, 191, + 0, 191, 194, 195, 0, 0, 192, 192, 193, 0, + 192, 193, 194, 195, 196, 194, 195, 193, 197, 194, + 198, 406, 406, 406, 196, 199, 200, 196, 197, 199, + 198, 197, 196, 198, 201, 199, 200, 198, 199, 200, + 203, 202, 204, 200, 201, 202, 204, 201, 206, 207, + 203, 202, 204, 203, 202, 204, 205, 0, 206, 207, + 205, 206, 207, 209, 208, 210, 205, 208, 0, 205, + 212, 0, 210, 209, 208, 210, 209, 208, 210, 0, + + 212, 0, 0, 212, 217, 217, 217, 218, 218, 218, + 219, 219, 219, 228, 228, 228, 217, 0, 239, 218, + 217, 0, 219, 218, 0, 228, 219, 239, 239, 217, + 0, 239, 218, 0, 0, 219, 221, 221, 221, 229, + 229, 229, 231, 231, 231, 0, 240, 0, 221, 0, + 241, 229, 221, 0, 231, 229, 240, 241, 231, 240, + 241, 221, 223, 241, 412, 412, 412, 413, 413, 413, + 223, 223, 0, 0, 223, 223, 223, 223, 223, 223, + 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, + 223, 223, 223, 223, 223, 223, 223, 242, 243, 0, + + 0, 384, 384, 384, 244, 0, 245, 242, 243, 0, + 242, 243, 244, 242, 244, 243, 245, 244, 246, 245, + 384, 0, 0, 247, 245, 0, 0, 248, 246, 249, + 0, 246, 0, 247, 247, 246, 247, 248, 250, 249, + 248, 0, 249, 251, 252, 253, 0, 251, 250, 0, + 250, 250, 0, 251, 252, 253, 251, 252, 253, 254, + 255, 256, 253, 254, 0, 0, 257, 258, 0, 254, + 255, 256, 254, 255, 256, 255, 257, 258, 259, 257, + 258, 257, 260, 258, 0, 0, 261, 0, 259, 0, + 262, 259, 260, 0, 263, 260, 261, 259, 264, 261, + + 262, 261, 264, 262, 263, 265, 266, 263, 264, 0, + 0, 264, 267, 265, 268, 265, 266, 0, 265, 266, + 267, 266, 267, 0, 268, 267, 269, 268, 269, 268, + 270, 271, 272, 414, 414, 414, 269, 0, 0, 269, + 270, 271, 272, 270, 271, 272, 273, 274, 275, 0, + 270, 273, 275, 276, 277, 282, 273, 274, 275, 273, + 274, 275, 0, 276, 277, 282, 276, 277, 0, 282, + 0, 0, 277, 415, 415, 415, 0, 0, 282, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 284, 284, 284, 285, 285, 285, + 287, 287, 287, 0, 298, 299, 284, 0, 0, 285, + 284, 300, 287, 285, 298, 299, 287, 298, 299, 284, + 0, 300, 285, 0, 300, 287, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, + 288, 291, 291, 291, 0, 301, 417, 417, 417, 302, + 303, 0, 0, 291, 0, 301, 0, 291, 301, 302, + 303, 302, 302, 303, 304, 305, 306, 0, 304, 306, + 307, 308, 0, 305, 304, 305, 306, 304, 305, 306, + 307, 308, 309, 307, 308, 0, 310, 0, 311, 0, + 309, 0, 309, 0, 312, 309, 310, 310, 311, 310, + 0, 311, 313, 0, 312, 311, 312, 312, 313, 313, + 314, 0, 315, 313, 0, 0, 315, 0, 316, 318, + + 314, 0, 315, 314, 314, 315, 316, 317, 316, 318, + 0, 316, 318, 317, 321, 0, 318, 317, 0, 319, + 317, 319, 0, 320, 321, 320, 321, 321, 322, 319, + 322, 0, 319, 320, 323, 324, 320, 0, 322, 325, + 0, 322, 324, 0, 323, 324, 326, 323, 324, 325, + 327, 326, 325, 0, 328, 0, 326, 0, 327, 326, + 327, 340, 329, 327, 328, 329, 0, 328, 331, 331, + 331, 340, 329, 341, 340, 329, 332, 332, 332, 340, + 331, 0, 0, 341, 331, 0, 341, 342, 332, 343, + 341, 343, 332, 331, 334, 334, 334, 342, 344, 343, + + 342, 332, 343, 345, 0, 346, 334, 0, 344, 0, + 334, 344, 0, 345, 344, 346, 345, 347, 346, 334, + 0, 347, 348, 350, 349, 345, 349, 347, 351, 352, + 347, 0, 348, 350, 349, 348, 350, 349, 351, 352, + 353, 351, 352, 0, 354, 355, 0, 354, 0, 355, + 353, 357, 356, 353, 354, 355, 356, 354, 355, 358, + 359, 357, 356, 0, 357, 356, 360, 361, 357, 358, + 359, 362, 358, 359, 0, 363, 360, 361, 0, 360, + 361, 362, 364, 0, 362, 363, 364, 363, 363, 368, + 369, 370, 364, 368, 0, 364, 371, 372, 0, 368, + + 369, 370, 368, 369, 370, 373, 371, 372, 0, 371, + 372, 374, 375, 0, 0, 373, 375, 373, 373, 377, + 0, 374, 375, 374, 374, 375, 376, 0, 376, 377, + 379, 378, 377, 378, 379, 380, 376, 381, 0, 376, + 379, 378, 382, 379, 378, 380, 382, 381, 380, 383, + 381, 388, 382, 383, 0, 382, 389, 390, 391, 383, + 0, 388, 383, 0, 388, 393, 389, 390, 391, 389, + 390, 391, 392, 394, 390, 393, 392, 394, 393, 395, + 0, 396, 392, 394, 396, 392, 394, 397, 0, 395, + 397, 396, 395, 0, 396, 0, 400, 397, 0, 0, + + 397, 398, 398, 398, 402, 398, 400, 0, 401, 400, + 398, 0, 400, 401, 402, 403, 404, 402, 401, 0, + 398, 401, 405, 0, 0, 403, 404, 0, 403, 404, + 0, 0, 405, 0, 410, 405, 408, 408, 408, 408, + 409, 409, 409, 411, 410, 0, 408, 410, 0, 420, + 420, 420, 0, 411, 0, 0, 411, 0, 420, 0, + 0, 408, 0, 0, 421, 421, 421, 421, 0, 0, + 409, 0, 409, 420, 421, 422, 422, 422, 422, 423, + 423, 423, 0, 409, 0, 422, 0, 409, 0, 421, + 424, 424, 424, 424, 425, 425, 425, 426, 426, 426, + + 422, 0, 427, 427, 427, 0, 428, 428, 428, 0, + 429, 429, 429, 430, 430, 430, 0, 431, 431, 431, + 432, 432, 432, 0, 425, 0, 425, 426, 0, 426, + 0, 0, 427, 0, 427, 0, 0, 425, 0, 0, + 426, 425, 0, 0, 426, 427, 428, 0, 0, 427, + 429, 431, 433, 433, 433, 435, 435, 435, 0, 0, + 430, 436, 436, 436, 437, 437, 437, 438, 438, 438, + 443, 443, 443, 444, 444, 444, 438, 440, 440, 440, + 0, 441, 441, 441, 0, 442, 442, 442, 445, 445, + 445, 438, 439, 439, 439, 439, 439, 439, 439, 439, + + 439, 439, 439, 439, 439, 439, 439, 439, 439, 446, + 446, 446, 439, 439, 439, 439, 441, 0, 439, 440, + 442, 448, 448, 448, 450, 450, 450, 449, 449, 449, + 451, 451, 451, 452, 452, 452, 453, 453, 453, 0, + 455, 455, 455, 439, 439, 439, 439, 447, 447, 447, + 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, + 447, 447, 447, 447, 449, 448, 0, 447, 447, 447, + 447, 455, 0, 447, 454, 454, 454, 456, 456, 456, + 459, 459, 459, 460, 460, 460, 461, 461, 461, 462, + 462, 462, 463, 463, 463, 464, 464, 464, 447, 447, + + 447, 447, 0, 454, 465, 465, 465, 466, 466, 466, + 0, 456, 457, 457, 457, 457, 457, 457, 457, 457, + 457, 457, 457, 457, 457, 457, 457, 457, 457, 0, + 0, 0, 457, 457, 457, 457, 0, 0, 457, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 457, 457, 457, 457, 458, 458, 458, + 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, + 458, 458, 458, 458, 0, 0, 0, 458, 458, 458, + 458, 0, 0, 458, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 458, 458, + 458, 458, 468, 468, 0, 468, 468, 468, 468, 468, + 469, 469, 0, 469, 469, 469, 469, 469, 470, 470, + 0, 0, 470, 470, 470, 471, 471, 0, 471, 471, + 471, 471, 471, 472, 472, 472, 472, 472, 472, 472, + 472, 473, 473, 473, 473, 473, 473, 473, 473, 474, + 474, 474, 475, 475, 475, 475, 475, 475, 475, 475, + 476, 476, 476, 477, 477, 477, 477, 477, 477, 477, + 477, 478, 478, 479, 479, 479, 481, 481, 481, 481, + + 481, 481, 481, 481, 482, 482, 483, 483, 483, 483, + 483, 483, 483, 483, 484, 484, 484, 484, 484, 485, + 485, 486, 486, 486, 486, 486, 486, 486, 486, 487, + 487, 487, 487, 487, 488, 488, 488, 488, 488, 489, + 489, 489, 489, 489, 490, 490, 490, 490, 490, 490, + 490, 490, 491, 491, 491, 491, 491, 491, 491, 492, + 492, 0, 492, 492, 492, 492, 492, 493, 493, 493, + 493, 493, 493, 493, 493, 494, 494, 0, 494, 494, + 494, 494, 494, 467, 467, 467, 467, 467, 467, 467, + 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, + + 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, + 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, + 467, 467, 467, 467, 467, 467, 467, 467, 467, 467, + 467, 467, 467, 467, 467, 467, 467, 467, 467 + } ; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +extern int avm2__flex_debug; +int avm2__flex_debug = 0; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *avm2_text; +#line 1 "tokenizer.lex" +/* tokenizer.lex + + Routines for compiling Flash2 AVM2 ABC Actionscript + + Extension module for the rfxswf library. + Part of the swftools package. + + Copyright (c) 2008 Matthias Kramm + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#line 24 "tokenizer.lex" + + +#include +#include +#include +#include +#include "../utf8.h" +#include "tokenizer.h" +#include "files.h" + +int as3_verbosity = 1; +void as3_error(const char*format, ...) +{ + char buf[1024]; + int l; + va_list arglist; + if(as3_verbosity<0) + exit(1); + va_start(arglist, format); + vsprintf(buf, format, arglist); + va_end(arglist); + fprintf(stderr, "%s:%d:%d: error: %s\n", current_filename_short, current_line, current_column, buf); + fflush(stderr); + exit(1); +} +void as3_warning(const char*format, ...) +{ + char buf[1024]; + int l; + va_list arglist; + if(as3_verbosity<1) + return; + va_start(arglist, format); + vsprintf(buf, format, arglist); + va_end(arglist); + fprintf(stderr, "%s:%d:%d: warning: %s\n", current_filename_short, current_line, current_column, buf); + fflush(stderr); +} +void as3_softwarning(const char*format, ...) +{ + char buf[1024]; + int l; + va_list arglist; + if(as3_verbosity<2) + return; + va_start(arglist, format); + vsprintf(buf, format, arglist); + va_end(arglist); + fprintf(stderr, "%s:%d:%d: warning: %s\n", current_filename_short, current_line, current_column, buf); + fflush(stderr); +} +static void dbg(const char*format, ...) +{ + char buf[1024]; + int l; + va_list arglist; + if(as3_verbosity<3) + return; + va_start(arglist, format); + vsprintf(buf, format, arglist); + va_end(arglist); + l = strlen(buf); + while(l && buf[l-1]=='\n') { + buf[l-1] = 0; + l--; + } + printf("(tokenizer) "); + printf("%s\n", buf); + fflush(stdout); +} + + + +#ifndef YY_CURRENT_BUFFER +#define YY_CURRENT_BUFFER yy_current_buffer +#endif + +void handleInclude(char*text, int len, char quotes) +{ + char*filename = 0; + if(quotes) { + char*p1 = strchr(text, '"'); + char*p2 = strrchr(text, '"'); + if(!p1 || !p2 || p1==p2) { + syntaxerror("Invalid include in line %d\n", current_line); + } + *p2 = 0; + filename = strdup(p1+1); + } else { + int i1=0,i2=len; + // find start + while(!strchr(" \n\r\t", text[i1])) i1++; + // strip + while(strchr(" \n\r\t", text[i1])) i1++; + while(strchr(" \n\r\t", text[i2-1])) i2--; + if(i2!=len) text[i2]=0; + filename = strdup(&text[i1]); + } + + char*fullfilename = enter_file(filename, YY_CURRENT_BUFFER); + avm2_in = fopen(fullfilename, "rb"); + if (!avm2_in) { + syntaxerror("Couldn't open include file \"%s\"\n", fullfilename); + } + + avm2__switch_to_buffer(avm2__create_buffer(avm2_in,YY_BUF_SIZE ) ); + //BEGIN(INITIAL); keep context +} + +static int do_unescape(const char*s, const char*end, char*n) +{ + char*o = n; + int len=0; + while(s256) + syntaxerror("octal number out of range (0-255): %d", num); + if(o) o[len] = num;len++; + continue; + } + case 'x': case 'u': { + int max=2; + char bracket = 0; + char unicode = 0; + if(*s == 'u') { + max = 6; + unicode = 1; + } + s++; + if(s==end) syntaxerror("invalid \\u or \\x at end of string"); + if(*s == '{') { + s++; + if(s==end) syntaxerror("invalid \\u{ at end of string"); + bracket=1; + } + unsigned int num=0; + int nr = 0; + while(strchr("0123456789abcdefABCDEF", *s) && (bracket || nr < max) && s='0' && *s<='9') num |= *s - '0'; + if(*s>='a' && *s<='f') num |= *s - 'a' + 10; + if(*s>='A' && *s<='F') num |= *s - 'A' + 10; + nr++; + s++; + } + if(bracket) { + if(*s=='}' && s256) + syntaxerror("byte out of range (0-255): %d", num); + if(o) o[len] = num;len++; + } + break; + } + default: + syntaxerror("unknown escape sequence: \"\\%c\"", *s); + } + } + if(o) o[len]=0; + return len; +} + +static string_t string_unescape(const char*in, int l) +{ + const char*s = in; + const char*end = &in[l]; + + int len = do_unescape(s, end, 0); + char*n = (char*)malloc(len+1); + do_unescape(s, end, n); + string_t out = string_new(n, len); + return out; +} + +static void handleString(char*s, int len) +{ + if(s[0]=='"') { + if(s[len-1]!='"') syntaxerror("String doesn't end with '\"'"); + s++;len-=2; + } + else if(s[0]=='\'') { + if(s[len-1]!='\'') syntaxerror("String doesn't end with '\"'"); + s++;len-=2; + } + else syntaxerror("String incorrectly terminated"); + + + avm2_lval.str = string_unescape(s, len); +} + + +char start_of_expression; + +static inline int mkid(int type) +{ + char*s = malloc(avm2_leng+1); + memcpy(s, avm2_text, avm2_leng); + s[avm2_leng]=0; + avm2_lval.id = s; + return type; +} + +static inline int m(int type) +{ + avm2_lval.token = type; + return type; +} + + +static char numberbuf[64]; +static char*nrbuf() +{ + if(avm2_leng>sizeof(numberbuf)-1) + syntaxerror("decimal number overflow"); + char*s = numberbuf; + memcpy(s, avm2_text, avm2_leng); + s[avm2_leng]=0; + return s; +} + +static inline int setint(int v) +{ + avm2_lval.number_int = v; + if(v>-128) + return T_BYTE; + else if(v>=-32768) + return T_SHORT; + else + return T_INT; +} +static inline int setuint(unsigned int v) +{ + avm2_lval.number_uint = v; + if(v<128) + return T_BYTE; + else if(v<32768) + return T_SHORT; + else + return T_UINT; +} +static inline int setfloat(double v) +{ + avm2_lval.number_float = v; + return T_FLOAT; +} + +static inline int handlefloat() +{ + char*s = nrbuf(); + avm2_lval.number_float = atof(s); + return T_FLOAT; +} + +static inline int handleint() +{ + char*s = nrbuf(); + char l = (avm2_text[0]=='-'); + + char*max = l?"1073741824":"2147483647"; + if(avm2_leng-l>10) { + as3_warning("integer overflow: %s (converted to Number)", s); + return handlefloat(); + } + if(avm2_leng-l==10) { + int t; + for(t=0;tmax[t]) { + as3_warning("integer overflow: %s (converted to Number)", s); + return handlefloat(); + } + else if(avm2_text[l+t]='0' && c<='9') + d+=(c&15)*base; + else if((c>='a' && c<='f') || (c>='A' && c<='F')) + d+=((c&0x0f)+9)*base; + } + return setfloat(d); +} +static inline int handlehex() +{ + char l = (avm2_text[0]=='-')+2; + int len = avm2_leng; + + if(len-l>8) { + char*s = nrbuf(); + syntaxerror("integer overflow %s", s); + } + + int t; + unsigned int v = 0; + for(t=l;t='0' && c<='9') + v|=(c&15); + else if((c>='a' && c<='f') || (c>='A' && c<='F')) + v|=(c&0x0f)+9; + } + if(l && v>1073741824) { + char*s = nrbuf(); + as3_warning("signed integer overflow: %s (converted to Number)", s); + return setfloat(v); + } + if(!l && v>2147483647) { + char*s = nrbuf(); + as3_warning("unsigned integer overflow: %s (converted to Number)", s); + return setfloat(v); + } + + if(l==3) { + return setint(-(int)v); + } else { + return setuint(v); + } +} + +void handleLabel(char*text, int len) +{ + int t; + for(t=len-1;t>=0;--t) { + if(text[t]!=' ' && + text[t]!=':') + break; + } + char*s = malloc(t+1); + memcpy(s, avm2_text, t); + s[t]=0; + avm2_lval.id = s; +} + +static int handleregexp() +{ + char*s = malloc(avm2_leng); + int len=avm2_leng-1; + memcpy(s, avm2_text+1, len); + s[len] = 0; + int t; + for(t=len;t>=0;--t) { + if(s[t]=='/') { + s[t] = 0; + break; + } + } + avm2_lval.regexp.pattern = s; + if(t==len) { + avm2_lval.regexp.options = 0; + } else { + avm2_lval.regexp.options = s+t+1; + } + return T_REGEXP; +} + +void initialize_scanner(); +#define YY_USER_INIT initialize_scanner(); + +/* count the number of lines+columns consumed by this token */ +static inline void l() { + int t; + for(t=0;t +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +static int yy_init_globals (void ); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int avm2_lex_destroy (void ); + +int avm2_get_debug (void ); + +void avm2_set_debug (int debug_flag ); + +YY_EXTRA_TYPE avm2_get_extra (void ); + +void avm2_set_extra (YY_EXTRA_TYPE user_defined ); + +FILE *avm2_get_in (void ); + +void avm2_set_in (FILE * in_str ); + +FILE *avm2_get_out (void ); + +void avm2_set_out (FILE * out_str ); + +int avm2_get_leng (void ); + +char *avm2_get_text (void ); + +int avm2_get_lineno (void ); + +void avm2_set_lineno (int line_number ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int avm2_wrap (void ); +#else +extern int avm2_wrap (void ); +#endif +#endif + + static void yyunput (int c,char *buf_ptr ); + +#ifndef yytext_ptr +static void yy_flex_strncpy (char *,yyconst char *,int ); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * ); +#endif + +#ifndef YY_NO_INPUT + +#ifdef __cplusplus +static int yyinput (void ); +#else +static int input (void ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO fwrite( avm2_text, avm2_leng, 1, avm2_out ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + int n; \ + for ( n = 0; n < max_size && \ + (c = getc( avm2_in )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( avm2_in ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, avm2_in))==0 && ferror(avm2_in)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(avm2_in); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int avm2_lex (void); + +#define YY_DECL int avm2_lex (void) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after avm2_text and avm2_leng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + if ( avm2_leng > 0 ) \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ + (avm2_text[avm2_leng - 1] == '\n'); \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + +#line 507 "tokenizer.lex" + + + +#line 1798 "tokenizer.yy.c" + + if ( !(yy_init) ) + { + (yy_init) = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! avm2_in ) + avm2_in = stdin; + + if ( ! avm2_out ) + avm2_out = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + avm2_ensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + avm2__create_buffer(avm2_in,YY_BUF_SIZE ); + } + + avm2__load_buffer_state( ); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); + + /* Support of avm2_text. */ + *yy_cp = (yy_hold_char); + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = (yy_start); + yy_current_state += YY_AT_BOL(); +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 468 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_current_state != 467 ); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + +case 1: +/* rule 1 can match eol */ +YY_RULE_SETUP +#line 510 "tokenizer.lex" +{l(); /* single line comment */} + YY_BREAK +case 2: +/* rule 2 can match eol */ +YY_RULE_SETUP +#line 511 "tokenizer.lex" +{l(); /* multi line comment */} + YY_BREAK +case 3: +YY_RULE_SETUP +#line 512 "tokenizer.lex" +{syntaxerror("syntax error: unterminated comment", avm2_text);} + YY_BREAK +case 4: +/* rule 4 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up avm2_text */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up avm2_text again */ +YY_RULE_SETUP +#line 514 "tokenizer.lex" +{l();handleInclude(avm2_text, avm2_leng, 1);} + YY_BREAK +case 5: +/* rule 5 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up avm2_text */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up avm2_text again */ +YY_RULE_SETUP +#line 515 "tokenizer.lex" +{l();handleInclude(avm2_text, avm2_leng, 0);} + YY_BREAK +case 6: +/* rule 6 can match eol */ +YY_RULE_SETUP +#line 516 "tokenizer.lex" +{l(); BEGIN(INITIAL);handleString(avm2_text, avm2_leng);return T_STRING;} + YY_BREAK + +case 7: +YY_RULE_SETUP +#line 519 "tokenizer.lex" +{c(); BEGIN(INITIAL);return handleregexp();} + YY_BREAK +case 8: +YY_RULE_SETUP +#line 520 "tokenizer.lex" +{c(); BEGIN(INITIAL);return handlehex();} + YY_BREAK +case 9: +YY_RULE_SETUP +#line 521 "tokenizer.lex" +{c(); BEGIN(INITIAL);return handlehexfloat();} + YY_BREAK +case 10: +YY_RULE_SETUP +#line 522 "tokenizer.lex" +{c(); BEGIN(INITIAL);return handleint();} + YY_BREAK +case 11: +YY_RULE_SETUP +#line 523 "tokenizer.lex" +{c(); BEGIN(INITIAL);return handlefloat();} + YY_BREAK + +case 12: +YY_RULE_SETUP +#line 526 "tokenizer.lex" +{/* utf 8 bom */} + YY_BREAK +case 13: +/* rule 13 can match eol */ +YY_RULE_SETUP +#line 527 "tokenizer.lex" +{l();} + YY_BREAK +case 14: +YY_RULE_SETUP +#line 529 "tokenizer.lex" +{c(); BEGIN(INITIAL);return handlehex();} + YY_BREAK +case 15: +YY_RULE_SETUP +#line 530 "tokenizer.lex" +{c(); BEGIN(INITIAL);return handlehexfloat();} + YY_BREAK +case 16: +YY_RULE_SETUP +#line 531 "tokenizer.lex" +{c(); BEGIN(INITIAL);return handleint();} + YY_BREAK +case 17: +YY_RULE_SETUP +#line 532 "tokenizer.lex" +{c(); BEGIN(INITIAL);return handlefloat();} + YY_BREAK +case 18: +YY_RULE_SETUP +#line 534 "tokenizer.lex" +{/* for debugging: generates a tokenizer-level error */ + syntaxerror("3rr0r");} + YY_BREAK +case 19: +/* rule 19 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up avm2_text */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up avm2_text again */ +YY_RULE_SETUP +#line 537 "tokenizer.lex" +{l();handleLabel(avm2_text, avm2_leng-3);return T_FOR;} + YY_BREAK +case 20: +/* rule 20 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up avm2_text */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up avm2_text again */ +YY_RULE_SETUP +#line 538 "tokenizer.lex" +{l();handleLabel(avm2_text, avm2_leng-2);return T_DO;} + YY_BREAK +case 21: +/* rule 21 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up avm2_text */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up avm2_text again */ +YY_RULE_SETUP +#line 539 "tokenizer.lex" +{l();handleLabel(avm2_text, avm2_leng-5);return T_WHILE;} + YY_BREAK +case 22: +/* rule 22 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up avm2_text */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up avm2_text again */ +YY_RULE_SETUP +#line 540 "tokenizer.lex" +{l();handleLabel(avm2_text, avm2_leng-6);return T_SWITCH;} + YY_BREAK +case 23: +YY_RULE_SETUP +#line 541 "tokenizer.lex" +{c();avm2_lval.id="";return T_FOR;} + YY_BREAK +case 24: +YY_RULE_SETUP +#line 542 "tokenizer.lex" +{c();avm2_lval.id="";return T_DO;} + YY_BREAK +case 25: +YY_RULE_SETUP +#line 543 "tokenizer.lex" +{c();avm2_lval.id="";return T_WHILE;} + YY_BREAK +case 26: +YY_RULE_SETUP +#line 544 "tokenizer.lex" +{c();avm2_lval.id="";return T_SWITCH;} + YY_BREAK +case 27: +YY_RULE_SETUP +#line 546 "tokenizer.lex" +{c();BEGIN(REGEXPOK);return m(T_ANDAND);} + YY_BREAK +case 28: +YY_RULE_SETUP +#line 547 "tokenizer.lex" +{c();BEGIN(REGEXPOK);return m(T_OROR);} + YY_BREAK +case 29: +YY_RULE_SETUP +#line 548 "tokenizer.lex" +{c();BEGIN(REGEXPOK);return m(T_NE);} + YY_BREAK +case 30: +YY_RULE_SETUP +#line 549 "tokenizer.lex" +{c();BEGIN(REGEXPOK);return m(T_NEE);} + YY_BREAK +case 31: +YY_RULE_SETUP +#line 550 "tokenizer.lex" +{c();BEGIN(REGEXPOK);return m(T_EQEQEQ);} + YY_BREAK +case 32: +YY_RULE_SETUP +#line 551 "tokenizer.lex" +{c();BEGIN(REGEXPOK);return m(T_EQEQ);} + YY_BREAK +case 33: +YY_RULE_SETUP +#line 552 "tokenizer.lex" +{c();return m(T_GE);} + YY_BREAK +case 34: +YY_RULE_SETUP +#line 553 "tokenizer.lex" +{c();return m(T_LE);} + YY_BREAK +case 35: +YY_RULE_SETUP +#line 554 "tokenizer.lex" +{c();BEGIN(INITIAL);return m(T_MINUSMINUS);} + YY_BREAK +case 36: +YY_RULE_SETUP +#line 555 "tokenizer.lex" +{c();BEGIN(INITIAL);return m(T_PLUSPLUS);} + YY_BREAK +case 37: +YY_RULE_SETUP +#line 556 "tokenizer.lex" +{c();return m(T_PLUSBY);} + YY_BREAK +case 38: +YY_RULE_SETUP +#line 557 "tokenizer.lex" +{c();return m(T_MINUSBY);} + YY_BREAK +case 39: +YY_RULE_SETUP +#line 558 "tokenizer.lex" +{c();return m(T_DIVBY);} + YY_BREAK +case 40: +YY_RULE_SETUP +#line 559 "tokenizer.lex" +{c();return m(T_MODBY);} + YY_BREAK +case 41: +YY_RULE_SETUP +#line 560 "tokenizer.lex" +{c();return m(T_MULBY);} + YY_BREAK +case 42: +YY_RULE_SETUP +#line 561 "tokenizer.lex" +{c();return m(T_ORBY);} + YY_BREAK +case 43: +YY_RULE_SETUP +#line 562 "tokenizer.lex" +{c();return m(T_SHRBY);} + YY_BREAK +case 44: +YY_RULE_SETUP +#line 563 "tokenizer.lex" +{c();return m(T_SHLBY);} + YY_BREAK +case 45: +YY_RULE_SETUP +#line 564 "tokenizer.lex" +{c();return m(T_USHRBY);} + YY_BREAK +case 46: +YY_RULE_SETUP +#line 565 "tokenizer.lex" +{c();return m(T_SHL);} + YY_BREAK +case 47: +YY_RULE_SETUP +#line 566 "tokenizer.lex" +{c();return m(T_USHR);} + YY_BREAK +case 48: +YY_RULE_SETUP +#line 567 "tokenizer.lex" +{c();return m(T_SHR);} + YY_BREAK +case 49: +YY_RULE_SETUP +#line 568 "tokenizer.lex" +{c();return m(T_DOTDOTDOT);} + YY_BREAK +case 50: +YY_RULE_SETUP +#line 569 "tokenizer.lex" +{c();return m(T_DOTDOT);} + YY_BREAK +case 51: +YY_RULE_SETUP +#line 570 "tokenizer.lex" +{c();return m('.');} + YY_BREAK +case 52: +YY_RULE_SETUP +#line 571 "tokenizer.lex" +{c();return m(T_COLONCOLON);} + YY_BREAK +case 53: +YY_RULE_SETUP +#line 572 "tokenizer.lex" +{c();return m(':');} + YY_BREAK +case 54: +YY_RULE_SETUP +#line 573 "tokenizer.lex" +{c();return m(KW_INSTANCEOF);} + YY_BREAK +case 55: +YY_RULE_SETUP +#line 574 "tokenizer.lex" +{c();return m(KW_IMPLEMENTS);} + YY_BREAK +case 56: +YY_RULE_SETUP +#line 575 "tokenizer.lex" +{c();return m(KW_INTERFACE);} + YY_BREAK +case 57: +YY_RULE_SETUP +#line 576 "tokenizer.lex" +{c();return m(KW_NAMESPACE);} + YY_BREAK +case 58: +YY_RULE_SETUP +#line 577 "tokenizer.lex" +{c();return m(KW_PROTECTED);} + YY_BREAK +case 59: +YY_RULE_SETUP +#line 578 "tokenizer.lex" +{c();return m(KW_UNDEFINED);} + YY_BREAK +case 60: +YY_RULE_SETUP +#line 579 "tokenizer.lex" +{c();return m(KW_CONTINUE);} + YY_BREAK +case 61: +YY_RULE_SETUP +#line 580 "tokenizer.lex" +{c();return m(KW_OVERRIDE);} + YY_BREAK +case 62: +YY_RULE_SETUP +#line 581 "tokenizer.lex" +{c();return m(KW_INTERNAL);} + YY_BREAK +case 63: +YY_RULE_SETUP +#line 582 "tokenizer.lex" +{c();return m(KW_FUNCTION);} + YY_BREAK +case 64: +YY_RULE_SETUP +#line 583 "tokenizer.lex" +{c();return m(KW_FINALLY);} + YY_BREAK +case 65: +YY_RULE_SETUP +#line 584 "tokenizer.lex" +{c();return m(KW_DEFAULT);} + YY_BREAK +case 66: +YY_RULE_SETUP +#line 585 "tokenizer.lex" +{c();return m(KW_PACKAGE);} + YY_BREAK +case 67: +YY_RULE_SETUP +#line 586 "tokenizer.lex" +{c();return m(KW_PRIVATE);} + YY_BREAK +case 68: +YY_RULE_SETUP +#line 587 "tokenizer.lex" +{c();return m(KW_DYNAMIC);} + YY_BREAK +case 69: +YY_RULE_SETUP +#line 588 "tokenizer.lex" +{c();return m(KW_EXTENDS);} + YY_BREAK +case 70: +YY_RULE_SETUP +#line 589 "tokenizer.lex" +{c();return m(KW_DELETE);} + YY_BREAK +case 71: +YY_RULE_SETUP +#line 590 "tokenizer.lex" +{c();return m(KW_RETURN);} + YY_BREAK +case 72: +YY_RULE_SETUP +#line 591 "tokenizer.lex" +{c();return m(KW_PUBLIC);} + YY_BREAK +case 73: +YY_RULE_SETUP +#line 592 "tokenizer.lex" +{c();return m(KW_NATIVE);} + YY_BREAK +case 74: +YY_RULE_SETUP +#line 593 "tokenizer.lex" +{c();return m(KW_STATIC);} + YY_BREAK +case 75: +YY_RULE_SETUP +#line 594 "tokenizer.lex" +{c();return m(KW_IMPORT);} + YY_BREAK +case 76: +YY_RULE_SETUP +#line 595 "tokenizer.lex" +{c();return m(KW_TYPEOF);} + YY_BREAK +case 77: +YY_RULE_SETUP +#line 596 "tokenizer.lex" +{c();return m(KW_THROW);} + YY_BREAK +case 78: +YY_RULE_SETUP +#line 597 "tokenizer.lex" +{c();return m(KW_CLASS);} + YY_BREAK +case 79: +YY_RULE_SETUP +#line 598 "tokenizer.lex" +{c();return m(KW_CONST);} + YY_BREAK +case 80: +YY_RULE_SETUP +#line 599 "tokenizer.lex" +{c();return m(KW_CATCH);} + YY_BREAK +case 81: +YY_RULE_SETUP +#line 600 "tokenizer.lex" +{c();return m(KW_FINAL);} + YY_BREAK +case 82: +YY_RULE_SETUP +#line 601 "tokenizer.lex" +{c();return m(KW_FALSE);} + YY_BREAK +case 83: +YY_RULE_SETUP +#line 602 "tokenizer.lex" +{c();return m(KW_BREAK);} + YY_BREAK +case 84: +YY_RULE_SETUP +#line 603 "tokenizer.lex" +{c();return m(KW_SUPER);} + YY_BREAK +case 85: +YY_RULE_SETUP +#line 604 "tokenizer.lex" +{c();return m(KW_EACH);} + YY_BREAK +case 86: +YY_RULE_SETUP +#line 605 "tokenizer.lex" +{c();return m(KW_VOID);} + YY_BREAK +case 87: +YY_RULE_SETUP +#line 606 "tokenizer.lex" +{c();return m(KW_TRUE);} + YY_BREAK +case 88: +YY_RULE_SETUP +#line 607 "tokenizer.lex" +{c();return m(KW_NULL);} + YY_BREAK +case 89: +YY_RULE_SETUP +#line 608 "tokenizer.lex" +{c();return m(KW_ELSE);} + YY_BREAK +case 90: +YY_RULE_SETUP +#line 609 "tokenizer.lex" +{c();return m(KW_CASE);} + YY_BREAK +case 91: +YY_RULE_SETUP +#line 610 "tokenizer.lex" +{c();return m(KW_WITH);} + YY_BREAK +case 92: +YY_RULE_SETUP +#line 611 "tokenizer.lex" +{c();return m(KW_USE);} + YY_BREAK +case 93: +YY_RULE_SETUP +#line 612 "tokenizer.lex" +{c();return m(KW_NEW);} + YY_BREAK +case 94: +YY_RULE_SETUP +#line 613 "tokenizer.lex" +{c();return m(KW_GET);} + YY_BREAK +case 95: +YY_RULE_SETUP +#line 614 "tokenizer.lex" +{c();return m(KW_SET);} + YY_BREAK +case 96: +YY_RULE_SETUP +#line 615 "tokenizer.lex" +{c();return m(KW_VAR);} + YY_BREAK +case 97: +YY_RULE_SETUP +#line 616 "tokenizer.lex" +{c();return m(KW_TRY);} + YY_BREAK +case 98: +YY_RULE_SETUP +#line 617 "tokenizer.lex" +{c();return m(KW_IS) ;} + YY_BREAK +case 99: +YY_RULE_SETUP +#line 618 "tokenizer.lex" +{c();return m(KW_IN) ;} + YY_BREAK +case 100: +YY_RULE_SETUP +#line 619 "tokenizer.lex" +{c();return m(KW_IF) ;} + YY_BREAK +case 101: +YY_RULE_SETUP +#line 620 "tokenizer.lex" +{c();return m(KW_AS);} + YY_BREAK +case 102: +YY_RULE_SETUP +#line 621 "tokenizer.lex" +{c();BEGIN(INITIAL);return mkid(T_IDENTIFIER);} + YY_BREAK +case 103: +YY_RULE_SETUP +#line 623 "tokenizer.lex" +{c();BEGIN(REGEXPOK);return m(avm2_text[0]);} + YY_BREAK +case 104: +YY_RULE_SETUP +#line 624 "tokenizer.lex" +{c();BEGIN(INITIAL);return m(avm2_text[0]);} + YY_BREAK +case 105: +YY_RULE_SETUP +#line 626 "tokenizer.lex" +{char c1=avm2_text[0]; + char buf[128]; + buf[0] = avm2_text[0]; + int t; + for(t=1;t<128;t++) { + char c = buf[t]=input(); + if(c=='\n' || c==EOF) { + buf[t] = 0; + break; + } + } + if(c1>='0' && c1<='9') + syntaxerror("syntax error: %s (identifiers must not start with a digit)"); + else + syntaxerror("syntax error: %s", buf); + printf("\n"); + exit(1); + yyterminate(); + } + YY_BREAK +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(REGEXPOK): +case YY_STATE_EOF(BEGINNING): +#line 645 "tokenizer.lex" +{l(); + void*b = leave_file(); + if (!b) { + yyterminate(); + avm2__delete_buffer(YY_CURRENT_BUFFER); + return m(T_EOF); + } else { + avm2__delete_buffer(YY_CURRENT_BUFFER); + avm2__switch_to_buffer(b); + } + } + YY_BREAK +case 106: +YY_RULE_SETUP +#line 657 "tokenizer.lex" +ECHO; + YY_BREAK +#line 2473 "tokenizer.yy.c" + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed avm2_in at a new source and called + * avm2_lex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = avm2_in; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( avm2_wrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * avm2_text, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ +} /* end of avm2_lex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (void) +{ + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); + register int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + avm2_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), (size_t) num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + avm2_restart(avm2_in ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) avm2_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (void) +{ + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = (yy_start); + yy_current_state += YY_AT_BOL(); + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 468 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +{ + register int yy_is_jam; + register char *yy_cp = (yy_c_buf_p); + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 468 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 467); + + return yy_is_jam ? 0 : yy_current_state; +} + + static void yyunput (int c, register char * yy_bp ) +{ + register char *yy_cp; + + yy_cp = (yy_c_buf_p); + + /* undo effects of setting up avm2_text */ + *yy_cp = (yy_hold_char); + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + register char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; +} + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (void) +#else + static int input (void) +#endif + +{ + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + int offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + avm2_restart(avm2_in ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( avm2_wrap( ) ) + return EOF; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } + + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve avm2_text */ + (yy_hold_char) = *++(yy_c_buf_p); + + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void avm2_restart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + avm2_ensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + avm2__create_buffer(avm2_in,YY_BUF_SIZE ); + } + + avm2__init_buffer(YY_CURRENT_BUFFER,input_file ); + avm2__load_buffer_state( ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void avm2__switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * avm2_pop_buffer_state(); + * avm2_push_buffer_state(new_buffer); + */ + avm2_ensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + avm2__load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (avm2_wrap()) processing, but the only time this flag + * is looked at is after avm2_wrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; +} + +static void avm2__load_buffer_state (void) +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + avm2_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE avm2__create_buffer (FILE * file, int size ) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) avm2_alloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in avm2__create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) avm2_alloc(b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in avm2__create_buffer()" ); + + b->yy_is_our_buffer = 1; + + avm2__init_buffer(b,file ); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with avm2__create_buffer() + * + */ + void avm2__delete_buffer (YY_BUFFER_STATE b ) +{ + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + avm2_free((void *) b->yy_ch_buf ); + + avm2_free((void *) b ); +} + +#ifndef _UNISTD_H /* assume unistd.h has isatty() for us */ +#ifdef __cplusplus +extern "C" { +#endif +#ifdef __THROW /* this is a gnuism */ +extern int isatty (int ) __THROW; +#else +extern int isatty (int ); +#endif +#ifdef __cplusplus +} +#endif +#endif + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a avm2_restart() or at EOF. + */ + static void avm2__init_buffer (YY_BUFFER_STATE b, FILE * file ) + +{ + int oerrno = errno; + + avm2__flush_buffer(b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then avm2__init_buffer was _probably_ + * called from avm2_restart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void avm2__flush_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + avm2__load_buffer_state( ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +void avm2_push_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + avm2_ensure_buffer_stack(); + + /* This block is copied from avm2__switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from avm2__switch_to_buffer. */ + avm2__load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +void avm2_pop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + avm2__delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + avm2__load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void avm2_ensure_buffer_stack (void) +{ + int num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)avm2_alloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in avm2_ensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)avm2_realloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in avm2_ensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE avm2__scan_buffer (char * base, yy_size_t size ) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) avm2_alloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in avm2__scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + avm2__switch_to_buffer(b ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to avm2_lex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * avm2__scan_bytes() instead. + */ +YY_BUFFER_STATE avm2__scan_string (yyconst char * yystr ) +{ + + return avm2__scan_bytes(yystr,strlen(yystr) ); +} + +/** Setup the input buffer state to scan the given bytes. The next call to avm2_lex() will + * scan from a @e copy of @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE avm2__scan_bytes (yyconst char * yybytes, int _yybytes_len ) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = _yybytes_len + 2; + buf = (char *) avm2_alloc(n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in avm2__scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = avm2__scan_buffer(buf,n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in avm2__scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yy_fatal_error (yyconst char* msg ) +{ + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up avm2_text. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + avm2_text[avm2_leng] = (yy_hold_char); \ + (yy_c_buf_p) = avm2_text + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + avm2_leng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the current line number. + * + */ +int avm2_get_lineno (void) +{ + + return avm2_lineno; +} + +/** Get the input stream. + * + */ +FILE *avm2_get_in (void) +{ + return avm2_in; +} + +/** Get the output stream. + * + */ +FILE *avm2_get_out (void) +{ + return avm2_out; +} + +/** Get the length of the current token. + * + */ +int avm2_get_leng (void) +{ + return avm2_leng; +} + +/** Get the current token. + * + */ + +char *avm2_get_text (void) +{ + return avm2_text; +} + +/** Set the current line number. + * @param line_number + * + */ +void avm2_set_lineno (int line_number ) +{ + + avm2_lineno = line_number; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param in_str A readable stream. + * + * @see avm2__switch_to_buffer + */ +void avm2_set_in (FILE * in_str ) +{ + avm2_in = in_str ; +} + +void avm2_set_out (FILE * out_str ) +{ + avm2_out = out_str ; +} + +int avm2_get_debug (void) +{ + return avm2__flex_debug; +} + +void avm2_set_debug (int bdebug ) +{ + avm2__flex_debug = bdebug ; +} + +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from avm2_lex_destroy(), so don't allocate here. + */ + + (yy_buffer_stack) = 0; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = (char *) 0; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + avm2_in = stdin; + avm2_out = stdout; +#else + avm2_in = (FILE *) 0; + avm2_out = (FILE *) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * avm2_lex_init() + */ + return 0; +} + +/* avm2_lex_destroy is for both reentrant and non-reentrant scanners. */ +int avm2_lex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + avm2__delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + avm2_pop_buffer_state(); + } + + /* Destroy the stack itself. */ + avm2_free((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * avm2_lex() is called, initialization will occur. */ + yy_init_globals( ); + + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +{ + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * s ) +{ + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *avm2_alloc (yy_size_t size ) +{ + return (void *) malloc( size ); +} + +void *avm2_realloc (void * ptr, yy_size_t size ) +{ + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); +} + +void avm2_free (void * ptr ) +{ + free( (char *) ptr ); /* see avm2_realloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 657 "tokenizer.lex" + + + +int avm2_wrap() +{ + return 1; +} + +static char mbuf[256]; +char*token2string(enum yytokentype nr, YYSTYPE v) +{ + if(nr==T_STRING) return ""; + else if(nr==T_INT) return ""; + else if(nr==T_UINT) return ""; + else if(nr==T_BYTE) return ""; + else if(nr==T_FLOAT) return ""; + else if(nr==T_REGEXP) return "REGEXP"; + else if(nr==T_EOF) return "***END***"; + else if(nr==T_GE) return ">="; + else if(nr==T_LE) return "<="; + else if(nr==T_MINUSMINUS) return "--"; + else if(nr==T_PLUSPLUS) return "++"; + else if(nr==KW_IMPLEMENTS) return "implements"; + else if(nr==KW_INTERFACE) return "interface"; + else if(nr==KW_NAMESPACE) return "namespace"; + else if(nr==KW_PROTECTED) return "protected"; + else if(nr==KW_OVERRIDE) return "override"; + else if(nr==KW_INTERNAL) return "internal"; + else if(nr==KW_FUNCTION) return "function"; + else if(nr==KW_PACKAGE) return "package"; + else if(nr==KW_PRIVATE) return "private"; + else if(nr==KW_BOOLEAN) return "Boolean"; + else if(nr==KW_DYNAMIC) return "dynamic"; + else if(nr==KW_EXTENDS) return "extends"; + else if(nr==KW_PUBLIC) return "public"; + else if(nr==KW_NATIVE) return "native"; + else if(nr==KW_STATIC) return "static"; + else if(nr==KW_IMPORT) return "import"; + else if(nr==KW_NUMBER) return "number"; + else if(nr==KW_CLASS) return "class"; + else if(nr==KW_CONST) return "const"; + else if(nr==KW_FINAL) return "final"; + else if(nr==KW_FALSE) return "False"; + else if(nr==KW_TRUE) return "True"; + else if(nr==KW_UINT) return "uint"; + else if(nr==KW_NULL) return "null"; + else if(nr==KW_ELSE) return "else"; + else if(nr==KW_USE) return "use"; + else if(nr==KW_INT) return "int"; + else if(nr==KW_NEW) return "new"; + else if(nr==KW_GET) return "get"; + else if(nr==KW_SET) return "set"; + else if(nr==KW_VAR) return "var"; + else if(nr==KW_IS) return "is"; + else if(nr==KW_AS) return "as"; + else if(nr==T_IDENTIFIER) return "ID"; + else { + sprintf(mbuf, "%d", nr); + return mbuf; + } +} + +void initialize_scanner() +{ + BEGIN(BEGINNING); +} + + -- 1.7.10.4