diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3342fb75..2a1cfecd 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,5 +3,5 @@ updates: - package-ecosystem: "gitsubmodule" directory: "/" schedule: - interval: "daily" + interval: "monthly" open-pull-requests-limit: 10 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 16f93ca8..bac0e846 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -116,6 +116,8 @@ jobs: config: debug - configuration: release config: release + - arch: x64 + platform: x64 steps: - uses: rui314/setup-mold@staging - name: Check out files diff --git a/.gitignore b/.gitignore index 6ab04163..679bdf98 100644 --- a/.gitignore +++ b/.gitignore @@ -156,23 +156,4 @@ decompiled/ assembled/ disassembled/ -data/iw5_ps3/ -data/iw5_360/ -data/iw6_ps3/ -data/iw6_360/ -data/s1_ps3/ -data/s1_360/ -data/iw5/ -data/iw6/ -data/iw7/ -data/iw8/ -data/iw9/ -data/h1/ -data/h2/ -data/s1/ -data/s2/ -data/s4/ -data/t6/ -data/t7/ -data/t8/ -data/t9/ +data/* diff --git a/README.md b/README.md index 213279f3..d5b5b663 100644 --- a/README.md +++ b/README.md @@ -18,23 +18,24 @@ A utility to compile & decompile IW engine game scripts. - **S4** *(Call of Duty: Vanguard)* `PC` `PS4` `PS5` `Xbox One` `Xbox Series X|S` - **H1** *(Call of Duty: Modern Warfare Remastered)* `PC` `PS4` `Xbox One` - **H2** *(Call of Duty: Modern Warfare 2 Campaign Remastered)* `PC` `PS4` `PS5` `Xbox One` `Xbox Series X|S` -- **T6** *(Call of Duty: Black Ops II)* `PC` -- **T7** *(Call of Duty: Black Ops III)* ***\*WIP\**** +- **T6** *(Call of Duty: Black Ops II)* `PC` `PS3` `Xbox 360` `Wii U` +- **T7** *(Call of Duty: Black Ops III)* `PC` *(Decompiler)* - **T8** *(Call of Duty: Black Ops 4)* ***\*WIP\**** - **T9** *(Call of Duty: Black Ops Cold War)* ***\*WIP\**** ## Usage -``./gsc-tool.exe `` +``./gsc-tool.exe `` -**modes**: `asm`, `disasm`, `comp`, `decomp`, `parse` +**mode**: `asm`, `disasm`, `comp`, `decomp`, `parse` - *note:* zonetool files (*.cgsc*, *.cgsc.stack*) use: `zasm`, `zdisasm`, `zcomp`, `zdecomp` modes -**games**: `iw5`, `iw6`, `iw7`, `iw8`, `iw9`, `s1`, `s2`, `s4`, `h1`, `h2`, `t6` -- *note:* PS3 & Xbox 360 use `iw5ps`, `iw5xb`, `iw6ps`, `iw6xb`, `s1ps`, `s1xb` games +**game**: `iw5`, `iw6`, `iw7`, `iw8`, `iw9`, `s1`, `s2`, `s4`, `h1`, `h2`, `t6` `t7` `t8` `t9` -**paths**: `file` or `directory` (recursive process all files inside the directory) +**system**: `pc`, `ps3`, `ps4`, `ps5`, `xb2` (*360*), `xb3` (*One*), `xb4` (*Series X|S*), `wiiu` -Example: ``./gsc-tool.exe comp iw5 ./data/iw5/my_fancy_script.gsc`` +**path**: `file` or `directory` (recursive process all files inside the directory) + +Example: ``./gsc-tool.exe comp iw5 pc ./data/iw5/my_fancy_script.gsc`` | Mode |Description | Output | |:---------|:--------------------------|:------------| @@ -62,7 +63,7 @@ note: for PS3 & Xbox 360 `.gscbin` files *(compressedLen, len, bytecodeLen)* are - treyarch (T6) format is a single buffer with gscobj data `.gsc` or `.csc`. ## Contribute -If you like my work, feel free to contribute! Would allow me to spend more time adding new features & fixing bugs. +If you like my work, consider sponsoring/donating! Would allow me to spend more time adding new features & fixing bugs. BTC: bc1qky7x9kpjlt6nsvt7pckc3wwzk8rk9pgtnmw98u\ ETH: 0x6261BBE1a33F6Fec4b722DbCe2c28B4CC02c9C7B\ diff --git a/docs/syntax.md b/docs/syntax.md deleted file mode 100644 index c2b6dee6..00000000 --- a/docs/syntax.md +++ /dev/null @@ -1 +0,0 @@ -# GSC Syntax \ No newline at end of file diff --git a/gen/arc/Makefile b/gen/arc/Makefile new file mode 100644 index 00000000..78286f55 --- /dev/null +++ b/gen/arc/Makefile @@ -0,0 +1,10 @@ +generate: arc + +clean: + rm -rf ./parser.hpp + rm -rf ./parser.cpp + +arc: parser.ypp + bison parser.ypp -Wcounterexamples + mv parser.hpp ../../include/xsk/arc/ + mv parser.cpp ../../src/arc/ diff --git a/gen/arc/parser.ypp b/gen/arc/parser.ypp new file mode 100644 index 00000000..37ef8d7e --- /dev/null +++ b/gen/arc/parser.ypp @@ -0,0 +1,1328 @@ +/* Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. +*/ + +%require "3.7" +%skeleton "lalr1.cc" +%language "c++" +%output "parser.cpp" +%defines "parser.hpp" +%define api.prefix {ARC} +%define api.namespace {xsk::arc} +%define api.location.type {xsk::arc::location} +%define api.value.type variant +%define api.token.constructor +%define api.token.raw +%define parse.assert +%define parse.trace +%define parse.error detailed +%define parse.lac full +%locations +%lex-param { xsk::arc::context const* ctx_ } +%lex-param { xsk::arc::preprocessor& ppr } +%parse-param { xsk::arc::context const* ctx_ } +%parse-param { xsk::arc::preprocessor& ppr } +%parse-param { xsk::arc::program::ptr& ast } +%parse-param { std::uint32_t index } + +%code requires +{ +#ifdef _MSC_VER +#pragma warning(disable:4065) +#pragma warning(disable:4127) +#endif +#include "context.hpp" +namespace xsk::arc { class preprocessor; } +} + +%code top +{ +#include "xsk/stdinc.hpp" +#include "xsk/arc/parser.hpp" +#include "xsk/arc/preprocessor.hpp" +using namespace xsk::arc; +namespace xsk::arc +{ + auto ARClex(context const* ctx_, preprocessor& ppr) -> parser::symbol_type; + auto parse_switch(stmt_switch& stm) -> void; +} +} + +%token HASH "#" +%token DEVBEGIN "/#" +%token DEVEND "#/" +%token INLINE "#inline" +%token INCLUDE "#include" +%token USINGTREE "#using_animtree" +%token ANIMTREE "#animtree" +%token AUTOEXEC "autoexec" +%token CODECALL "codecall" +%token PRIVATE "private" +%token ENDON "endon" +%token NOTIFY "notify" +%token WAIT "wait" +%token WAITTILL "waittill" +%token WAITTILLMATCH "waittillmatch" +%token WAITTILLFRAMEEND "waittillframeend" +%token IF "if" +%token ELSE "else" +%token DO "do" +%token WHILE "while" +%token FOR "for" +%token FOREACH "foreach" +%token IN "in" +%token SWITCH "switch" +%token CASE "case" +%token DEFAULT "default" +%token BREAK "break" +%token CONTINUE "continue" +%token RETURN "return" +%token PROFBEGIN "prof_begin" +%token PROFEND "prof_end" +%token THREAD "thread" +%token TRUE "true" +%token FALSE "false" +%token UNDEFINED "undefined" +%token SIZE "size" +%token GAME "game" +%token SELF "self" +%token ANIM "anim" +%token LEVEL "level" +%token CONST "const" +%token GETNEXTARRAYKEY "getnextarraykey" +%token GETFIRSTARRAYKEY "getfirstarraykey" +%token GETDVARCOLORALPHA "getdvarcoloralpha" +%token GETDVARCOLORBLUE "getdvarcolorblue" +%token GETDVARCOLORGREEN "getdvarcolorgreen" +%token GETDVARCOLORRED "getdvarcolorred" +%token GETDVARVECTOR "getdvarvector" +%token GETDVARFLOAT "getdvarfloat" +%token GETDVARINT "getdvarint" +%token GETDVAR "getdvar" +%token GETTIME "gettime" +%token ABS "abs" +%token VECTORTOANGLES "vectortoangles" +%token ANGLECLAMP180 "angleclamp180" +%token ANGLESTOFORWARD "anglestoforward" +%token ANGLESTORIGHT "anglestoright" +%token ANGLESTOUP "anglestoup" +%token VECTORSCALE "vectorscale" +%token ISDEFINED "isdefined" +%token LPAREN "(" +%token RPAREN ")" +%token LBRACE "{" +%token RBRACE "}" +%token LBRACKET "[" +%token RBRACKET "]" +%token COMMA "," +%token DOT "." +%token DOUBLEDOT ".." +%token ELLIPSIS "..." +%token DOUBLECOLON "::" +%token COLON ":" +%token SEMICOLON ";" +%token QMARK "?" +%token INCREMENT "++" +%token DECREMENT "--" +%token LSHIFT "<<" +%token RSHIFT ">>" +%token OR "||" +%token AND "&&" +%token EQUALITY "==" +%token INEQUALITY "!=" +%token LESS_EQUAL "<=" +%token GREATER_EQUAL ">=" +%token LESS "<" +%token GREATER ">" +%token NOT "!" +%token COMPLEMENT "~" +%token ASSIGN "=" +%token ASSIGN_ADD "+=" +%token ASSIGN_SUB "-=" +%token ASSIGN_MUL "*=" +%token ASSIGN_DIV "/=" +%token ASSIGN_MOD "%=" +%token ASSIGN_BW_OR "|=" +%token ASSIGN_BW_AND "&=" +%token ASSIGN_BW_EXOR "^=" +%token ASSIGN_RSHIFT ">>=" +%token ASSIGN_LSHIFT "<<=" +%token BITWISE_OR "|" +%token BITWISE_AND "&" +%token BITWISE_EXOR "^" +%token ADD "+" +%token SUB "-" +%token MUL "*" +%token DIV "/" +%token MOD "%" +%token PATH "path" +%token IDENTIFIER "identifier" +%token STRING "string literal" +%token ISTRING "localized string" +%token HASHSTR "hash string" +%token FLOAT "float" +%token INTEGER "integer" + +%type program +%type include +%type declaration +%type decl_usingtree +%type decl_function +%type stmt +%type stmt_or_dev +%type stmt_list +%type stmt_or_dev_list +%type stmt_dev +%type stmt_comp +%type stmt_expr +%type stmt_call +%type stmt_const +%type stmt_assign +%type stmt_endon +%type stmt_notify +%type stmt_wait +%type stmt_waittill +%type stmt_waittillmatch +%type stmt_waittillframeend +%type stmt_if +%type stmt_ifelse +%type stmt_while +%type stmt_dowhile +%type stmt_for +%type stmt_foreach +%type stmt_switch +%type stmt_case +%type stmt_default +%type stmt_break +%type stmt_continue +%type stmt_return +%type stmt_prof_begin +%type stmt_prof_end +%type expr +%type expr_or_empty +%type expr_increment +%type expr_decrement +%type expr_assign +%type expr_ternary +%type expr_binary +%type expr_primitive +%type expr_complement +%type expr_negate +%type expr_not +%type expr_call +%type expr_method +%type expr_function +%type expr_pointer +%type expr_parameters +%type expr_parameters_default +%type expr_arguments +%type expr_arguments_no_empty +%type expr_getnextarraykey +%type expr_getfirstarraykey +%type expr_getdvarcoloralpha +%type expr_getdvarcolorblue +%type expr_getdvarcolorgreen +%type expr_getdvarcolorred +%type expr_getdvarvector +%type expr_getdvarfloat +%type expr_getdvarint +%type expr_getdvar +%type expr_gettime +%type expr_abs +%type expr_vectortoangles +%type expr_angleclamp180 +%type expr_anglestoforward +%type expr_anglestoright +%type expr_anglestoup +%type expr_vectorscale +%type expr_isdefined +%type expr_reference +%type expr_array +%type expr_field +%type expr_size +%type expr_paren +%type expr_object +%type expr_empty_array +%type expr_undefined +%type expr_game +%type expr_self +%type expr_anim +%type expr_level +%type expr_animation +%type expr_animtree +%type expr_identifier_nosize +%type expr_identifier +%type expr_path +%type expr_istring +%type expr_string +%type expr_vector +%type expr_hash +%type expr_float +%type expr_integer +%type expr_false +%type expr_true + +%nonassoc SIZEOF +%nonassoc RBRACKET +%nonassoc THEN +%nonassoc ELSE +%nonassoc INCREMENT DECREMENT + +%precedence TERN +%right QMARK +%left OR +%left AND +%left BITWISE_OR +%left BITWISE_EXOR +%left BITWISE_AND +%left EQUALITY INEQUALITY +%left LESS GREATER LESS_EQUAL GREATER_EQUAL +%left LSHIFT RSHIFT +%left ADD SUB +%left MUL DIV MOD +%right NOT COMPLEMENT + +%precedence NEG +%precedence ANIMREF +%precedence PREINC PREDEC +%precedence POSTINC POSTDEC + +%start root + +%% + +root + : program { ast = std::move($1); } + | { ast = program::make(@$); } + ; + +program + : program SEMICOLON + { $$ = std::move($1); } + | program inline + { $$ = std::move($1); } + | program include + { $$ = std::move($1); $$->includes.push_back(std::move($2)); } + | program declaration + { $$ = std::move($1); $$->declarations.push_back(std::move($2)); } + | SEMICOLON + { $$ = program::make(@$); } + | inline + { $$ = program::make(@$); } + | include + { $$ = program::make(@$); $$->includes.push_back(std::move($1)); } + | declaration + { $$ = program::make(@$); $$->declarations.push_back(std::move($1)); } + ; + +inline + : INLINE expr_path SEMICOLON { ppr.push_header($2->value); } + ; + +include + : INCLUDE expr_path SEMICOLON + { $$ = include::make(@$, std::move($2)); } + ; + +declaration + : DEVBEGIN { $$ = decl_dev_begin::make(@$); } + | DEVEND { $$ = decl_dev_end::make(@$); } + | decl_usingtree { $$ = std::move($1); } + | decl_function { $$ = std::move($1); } + ; + +decl_usingtree + : USINGTREE LPAREN expr_string RPAREN SEMICOLON + { ppr.ban_header(@$); $$ = decl_usingtree::make(@$, std::move($3)); } + ; + +decl_function + : expr_identifier LPAREN expr_parameters RPAREN stmt_comp + { ppr.ban_header(@$); $$ = decl_function::make(@$, expr_identifier::make(@$, ""), std::move($1), std::move($3), std::move($5), export_flags::export_none); } + | AUTOEXEC expr_identifier LPAREN expr_parameters RPAREN stmt_comp + { ppr.ban_header(@$); $$ = decl_function::make(@$, expr_identifier::make(@$, ""), std::move($2), std::move($4), std::move($6), export_flags::export_autoexec); } + | CODECALL expr_identifier LPAREN expr_parameters RPAREN stmt_comp + { ppr.ban_header(@$); $$ = decl_function::make(@$, expr_identifier::make(@$, ""), std::move($2), std::move($4), std::move($6), export_flags::export_codecall); } + | PRIVATE expr_identifier LPAREN expr_parameters RPAREN stmt_comp + { ppr.ban_header(@$); $$ = decl_function::make(@$, expr_identifier::make(@$, ""), std::move($2), std::move($4), std::move($6), export_flags::export_private2); } + ; + +stmt + : stmt_comp { $$ = std::move($1); } + | stmt_call { $$ = std::move($1); } + | stmt_const { $$ = std::move($1); } + | stmt_assign { $$ = std::move($1); } + | stmt_endon { $$ = std::move($1); } + | stmt_notify { $$ = std::move($1); } + | stmt_wait { $$ = std::move($1); } + | stmt_waittill { $$ = std::move($1); } + | stmt_waittillmatch { $$ = std::move($1); } + | stmt_waittillframeend { $$ = std::move($1); } + | stmt_if { $$ = std::move($1); } + | stmt_ifelse { $$ = std::move($1); } + | stmt_while { $$ = std::move($1); } + | stmt_dowhile { $$ = std::move($1); } + | stmt_for { $$ = std::move($1); } + | stmt_foreach { $$ = std::move($1); } + | stmt_switch { $$ = std::move($1); } + | stmt_case { $$ = std::move($1); } + | stmt_default { $$ = std::move($1); } + | stmt_break { $$ = std::move($1); } + | stmt_continue { $$ = std::move($1); } + | stmt_return { $$ = std::move($1); } + | stmt_prof_begin { $$ = std::move($1); } + | stmt_prof_end { $$ = std::move($1); } + ; + +stmt_or_dev + : stmt { $$ = std::move($1); } + | stmt_dev { $$ = std::move($1); } + ; + +stmt_list + : stmt_list stmt + { $$ = std::move($1); $$->list.push_back(std::move($2)); } + | stmt + { $$ = stmt_list::make(@$); $$->list.push_back(std::move($1)); } + | stmt_list SEMICOLON + { $$ = std::move($1); } + | SEMICOLON + { $$ = stmt_list::make(@$); } + ; + +stmt_or_dev_list + : stmt_or_dev_list stmt_or_dev + { $$ = std::move($1); $$->list.push_back(std::move($2)); } + | stmt_or_dev + { $$ = stmt_list::make(@$); $$->list.push_back(std::move($1)); } + | stmt_or_dev_list SEMICOLON + { $$ = std::move($1); } + | SEMICOLON + { $$ = stmt_list::make(@$); } + ; + +stmt_dev + : DEVBEGIN stmt_list DEVEND { $$ = stmt_dev::make(@$, std::move($2)); } + | DEVBEGIN DEVEND { $$ = stmt_dev::make(@$, stmt_list::make(@$)); } + ; + +stmt_comp + : LBRACE stmt_or_dev_list RBRACE { $$ = stmt_comp::make(@$, std::move($2)); } + | LBRACE RBRACE { $$ = stmt_comp::make(@$, stmt_list::make(@$)); } + ; + +stmt_expr + : expr_assign + { $$ = stmt_expr::make(@$, std::move($1)); } + | expr_increment + { $$ = stmt_expr::make(@$, std::move($1)); } + | expr_decrement + { $$ = stmt_expr::make(@$, std::move($1)); } + | + { $$ = stmt_expr::make(@$, expr_empty::make(@$)); } + ; + +stmt_call + : expr_call SEMICOLON + { $$ = stmt_expr::make(@$, std::move($1)); } + | expr_method SEMICOLON + { $$ = stmt_expr::make(@$, std::move($1)); } + ; + +stmt_const + : CONST expr_identifier ASSIGN expr SEMICOLON + { $$ = stmt_expr::make(@$, expr_const::make(@$, std::move($2), std::move($4))); } + ; + +stmt_assign + : expr_assign SEMICOLON + { $$ = stmt_expr::make(@$, std::move($1)); } + | expr_increment SEMICOLON + { $$ = stmt_expr::make(@$, std::move($1)); } + | expr_decrement SEMICOLON + { $$ = stmt_expr::make(@$, std::move($1)); } + ; + +stmt_endon + : expr_object ENDON LPAREN expr RPAREN SEMICOLON + { $$ = stmt_endon::make(@$, std::move($1), std::move($4)); } + ; + +stmt_notify + : expr_object NOTIFY LPAREN expr COMMA expr_arguments_no_empty RPAREN SEMICOLON + { $$ = stmt_notify::make(@$, std::move($1), std::move($4), std::move($6)); } + | expr_object NOTIFY LPAREN expr RPAREN SEMICOLON + { $$ = stmt_notify::make(@$, std::move($1), std::move($4), expr_arguments::make(@$)); } + ; + +stmt_wait + : WAIT expr SEMICOLON + { $$ = stmt_wait::make(@$, std::move($2)); } + ; + +stmt_waittill + : expr_object WAITTILL LPAREN expr COMMA expr_arguments_no_empty RPAREN SEMICOLON + { $$ = stmt_waittill::make(@$, std::move($1), std::move($4), std::move($6)); } + | expr_object WAITTILL LPAREN expr RPAREN SEMICOLON + { $$ = stmt_waittill::make(@$, std::move($1), std::move($4), expr_arguments::make(@$)); } + ; + +stmt_waittillmatch + : expr_object WAITTILLMATCH LPAREN expr COMMA expr_arguments_no_empty RPAREN SEMICOLON + { $$ = stmt_waittillmatch::make(@$, std::move($1), std::move($4), std::move($6)); } + | expr_object WAITTILLMATCH LPAREN expr RPAREN SEMICOLON + { $$ = stmt_waittillmatch::make(@$, std::move($1), std::move($4), expr_arguments::make(@$)); } + ; + +stmt_waittillframeend + : WAITTILLFRAMEEND SEMICOLON + { $$ = stmt_waittillframeend::make(@$); } + ; + +stmt_if + : IF LPAREN expr RPAREN stmt %prec THEN + { $$ = stmt_if::make(@$, std::move($3), std::move($5)); } + ; + +stmt_ifelse + : IF LPAREN expr RPAREN stmt ELSE stmt + { $$ = stmt_ifelse::make(@$, std::move($3), std::move($5), std::move($7)); } + ; + +stmt_while + : WHILE LPAREN expr RPAREN stmt + { $$ = stmt_while::make(@$, std::move($3), std::move($5)); } + ; + +stmt_dowhile + : DO stmt WHILE LPAREN expr RPAREN SEMICOLON + { $$ = stmt_dowhile::make(@$, std::move($5), std::move($2)); } + ; + +stmt_for + : FOR LPAREN stmt_expr SEMICOLON expr_or_empty SEMICOLON stmt_expr RPAREN stmt + { $$ = stmt_for::make(@$, std::move($3), std::move($5), std::move($7), std::move($9)); } + ; + +stmt_foreach + : FOREACH LPAREN expr_identifier IN expr RPAREN stmt + { + auto array = expr_identifier::make(@$, fmt::format("_a{}", ++index)); + auto key = expr_identifier::make(@$, fmt::format("_k{}", ++index)); + $$ = stmt_foreach::make(@$, std::move($5), std::move($3), std::move(array), std::move(key), std::move($7), false); + } + | FOREACH LPAREN expr_identifier COMMA expr_identifier IN expr RPAREN stmt + { + auto array = expr_identifier::make(@$, fmt::format("_a{}", ++index)); + $$ = stmt_foreach::make(@$, std::move($7), std::move($5), std::move(array), std::move($3), std::move($9), true); + } + ; + +stmt_switch + : SWITCH LPAREN expr RPAREN stmt_comp + { $$ = stmt_switch::make(@$, std::move($3), std::move($5)); + parse_switch(*$$); + } + ; + +stmt_case + : CASE expr_integer COLON + { $$ = stmt_case::make(@$, std::move($2), stmt_list::make(@$)); } + | CASE expr_string COLON + { $$ = stmt_case::make(@$, std::move($2), stmt_list::make(@$)); } + ; + +stmt_default + : DEFAULT COLON + { $$ = stmt_default::make(@$, stmt_list::make(@$)); } + ; + +stmt_break + : BREAK SEMICOLON + { $$ = stmt_break::make(@$); } + ; + +stmt_continue + : CONTINUE SEMICOLON + { $$ = stmt_continue::make(@$); } + ; + +stmt_return + : RETURN expr SEMICOLON + { $$ = stmt_return::make(@$, std::move($2)); } + | RETURN SEMICOLON + { $$ = stmt_return::make(@$, expr_empty::make(@$)); } + ; + +stmt_prof_begin + : PROFBEGIN LPAREN expr_arguments RPAREN SEMICOLON + { $$ = stmt_prof_begin::make(@$, std::move($3)); } + ; + +stmt_prof_end + : PROFEND LPAREN expr_arguments RPAREN SEMICOLON + { $$ = stmt_prof_end::make(@$, std::move($3)); } + ; + +expr + : expr_ternary { $$ = std::move($1); } + | expr_binary { $$ = std::move($1); } + | expr_primitive { $$ = std::move($1); } + ; + +expr_or_empty + : expr { $$ = std::move($1); } + | { $$ = expr_empty::make(@$); } + ; + +expr_increment + : INCREMENT expr_object %prec PREINC + { $$ = expr_increment::make(@$, std::move($2), true); } + | expr_object INCREMENT %prec POSTINC + { $$ = expr_increment::make(@$, std::move($1), false); } + ; + +expr_decrement + : DECREMENT expr_object %prec PREDEC + { $$ = expr_decrement::make(@$, std::move($2), true); } + | expr_object DECREMENT %prec POSTDEC + { $$ = expr_decrement::make(@$, std::move($1), false); } + ; + +expr_assign + : expr_object ASSIGN expr + { $$ = expr_assign::make(@$, std::move($1), std::move($3), expr_assign::op::eq); } + | expr_object ASSIGN_BW_OR expr + { $$ = expr_assign::make(@$, std::move($1), std::move($3), expr_assign::op::bwor); } + | expr_object ASSIGN_BW_AND expr + { $$ = expr_assign::make(@$, std::move($1), std::move($3), expr_assign::op::bwand); } + | expr_object ASSIGN_BW_EXOR expr + { $$ = expr_assign::make(@$, std::move($1), std::move($3), expr_assign::op::bwexor); } + | expr_object ASSIGN_LSHIFT expr + { $$ = expr_assign::make(@$, std::move($1), std::move($3), expr_assign::op::shl); } + | expr_object ASSIGN_RSHIFT expr + { $$ = expr_assign::make(@$, std::move($1), std::move($3), expr_assign::op::shr); } + | expr_object ASSIGN_ADD expr + { $$ = expr_assign::make(@$, std::move($1), std::move($3), expr_assign::op::add); } + | expr_object ASSIGN_SUB expr + { $$ = expr_assign::make(@$, std::move($1), std::move($3), expr_assign::op::sub); } + | expr_object ASSIGN_MUL expr + { $$ = expr_assign::make(@$, std::move($1), std::move($3), expr_assign::op::mul); } + | expr_object ASSIGN_DIV expr + { $$ = expr_assign::make(@$, std::move($1), std::move($3), expr_assign::op::div); } + | expr_object ASSIGN_MOD expr + { $$ = expr_assign::make(@$, std::move($1), std::move($3), expr_assign::op::mod); } + ; + +expr_ternary + : expr QMARK expr COLON expr %prec TERN + { $$ = expr_ternary::make(@$, std::move($1), std::move($3), std::move($5)); } + ; + +expr_binary + : expr OR expr + { $$ = expr_binary::make(@$, std::move($1), std::move($3), expr_binary::op::bool_or); } + | expr AND expr + { $$ = expr_binary::make(@$, std::move($1), std::move($3), expr_binary::op::bool_and); } + | expr EQUALITY expr + { $$ = expr_binary::make(@$, std::move($1), std::move($3), expr_binary::op::eq); } + | expr INEQUALITY expr + { $$ = expr_binary::make(@$, std::move($1), std::move($3), expr_binary::op::ne); } + | expr LESS_EQUAL expr + { $$ = expr_binary::make(@$, std::move($1), std::move($3), expr_binary::op::le); } + | expr GREATER_EQUAL expr + { $$ = expr_binary::make(@$, std::move($1), std::move($3), expr_binary::op::ge); } + | expr LESS expr + { $$ = expr_binary::make(@$, std::move($1), std::move($3), expr_binary::op::lt); } + | expr GREATER expr + { $$ = expr_binary::make(@$, std::move($1), std::move($3), expr_binary::op::gt); } + | expr BITWISE_OR expr + { $$ = expr_binary::make(@$, std::move($1), std::move($3), expr_binary::op::bwor); } + | expr BITWISE_AND expr + { $$ = expr_binary::make(@$, std::move($1), std::move($3), expr_binary::op::bwand); } + | expr BITWISE_EXOR expr + { $$ = expr_binary::make(@$, std::move($1), std::move($3), expr_binary::op::bwexor); } + | expr LSHIFT expr + { $$ = expr_binary::make(@$, std::move($1), std::move($3), expr_binary::op::shl); } + | expr RSHIFT expr + { $$ = expr_binary::make(@$, std::move($1), std::move($3), expr_binary::op::shr); } + | expr ADD expr + { $$ = expr_binary::make(@$, std::move($1), std::move($3), expr_binary::op::add); } + | expr SUB expr + { $$ = expr_binary::make(@$, std::move($1), std::move($3), expr_binary::op::sub); } + | expr MUL expr + { $$ = expr_binary::make(@$, std::move($1), std::move($3), expr_binary::op::mul); } + | expr DIV expr + { $$ = expr_binary::make(@$, std::move($1), std::move($3), expr_binary::op::div); } + | expr MOD expr + { $$ = expr_binary::make(@$, std::move($1), std::move($3), expr_binary::op::mod); } + ; + +expr_primitive + : expr_complement { $$ = std::move($1); } + | expr_negate { $$ = std::move($1); } + | expr_not { $$ = std::move($1); } + | expr_call { $$ = std::move($1); } + | expr_method { $$ = std::move($1); } + | expr_getnextarraykey { $$ = std::move($1); } + | expr_getfirstarraykey { $$ = std::move($1); } + | expr_getdvarcoloralpha { $$ = std::move($1); } + | expr_getdvarcolorblue { $$ = std::move($1); } + | expr_getdvarcolorgreen { $$ = std::move($1); } + | expr_getdvarcolorred { $$ = std::move($1); } + | expr_getdvarvector { $$ = std::move($1); } + | expr_getdvarfloat { $$ = std::move($1); } + | expr_getdvarint { $$ = std::move($1); } + | expr_getdvar { $$ = std::move($1); } + | expr_gettime { $$ = std::move($1); } + | expr_abs { $$ = std::move($1); } + | expr_vectortoangles { $$ = std::move($1); } + | expr_angleclamp180 { $$ = std::move($1); } + | expr_anglestoforward { $$ = std::move($1); } + | expr_anglestoright { $$ = std::move($1); } + | expr_anglestoup { $$ = std::move($1); } + | expr_vectorscale { $$ = std::move($1); } + | expr_isdefined { $$ = std::move($1); } + | expr_reference { $$ = std::move($1); } + | expr_array { $$ = std::move($1); } + | expr_field { $$ = std::move($1); } + | expr_size { $$ = std::move($1); } + | expr_paren { $$ = std::move($1); } + | expr_empty_array { $$ = std::move($1); } + | expr_undefined { $$ = std::move($1); } + | expr_game { $$ = std::move($1); } + | expr_self { $$ = std::move($1); } + | expr_anim { $$ = std::move($1); } + | expr_level { $$ = std::move($1); } + | expr_animation { $$ = std::move($1); } + | expr_animtree { $$ = std::move($1); } + | expr_identifier { $$ = std::move($1); } + | expr_istring { $$ = std::move($1); } + | expr_string { $$ = std::move($1); } + | expr_vector { $$ = std::move($1); } + | expr_hash { $$ = std::move($1); } + | expr_float { $$ = std::move($1); } + | expr_integer { $$ = std::move($1); } + | expr_false { $$ = std::move($1); } + | expr_true { $$ = std::move($1); } + ; + +expr_complement + : COMPLEMENT expr + { $$ = expr_complement::make(@$, std::move($2)); } + ; + +expr_negate + : SUB expr_identifier %prec NEG + { $$ = expr_negate::make(@$, std::move($2)); } + | SUB expr_paren %prec NEG + { $$ = expr_negate::make(@$, std::move($2)); } + | SUB expr_array %prec NEG + { $$ = expr_negate::make(@$, std::move($2)); } + | SUB expr_field %prec NEG + { $$ = expr_negate::make(@$, std::move($2)); } + ; + +expr_not + : NOT expr + { $$ = expr_not::make(@$, std::move($2)); } + ; + +expr_call + : expr_function { $$ = expr_call::make(@$, std::move($1)); } + | expr_pointer { $$ = expr_call::make(@$, std::move($1)); } + ; +expr_method + : expr_object expr_function { $$ = expr_method::make(@$, std::move($1), std::move($2)); } + | expr_object expr_pointer { $$ = expr_method::make(@$, std::move($1), std::move($2)); } + ; + +expr_function + : expr_identifier LPAREN expr_arguments RPAREN + { $$ = expr_function::make(@$, expr_path::make(@$), std::move($1), std::move($3), call::mode::normal); } + | expr_path DOUBLECOLON expr_identifier LPAREN expr_arguments RPAREN + { $$ = expr_function::make(@$, std::move($1), std::move($3), std::move($5), call::mode::normal); } + | THREAD expr_identifier LPAREN expr_arguments RPAREN + { $$ = expr_function::make(@$, expr_path::make(@$), std::move($2), std::move($4), call::mode::thread); } + | THREAD expr_path DOUBLECOLON expr_identifier LPAREN expr_arguments RPAREN + { $$ = expr_function::make(@$, std::move($2), std::move($4), std::move($6), call::mode::thread); } + ; + +expr_pointer + : LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN + { $$ = expr_pointer::make(@$, std::move($3), std::move($7), call::mode::normal); } + | THREAD LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN + { $$ = expr_pointer::make(@$, std::move($4), std::move($8), call::mode::thread); } + ; + +expr_parameters + : expr_parameters COMMA expr_parameters_default + { $$ = std::move($1); $$->list.push_back(std::move($3)); } + | expr_parameters COMMA expr_identifier + { $$ = std::move($1); $$->list.push_back(std::move($3)); } + | expr_parameters_default + { $$ = expr_parameters::make(@$); $$->list.push_back(std::move($1)); } + | expr_identifier + { $$ = expr_parameters::make(@$); $$->list.push_back(std::move($1)); } + | + { $$ = expr_parameters::make(@$); } + ; + +expr_parameters_default + : expr_identifier ASSIGN expr + { $$ = expr_assign::make(@$, std::move($1), std::move($3), expr_assign::op::eq); } + ; + +expr_arguments + : expr_arguments_no_empty + { $$ = std::move($1); } + | + { $$ = expr_arguments::make(@$); } + ; + +expr_arguments_no_empty + : expr_arguments COMMA expr + { $$ = std::move($1); $$->list.push_back(std::move($3)); } + | expr + { $$ = expr_arguments::make(@$); $$->list.push_back(std::move($1)); } + ; + +expr_getnextarraykey + : GETNEXTARRAYKEY LPAREN expr COMMA expr RPAREN + { $$ = expr_getnextarraykey::make(@$, std::move($3), std::move($5)); } + ; + +expr_getfirstarraykey + : GETFIRSTARRAYKEY LPAREN expr RPAREN + { $$ = expr_getfirstarraykey::make(@$, std::move($3)); } + ; + +expr_getdvarcoloralpha + : GETDVARCOLORALPHA LPAREN expr RPAREN + { $$ = expr_getdvarcoloralpha::make(@$, std::move($3)); } + ; + +expr_getdvarcolorblue + : GETDVARCOLORBLUE LPAREN expr RPAREN + { $$ = expr_getdvarcolorblue::make(@$, std::move($3)); } + ; + +expr_getdvarcolorgreen + : GETDVARCOLORGREEN LPAREN expr RPAREN + { $$ = expr_getdvarcolorgreen::make(@$, std::move($3)); } + ; + +expr_getdvarcolorred + : GETDVARCOLORRED LPAREN expr RPAREN + { $$ = expr_getdvarcolorred::make(@$, std::move($3)); } + ; + +expr_getdvarvector + : GETDVARVECTOR LPAREN expr RPAREN + { $$ = expr_getdvarvector::make(@$, std::move($3)); } + ; + +expr_getdvarfloat + : GETDVARFLOAT LPAREN expr RPAREN + { $$ = expr_getdvarfloat::make(@$, std::move($3)); } + ; + +expr_getdvarint + : GETDVARINT LPAREN expr RPAREN + { $$ = expr_getdvarint::make(@$, std::move($3)); } + ; + +expr_getdvar + : GETDVAR LPAREN expr RPAREN + { $$ = expr_getdvar::make(@$, std::move($3)); } + ; + +expr_gettime + : GETTIME LPAREN RPAREN + { $$ = expr_gettime::make(@$); } + ; + +expr_abs + : ABS LPAREN expr RPAREN + { $$ = expr_abs::make(@$, std::move($3)); } + ; + +expr_vectortoangles + : VECTORTOANGLES LPAREN expr RPAREN + { $$ = expr_vectortoangles::make(@$, std::move($3)); } + ; + +expr_angleclamp180 + : ANGLECLAMP180 LPAREN expr RPAREN + { $$ = expr_angleclamp180::make(@$, std::move($3)); } + ; + +expr_anglestoforward + : ANGLESTOFORWARD LPAREN expr RPAREN + { $$ = expr_anglestoforward::make(@$, std::move($3)); } + ; + +expr_anglestoright + : ANGLESTORIGHT LPAREN expr RPAREN + { $$ = expr_anglestoright::make(@$, std::move($3)); } + ; + +expr_anglestoup + : ANGLESTOUP LPAREN expr RPAREN + { $$ = expr_anglestoup::make(@$, std::move($3)); } + ; + +expr_vectorscale + : VECTORSCALE LPAREN expr COMMA expr RPAREN + { $$ = expr_vectorscale::make(@$, std::move($3), std::move($5)); } + ; + +expr_isdefined + : ISDEFINED LPAREN expr RPAREN + { $$ = expr_isdefined::make(@$, std::move($3)); } + ; + +expr_reference + : DOUBLECOLON expr_identifier + { $$ = expr_reference::make(@$, expr_path::make(@$), std::move($2)); } + | expr_path DOUBLECOLON expr_identifier + { $$ = expr_reference::make(@$, std::move($1), std::move($3)); } + ; + +expr_array + : expr_object LBRACKET expr RBRACKET + { $$ = expr_array::make(@$, std::move($1), std::move($3)); } + | expr_getdvarvector LBRACKET expr RBRACKET + { $$ = expr_array::make(@$, std::move($1), std::move($3)); } + | expr_vectortoangles LBRACKET expr RBRACKET + { $$ = expr_array::make(@$, std::move($1), std::move($3)); } + | expr_angleclamp180 LBRACKET expr RBRACKET + { $$ = expr_array::make(@$, std::move($1), std::move($3)); } + | expr_anglestoforward LBRACKET expr RBRACKET + { $$ = expr_array::make(@$, std::move($1), std::move($3)); } + | expr_anglestoright LBRACKET expr RBRACKET + { $$ = expr_array::make(@$, std::move($1), std::move($3)); } + | expr_anglestoup LBRACKET expr RBRACKET + { $$ = expr_array::make(@$, std::move($1), std::move($3)); } + | expr_vectorscale LBRACKET expr RBRACKET + { $$ = expr_array::make(@$, std::move($1), std::move($3)); } + ; + +expr_field + : expr_object DOT expr_identifier_nosize + { $$ = expr_field::make(@$, std::move($1), std::move($3)); } + ; + +expr_size + : expr_object DOT SIZE %prec SIZEOF + { $$ = expr_size::make(@$, std::move($1)); } + ; + +expr_paren + : LPAREN expr RPAREN + { $$ = expr_paren::make(@$, std::move($2)); } + ; + +expr_object + : expr_call { $$ = std::move($1); } + | expr_method { $$ = std::move($1); } + | expr_array { $$ = std::move($1); } + | expr_field { $$ = std::move($1); } + | expr_game { $$ = std::move($1); } + | expr_self { $$ = std::move($1); } + | expr_anim { $$ = std::move($1); } + | expr_level { $$ = std::move($1); } + | expr_identifier { $$ = std::move($1); } + ; + +expr_empty_array + : LBRACKET RBRACKET + { $$ = expr_empty_array::make(@$); }; + ; + +expr_undefined + : UNDEFINED + { $$ = expr_undefined::make(@$); }; + ; + +expr_game + : GAME + { $$ = expr_game::make(@$); }; + ; + +expr_self + : SELF + { $$ = expr_self::make(@$); }; + ; + +expr_anim + : ANIM + { $$ = expr_anim::make(@$); }; + ; + +expr_level + : LEVEL + { $$ = expr_level::make(@$); }; + ; + +expr_animation + : MOD IDENTIFIER %prec ANIMREF + { $$ = expr_animation::make(@$, $2); }; + ; + +expr_animtree + : ANIMTREE + { $$ = expr_animtree::make(@$); }; + ; + +expr_identifier_nosize + : IDENTIFIER + { $$ = expr_identifier::make(@$, $1); }; + ; + +expr_identifier + : IDENTIFIER + { $$ = expr_identifier::make(@$, $1); }; + | SIZE + { $$ = expr_identifier::make(@$, "size"); }; + ; + +expr_path + : PATH DIV IDENTIFIER + { $$ = expr_path::make(@$, $1 + "/" + $3); }; + | IDENTIFIER + { $$ = expr_path::make(@$, $1); }; + | PATH + { $$ = expr_path::make(@$, $1); }; + ; + +expr_istring + : ISTRING + { $$ = expr_istring::make(@$, $1); }; + ; + +expr_string + : STRING + { $$ = expr_string::make(@$, $1); }; + ; + +expr_vector + : LPAREN expr COMMA expr COMMA expr RPAREN + { $$ = expr_vector::make(@$, std::move($2), std::move($4), std::move($6)); }; + ; + +expr_hash + : HASHSTR + { $$ = expr_hash::make(@$, $1); }; + ; + +expr_float + : SUB FLOAT %prec NEG + { $$ = expr_float::make(@$, "-" + $2); }; + | FLOAT + { $$ = expr_float::make(@$, $1); }; + ; + +expr_integer + : SUB INTEGER %prec NEG + { $$ = expr_integer::make(@$, "-" + $2); }; + | INTEGER + { $$ = expr_integer::make(@$, $1); }; + ; + +expr_false + : FALSE + { $$ = expr_false::make(@$); }; + ; + +expr_true + : TRUE + { $$ = expr_true::make(@$); }; + ; + +%% + +namespace xsk::arc +{ + +void parser::error(location const& loc, std::string const& msg) +{ + throw comp_error(loc, msg); +} + +auto parse_switch(stmt_switch& stm) -> void +{ + auto body = stmt_list::make(stm.body->block->loc()); + auto curr = stmt::ptr{ nullptr }; + + auto num = stm.body->block->list.size(); + + for (auto i = 0u; i < num; i++) + { + auto& entry = stm.body->block->list[0]; + + if (entry->is() || entry->is()) + { + if (curr != nullptr) + { + body->list.push_back(std::move(curr)); + } + + curr = std::move(stm.body->block->list[0]); + stm.body->block->list.erase(stm.body->block->list.begin()); + } + else + { + if (curr != nullptr) + { + if (curr->is()) + { + curr->as().body->list.push_back(std::move(entry)); + stm.body->block->list.erase(stm.body->block->list.begin()); + } + else + { + curr->as().body->list.push_back(std::move(entry)); + stm.body->block->list.erase(stm.body->block->list.begin()); + } + } + else + { + throw comp_error(entry->loc(), "missing case statement"); + } + } + } + + if (curr != nullptr) + { + body->list.push_back(std::move(curr)); + } + + stm.body->block = std::move(body); +} + +extern std::unordered_map const tok_to_parser; +extern std::unordered_map const keyword_map; + +auto map_token(context const* ctx_, token& tok) -> parser::symbol_type +{ + if (tok.type == token::NAME) + { + tok.data = ctx_->make_token(tok.data); + + auto const it = keyword_map.find(tok.data); + + if (it != keyword_map.end()) + { + return parser::symbol_type(it->second, tok.pos); + } + + return parser::symbol_type(parser::token::IDENTIFIER, std::move(tok.data), tok.pos); + } + else if (tok.type == token::PATH ||tok.type == token::STRING ||tok.type == token::ISTRING || tok.type == token::INT ||tok.type == token::FLT) + { + auto it = tok_to_parser.find(tok.type); + + if (it != tok_to_parser.end()) + { + return parser::symbol_type(it->second, std::move(tok.data), tok.pos); + } + } + else + { + auto it = tok_to_parser.find(tok.type); + + if (it != tok_to_parser.end()) + { + return parser::symbol_type(it->second, tok.pos); + } + } + + throw error(fmt::format("unmapped token! {}", (u8)tok.type)); +} + +auto ARClex(context const* ctx_, preprocessor& ppr) -> parser::symbol_type +{ + auto tok = ppr.process(); + return map_token(ctx_, tok); +} + +std::unordered_map const tok_to_parser +{{ + { token::NAME, parser::token::IDENTIFIER }, + { token::PATH, parser::token::PATH }, + { token::STRING, parser::token::STRING }, + { token::ISTRING, parser::token::ISTRING }, + { token::HASHSTR, parser::token::HASHSTR }, + { token::INT, parser::token::INTEGER }, + { token::FLT, parser::token::FLOAT }, + { token::PLUS, parser::token::ADD }, + { token::MINUS, parser::token::SUB }, + { token::STAR, parser::token::MUL }, + { token::DIV, parser::token::DIV }, + { token::MOD, parser::token::MOD }, + { token::BITOR, parser::token::BITWISE_OR }, + { token::BITAND, parser::token::BITWISE_AND }, + { token::BITEXOR, parser::token::BITWISE_EXOR }, + { token::ASSIGN, parser::token::ASSIGN }, + { token::PLUSEQ, parser::token::ASSIGN_ADD }, + { token::MINUSEQ, parser::token::ASSIGN_SUB }, + { token::STAREQ, parser::token::ASSIGN_MUL }, + { token::DIVEQ, parser::token::ASSIGN_DIV }, + { token::MODEQ, parser::token::ASSIGN_MOD }, + { token::BITOREQ, parser::token::ASSIGN_BW_OR }, + { token::BITANDEQ, parser::token::ASSIGN_BW_AND }, + { token::BITEXOREQ, parser::token::ASSIGN_BW_EXOR }, + { token::SHLEQ, parser::token::ASSIGN_LSHIFT }, + { token::SHREQ, parser::token::ASSIGN_RSHIFT }, + { token::TILDE, parser::token::COMPLEMENT }, + { token::BANG, parser::token::NOT }, + { token::GT, parser::token::GREATER }, + { token::LT, parser::token::LESS }, + { token::GE, parser::token::GREATER_EQUAL }, + { token::LE, parser::token::LESS_EQUAL }, + { token::NE, parser::token::INEQUALITY }, + { token::EQ, parser::token::EQUALITY }, + { token::OR, parser::token::OR }, + { token::AND, parser::token::AND }, + { token::SHL, parser::token::LSHIFT }, + { token::SHR, parser::token::RSHIFT }, + { token::INC, parser::token::INCREMENT }, + { token::DEC, parser::token::DECREMENT }, + { token::QMARK, parser::token::QMARK }, + { token::DOT, parser::token::DOT }, + { token::DOUBLEDOT, parser::token::DOUBLEDOT }, + { token::ELLIPSIS, parser::token::ELLIPSIS }, + { token::COMMA, parser::token::COMMA }, + { token::COLON, parser::token::COLON }, + { token::SEMICOLON, parser::token::SEMICOLON }, + { token::DOUBLECOLON, parser::token::DOUBLECOLON }, + { token::LBRACKET, parser::token::LBRACKET }, + { token::RBRACKET, parser::token::RBRACKET }, + { token::LBRACE, parser::token::LBRACE }, + { token::RBRACE, parser::token::RBRACE }, + { token::LPAREN, parser::token::LPAREN }, + { token::RPAREN, parser::token::RPAREN }, + { token::DEVBEGIN, parser::token::DEVBEGIN }, + { token::DEVEND, parser::token::DEVEND }, + { token::INLINE, parser::token::INLINE }, + { token::INCLUDE, parser::token::INCLUDE }, + { token::USINGTREE, parser::token::USINGTREE }, + { token::ANIMTREE, parser::token::ANIMTREE }, + { token::AUTOEXEC, parser::token::AUTOEXEC }, + { token::CODECALL, parser::token::CODECALL }, + { token::PRIVATE, parser::token::PRIVATE }, + { token::ENDON, parser::token::ENDON }, + { token::NOTIFY, parser::token::NOTIFY }, + { token::WAIT, parser::token::WAIT }, + { token::WAITTILL, parser::token::WAITTILL }, + { token::WAITTILLMATCH, parser::token::WAITTILLMATCH }, + { token::WAITTILLFRAMEEND, parser::token::WAITTILLFRAMEEND }, + { token::IF, parser::token::IF }, + { token::ELSE, parser::token::ELSE }, + { token::DO, parser::token::DO }, + { token::WHILE, parser::token::WHILE }, + { token::FOR, parser::token::FOR }, + { token::FOREACH, parser::token::FOREACH }, + { token::IN, parser::token::IN }, + { token::SWITCH, parser::token::SWITCH }, + { token::CASE, parser::token::CASE }, + { token::DEFAULT, parser::token::DEFAULT }, + { token::BREAK, parser::token::BREAK }, + { token::CONTINUE, parser::token::CONTINUE }, + { token::RETURN, parser::token::RETURN }, + { token::PROFBEGIN, parser::token::PROFBEGIN }, + { token::PROFEND, parser::token::PROFEND }, + { token::THREAD, parser::token::THREAD }, + { token::TRUE, parser::token::TRUE }, + { token::FALSE, parser::token::FALSE }, + { token::UNDEFINED, parser::token::UNDEFINED }, + { token::SIZE, parser::token::SIZE }, + { token::GAME, parser::token::GAME }, + { token::SELF, parser::token::SELF }, + { token::ANIM, parser::token::ANIM }, + { token::LEVEL, parser::token::LEVEL }, + { token::CONST, parser::token::CONST }, + { token::ISDEFINED, parser::token::ISDEFINED }, + { token::VECTORSCALE, parser::token::VECTORSCALE }, + { token::ANGLESTOUP, parser::token::ANGLESTOUP }, + { token::ANGLESTORIGHT, parser::token::ANGLESTORIGHT }, + { token::ANGLESTOFORWARD, parser::token::ANGLESTOFORWARD }, + { token::ANGLECLAMP180, parser::token::ANGLECLAMP180 }, + { token::VECTORTOANGLES, parser::token::VECTORTOANGLES }, + { token::ABS, parser::token::ABS }, + { token::GETTIME, parser::token::GETTIME }, + { token::GETDVAR, parser::token::GETDVAR }, + { token::GETDVARINT, parser::token::GETDVARINT }, + { token::GETDVARFLOAT, parser::token::GETDVARFLOAT }, + { token::GETDVARVECTOR, parser::token::GETDVARVECTOR }, + { token::GETDVARCOLORRED, parser::token::GETDVARCOLORRED }, + { token::GETDVARCOLORGREEN, parser::token::GETDVARCOLORGREEN }, + { token::GETDVARCOLORBLUE, parser::token::GETDVARCOLORBLUE }, + { token::GETDVARCOLORALPHA, parser::token::GETDVARCOLORALPHA }, + { token::GETFIRSTARRAYKEY, parser::token::GETFIRSTARRAYKEY }, + { token::GETNEXTARRAYKEY, parser::token::GETNEXTARRAYKEY }, + { token::EOS, parser::token::ARCEOF }, + { token::HASH, parser::token::HASH } +}}; + +std::unordered_map const keyword_map +{{ + { "autoexec", parser::token::AUTOEXEC }, + { "codecall", parser::token::CODECALL }, + { "private", parser::token::PRIVATE }, + { "endon", parser::token::ENDON }, + { "notify", parser::token::NOTIFY }, + { "wait", parser::token::WAIT }, + { "waittill", parser::token::WAITTILL }, + { "waittillmatch", parser::token::WAITTILLMATCH }, + { "waittillframeend", parser::token::WAITTILLFRAMEEND }, + { "if", parser::token::IF }, + { "else", parser::token::ELSE }, + { "do", parser::token::DO }, + { "while", parser::token::WHILE }, + { "for", parser::token::FOR }, + { "foreach", parser::token::FOREACH }, + { "in", parser::token::IN }, + { "switch", parser::token::SWITCH }, + { "case", parser::token::CASE }, + { "default", parser::token::DEFAULT }, + { "break", parser::token::BREAK }, + { "continue", parser::token::CONTINUE }, + { "return", parser::token::RETURN }, + { "prof_begin", parser::token::PROFBEGIN }, + { "prof_end", parser::token::PROFEND }, + { "thread", parser::token::THREAD }, + { "true", parser::token::TRUE }, + { "false", parser::token::FALSE }, + { "undefined", parser::token::UNDEFINED }, + { "size", parser::token::SIZE }, + { "game", parser::token::GAME }, + { "self", parser::token::SELF }, + { "anim", parser::token::ANIM }, + { "level", parser::token::LEVEL }, + { "const", parser::token::CONST }, + { "isdefined", parser::token::ISDEFINED }, + { "vectorscale", parser::token::VECTORSCALE }, + { "anglestoup", parser::token::ANGLESTOUP }, + { "anglestoright", parser::token::ANGLESTORIGHT }, + { "anglestoforward", parser::token::ANGLESTOFORWARD }, + { "angleclamp180", parser::token::ANGLECLAMP180 }, + { "vectortoangles", parser::token::VECTORTOANGLES }, + { "abs", parser::token::ABS }, + { "gettime", parser::token::GETTIME }, + { "getdvar", parser::token::GETDVAR }, + { "getdvarint", parser::token::GETDVARINT }, + { "getdvarfloat", parser::token::GETDVARFLOAT }, + { "getdvarvector", parser::token::GETDVARVECTOR }, + { "getdvarcolorred", parser::token::GETDVARCOLORRED }, + { "getdvarcolorgreen", parser::token::GETDVARCOLORGREEN }, + { "getdvarcolorblue", parser::token::GETDVARCOLORBLUE }, + { "getdvarcoloralpha", parser::token::GETDVARCOLORALPHA }, + { "getfirstarraykey", parser::token::GETFIRSTARRAYKEY }, + { "getnextarraykey", parser::token::GETNEXTARRAYKEY }, +}}; + +} // namespace xsk::arc diff --git a/include/xsk/arc/assembler.hpp b/include/xsk/arc/assembler.hpp new file mode 100644 index 00000000..a5f05103 --- /dev/null +++ b/include/xsk/arc/assembler.hpp @@ -0,0 +1,48 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "xsk/utils/writer.hpp" +#include "xsk/arc/common/types.hpp" + +namespace xsk::arc +{ + +class assembler +{ + context const* ctx_; + function const* func_; + assembly const* assembly_; + utils::writer script_; + std::unordered_map strpool_; + std::vector exports_; + std::vector imports_; + std::vector strings_; + std::vector anims_; + +public: + assembler(context const* ctx); + auto assemble(assembly const& data) -> buffer; + +private: + auto assemble_function(function& func) -> void; + auto assemble_instruction(instruction const& inst) -> void; + auto assemble_localvars(instruction const& inst) -> void; + auto assemble_jump(instruction const& inst) -> void; + auto assemble_switch(instruction const& inst) -> void; + auto assemble_end_switch(instruction const& inst) -> void; + auto process_string(std::string const& data) -> void; + auto process_function(function const& func) -> void; + auto process_instruction(instruction const& inst) -> void; + auto align_instruction(instruction& inst) -> void; + auto resolve_label(std::string const& name) -> i32; + auto resolve_string(std::string const& name) -> u16; + void add_stringref(std::string const& str, string_type type, u32 ref); + void add_importref(std::vector const& data, u32 ref); + void add_animref(std::vector const& data, u32 ref); +}; + +} // namespace xsk::arc diff --git a/include/xsk/arc/common/assembly.hpp b/include/xsk/arc/common/assembly.hpp index be94070e..a8c1b3a6 100644 --- a/include/xsk/arc/common/assembly.hpp +++ b/include/xsk/arc/common/assembly.hpp @@ -166,6 +166,11 @@ struct instruction u32 size; opcode opcode; std::vector data; + + static auto make() -> instruction::ptr + { + return std::unique_ptr(new instruction); + } }; struct function @@ -180,6 +185,11 @@ struct function std::string space; std::vector instructions; std::unordered_map labels; + + static auto make() -> function::ptr + { + return std::unique_ptr(new function); + } }; struct assembly @@ -188,21 +198,11 @@ struct assembly std::vector includes; std::vector functions; + + static auto make() -> assembly::ptr + { + return std::unique_ptr(new assembly); + } }; -inline auto make_instruction() -> std::unique_ptr -{ - return std::unique_ptr(new instruction); -} - -inline auto make_function() -> std::unique_ptr -{ - return std::unique_ptr(new function); -} - -inline auto make_assembly() -> std::unique_ptr -{ - return std::unique_ptr(new assembly); -} - } // namespace xsk::arc diff --git a/include/xsk/arc/common/asset.hpp b/include/xsk/arc/common/asset.hpp index d09a94b0..046a5b5f 100644 --- a/include/xsk/arc/common/asset.hpp +++ b/include/xsk/arc/common/asset.hpp @@ -8,33 +8,32 @@ namespace xsk::arc { -constexpr usize header_size_32 = 64; -constexpr usize header_size_64 = 72; +constexpr usize header_size_v1 = 64; +constexpr usize header_size_v2 = 72; +constexpr usize header_size_v3 = 0; -struct header +enum class string_type : u8 { - u64 magic; - u32 source_crc; - u32 include_offset; - u32 animtree_offset; - u32 cseg_offset; - u32 stringtablefixup_offset; - u32 devblock_stringtablefixup_offset; - u32 exports_offset; - u32 imports_offset; - u32 fixup_offset; - u32 profile_offset; - u32 cseg_size; - u32 name; - u16 stringtablefixup_count; - u16 exports_count; - u16 imports_count; - u16 fixup_count; - u16 profile_count; - u16 devblock_stringtablefixup_count; - u8 include_count; - u8 animtree_count; - u8 flags; + literal = 0, + canonical = 1, +}; + +enum class param_type : u8 +{ + value = 0, + reference = 1, + vararg = 2, +}; + +enum class export_flags : u8 +{ + export_none = 0x00, + export_public = 0x01, + export_autoexec = 0x02, + export_private = 0x04, + export_codecall = 0x08, + export_private2 = 0x10, + export_varargs = 0x20, }; enum class import_flags : u8 @@ -49,6 +48,58 @@ enum class import_flags : u8 unk = 0x20, // T7, T8, T9 }; +struct header +{ + u64 magic; + u32 source_crc; + u32 include_offset; + u32 animtree_offset; + u32 cseg_offset; + u32 stringtablefixup_offset; + u32 devblock_stringtablefixup_offset; + u32 exports_offset; + u32 imports_offset; + u32 fixup_offset; + u32 globalvar_offset; + u32 profile_offset; + u32 cseg_size; + u32 name; + u16 stringtablefixup_count; + u16 exports_count; + u16 imports_count; + u16 fixup_count; + u16 globalvar_count; + u16 profile_count; + u16 devblock_stringtablefixup_count; + u8 include_count; + u8 animtree_count; + u8 flags; +}; + +struct animation_ref +{ + std::string name; + u32 ref; +}; + +struct animtree_ref +{ + using ptr = std::shared_ptr; + + std::string name; + std::vector refs; + std::vector anims; +}; + +struct string_ref +{ + using ptr = std::shared_ptr; + + std::string name; + u8 type; + std::vector refs; +}; + struct import_ref { using ptr = std::shared_ptr; @@ -60,17 +111,6 @@ struct import_ref std::vector refs; }; -enum class export_flags : u8 -{ - export_none = 0x00, - export_public = 0x01, - export_autoexec = 0x02, - export_private = 0x04, - export_codecall = 0x08, - export_private2 = 0x10, - export_varargs = 0x20, -}; - struct export_ref { using ptr = std::shared_ptr; @@ -84,36 +124,4 @@ struct export_ref u8 flags; }; -enum class string_type : u8 -{ - literal = 0, - canonical = 1, -}; - -struct string_ref -{ - using ptr = std::shared_ptr; - - std::string name; - u8 type; - std::vector refs; -}; - -struct animation_ref -{ - using ptr = std::shared_ptr; - - std::string name; - u32 ref; -}; - -struct animtree_ref -{ - using ptr = std::shared_ptr; - - std::string name; - std::vector refs; - std::vector anims; -}; - } // namespace xsk::arc diff --git a/include/xsk/arc/common/ast.hpp b/include/xsk/arc/common/ast.hpp index 335c9654..28f71e97 100644 --- a/include/xsk/arc/common/ast.hpp +++ b/include/xsk/arc/common/ast.hpp @@ -14,7 +14,10 @@ struct node enum type { - null, + node_null, + node_prescriptcall, + node_voidcodepos, + expr_empty, expr_true, expr_false, expr_integer, @@ -35,6 +38,7 @@ struct node expr_game, expr_undefined, expr_empty_array, + expr_ellipsis, expr_paren, expr_size, expr_field, @@ -70,54 +74,24 @@ struct node expr_complement, expr_negate, expr_not, - expr_add, - expr_sub, - expr_mul, - expr_div, - expr_mod, - expr_shift_left, - expr_shift_right, - expr_bitwise_or, - expr_bitwise_and, - expr_bitwise_exor, - expr_super_equal, - expr_super_not_equal, - expr_equality, - expr_inequality, - expr_less_equal, - expr_greater_equal, - expr_less, - expr_greater, - expr_or, - expr_and, + expr_binary, expr_ternary, + expr_const, + expr_assign, expr_increment, expr_decrement, - expr_assign_equal, - expr_assign_add, - expr_assign_sub, - expr_assign_mul, - expr_assign_div, - expr_assign_mod, - expr_assign_shift_left, - expr_assign_shift_right, - expr_assign_bitwise_or, - expr_assign_bitwise_and, - expr_assign_bitwise_exor, + stmt_empty, stmt_list, stmt_comp, stmt_dev, stmt_expr, - stmt_call, - stmt_const, - stmt_assign, stmt_endon, stmt_notify, - stmt_realwait, stmt_wait, stmt_waittill, stmt_waittillmatch, stmt_waittillframeend, + stmt_waitrealtime, stmt_if, stmt_ifelse, stmt_while, @@ -133,6 +107,15 @@ struct node stmt_breakpoint, stmt_prof_begin, stmt_prof_end, + stmt_jmp, + stmt_jmp_back, + stmt_jmp_cond, + stmt_jmp_true, + stmt_jmp_false, + stmt_jmp_switch, + stmt_jmp_endswitch, + stmt_jmp_dev, + decl_empty, decl_function, decl_usingtree, decl_namespace, @@ -140,28 +123,9 @@ struct node decl_dev_end, include, program, - asm_loc, - asm_jmp, - asm_jmp_back, - asm_jmp_cond, - asm_jmp_true, - asm_jmp_false, - asm_switch, - asm_endswitch, - asm_prescriptcall, - asm_voidcodepos, - asm_dev, }; -public: - node() : kind_(type::null) {} - node(location const& loc) : kind_(type::null), loc_(loc) {} - node(type t) : kind_(t) {} - node(type t, location const& loc) : kind_(t), loc_(loc) {} - virtual ~node() = default; - friend bool operator==(node const& n, type t); - friend bool operator==(node const& lhs, node const& rhs); auto kind() const -> type { return kind_; } auto loc() const -> location const& { return loc_; } @@ -173,375 +137,157 @@ public: auto is_special_stmt_dev_noif() -> bool; auto is_boolean() -> bool; auto is_binary() -> bool; - auto precedence() -> u8; + auto is_assign() -> bool; + + virtual auto precedence() -> u8; + + template + static auto as(node::ptr) -> std::unique_ptr; + +protected: + node(type t) : kind_(t) {} + node(type t, location const& loc) : kind_(t), loc_(loc) {} private: type kind_; location loc_; }; -struct expr_true; -struct expr_false; -struct expr_integer; -struct expr_float; -struct expr_vector; -struct expr_hash; -struct expr_string; -struct expr_istring; -struct expr_path; -struct expr_identifier; -struct expr_animtree; -struct expr_animation; -struct expr_classes; -struct expr_world; -struct expr_level; -struct expr_anim; -struct expr_self; -struct expr_game; -struct expr_undefined; -struct expr_empty_array; -struct expr_paren; -struct expr_size; -struct expr_field; -struct expr_array; -struct expr_reference; -struct expr_getnextarraykey; -struct expr_getfirstarraykey; -struct expr_getdvarcoloralpha; -struct expr_getdvarcolorblue; -struct expr_getdvarcolorgreen; -struct expr_getdvarcolorred; -struct expr_getdvarvector; -struct expr_getdvarfloat; -struct expr_getdvarint; -struct expr_getdvar; -struct expr_gettime; -struct expr_abs; -struct expr_vectortoangles; -struct expr_angleclamp180; -struct expr_anglestoforward; -struct expr_anglestoright; -struct expr_anglestoup; -struct expr_vectorscale; -struct expr_isdefined; -struct expr_arguments; -struct expr_parameters; -struct expr_member; -struct expr_pointer; -struct expr_function; -struct expr_method; -struct expr_call; -struct expr_new; -struct expr_complement; -struct expr_negate; -struct expr_not; -struct expr_binary; -struct expr_add; -struct expr_sub; -struct expr_mul; -struct expr_div; -struct expr_mod; -struct expr_shift_left; -struct expr_shift_right; -struct expr_bitwise_or; -struct expr_bitwise_and; -struct expr_bitwise_exor; -struct expr_super_equal; -struct expr_super_not_equal; -struct expr_equality; -struct expr_inequality; -struct expr_less_equal; -struct expr_greater_equal; -struct expr_less; -struct expr_greater; -struct expr_or; -struct expr_and; -struct expr_ternary; -struct expr_increment; -struct expr_decrement; -struct expr_assign; -struct expr_assign_equal; -struct expr_assign_add; -struct expr_assign_sub; -struct expr_assign_mul; -struct expr_assign_div; -struct expr_assign_mod; -struct expr_assign_shift_left; -struct expr_assign_shift_right; -struct expr_assign_bitwise_or; -struct expr_assign_bitwise_and; -struct expr_assign_bitwise_exor; -struct stmt_list; -struct stmt_comp; -struct stmt_dev; -struct stmt_expr; -struct stmt_call; -struct stmt_const; -struct stmt_assign; -struct stmt_endon; -struct stmt_notify; -struct stmt_realwait; -struct stmt_wait; -struct stmt_waittill; -struct stmt_waittillmatch; -struct stmt_waittillframeend; -struct stmt_if; -struct stmt_ifelse; -struct stmt_while; -struct stmt_dowhile; -struct stmt_for; -struct stmt_foreach; -struct stmt_switch; -struct stmt_case; -struct stmt_default; -struct stmt_break; -struct stmt_continue; -struct stmt_return; -struct stmt_breakpoint; -struct stmt_prof_begin; -struct stmt_prof_end; -struct decl_function; -struct decl_usingtree; -struct decl_namespace; -struct decl_dev_begin; -struct decl_dev_end; -struct include; -struct program; -struct asm_loc; -struct asm_jmp; -struct asm_jmp_back; -struct asm_jmp_cond; -struct asm_jmp_false; -struct asm_jmp_true; -struct asm_switch; -struct asm_endswitch; -struct asm_prescriptcall; -struct asm_voidcodepos; -struct asm_dev; - -union call +struct expr : node { - enum class mode { normal, thread }; + using ptr = std::unique_ptr; - std::unique_ptr as_node; - std::unique_ptr as_member; - std::unique_ptr as_pointer; - std::unique_ptr as_function; + virtual ~expr() = default; - call(); - call(std::unique_ptr value); - call(call&& value); - call(call const&) = delete; - call& operator=(call const&) = delete; - ~call(); - friend auto operator==(call const& lhs, node::type rhs) -> bool; - auto loc() const -> location; - auto kind() const -> node::type; - auto label() const -> std::string; -}; - -union expr -{ - std::unique_ptr as_node; - std::unique_ptr as_true; - std::unique_ptr as_false; - std::unique_ptr as_integer; - std::unique_ptr as_float; - std::unique_ptr as_vector; - std::unique_ptr as_hash; - std::unique_ptr as_string; - std::unique_ptr as_istring; - std::unique_ptr as_path; - std::unique_ptr as_identifier; - std::unique_ptr as_animtree; - std::unique_ptr as_animation; - std::unique_ptr as_classes; - std::unique_ptr as_world; - std::unique_ptr as_level; - std::unique_ptr as_anim; - std::unique_ptr as_self; - std::unique_ptr as_game; - std::unique_ptr as_undefined; - std::unique_ptr as_empty_array; - std::unique_ptr as_paren; - std::unique_ptr as_size; - std::unique_ptr as_field; - std::unique_ptr as_array; - std::unique_ptr as_reference; - std::unique_ptr as_getnextarraykey; - std::unique_ptr as_getfirstarraykey; - std::unique_ptr as_getdvarcoloralpha; - std::unique_ptr as_getdvarcolorblue; - std::unique_ptr as_getdvarcolorgreen; - std::unique_ptr as_getdvarcolorred; - std::unique_ptr as_getdvarvector; - std::unique_ptr as_getdvarfloat; - std::unique_ptr as_getdvarint; - std::unique_ptr as_getdvar; - std::unique_ptr as_gettime; - std::unique_ptr as_abs; - std::unique_ptr as_vectortoangles; - std::unique_ptr as_angleclamp180; - std::unique_ptr as_anglestoforward; - std::unique_ptr as_anglestoright; - std::unique_ptr as_anglestoup; - std::unique_ptr as_vectorscale; - std::unique_ptr as_isdefined; - std::unique_ptr as_arguments; - std::unique_ptr as_parameters; - std::unique_ptr as_member; - std::unique_ptr as_pointer; - std::unique_ptr as_function; - std::unique_ptr as_method; - std::unique_ptr as_call; - std::unique_ptr as_new; - std::unique_ptr as_complement; - std::unique_ptr as_negate; - std::unique_ptr as_not; - std::unique_ptr as_binary; - std::unique_ptr as_add; - std::unique_ptr as_sub; - std::unique_ptr as_mul; - std::unique_ptr as_div; - std::unique_ptr as_mod; - std::unique_ptr as_shift_left; - std::unique_ptr as_shift_right; - std::unique_ptr as_bitwise_or; - std::unique_ptr as_bitwise_and; - std::unique_ptr as_bitwise_exor; - std::unique_ptr as_super_equal; - std::unique_ptr as_super_not_equal; - std::unique_ptr as_equality; - std::unique_ptr as_inequality; - std::unique_ptr as_less_equal; - std::unique_ptr as_greater_equal; - std::unique_ptr as_less; - std::unique_ptr as_greater; - std::unique_ptr as_or; - std::unique_ptr as_and; - std::unique_ptr as_ternary; - std::unique_ptr as_increment; - std::unique_ptr as_decrement; - std::unique_ptr as_assign; - std::unique_ptr as_assign_equal; - std::unique_ptr as_assign_add; - std::unique_ptr as_assign_sub; - std::unique_ptr as_assign_mul; - std::unique_ptr as_assign_div; - std::unique_ptr as_assign_mod; - std::unique_ptr as_assign_shift_left; - std::unique_ptr as_assign_shift_right; - std::unique_ptr as_assign_bw_or; - std::unique_ptr as_assign_bw_and; - std::unique_ptr as_assign_bw_exor; - - expr(); - expr(std::unique_ptr value); - expr(expr&& value); - expr& operator=(expr&& value); - expr(expr const&) = delete; - expr& operator=(expr const&) = delete; - ~expr(); - friend auto operator!=(expr const& lhs, node::type rhs) -> bool; - friend auto operator==(expr const& lhs, node::type rhs) -> bool; friend auto operator==(expr const& lhs, expr const& rhs) -> bool; - auto loc() const -> location; - auto kind() const -> node::type; - auto label() const -> std::string; + + template + auto is() const -> bool; + + template + auto as() const -> T const&; + + template + auto as() -> T&; + +protected: + expr(type t); + expr(type t, location const& loc); }; -union stmt +struct call : expr { - std::unique_ptr as_node; - std::unique_ptr as_list; - std::unique_ptr as_comp; - std::unique_ptr as_dev; - std::unique_ptr as_expr; - std::unique_ptr as_call; - std::unique_ptr as_const; - std::unique_ptr as_assign; - std::unique_ptr as_endon; - std::unique_ptr as_notify; - std::unique_ptr as_realwait; - std::unique_ptr as_wait; - std::unique_ptr as_waittill; - std::unique_ptr as_waittillmatch; - std::unique_ptr as_waittillframeend; - std::unique_ptr as_if; - std::unique_ptr as_ifelse; - std::unique_ptr as_while; - std::unique_ptr as_dowhile; - std::unique_ptr as_for; - std::unique_ptr as_foreach; - std::unique_ptr as_switch; - std::unique_ptr as_case; - std::unique_ptr as_default; - std::unique_ptr as_break; - std::unique_ptr as_continue; - std::unique_ptr as_return; - std::unique_ptr as_breakpoint; - std::unique_ptr as_prof_begin; - std::unique_ptr as_prof_end; - std::unique_ptr as_loc; - std::unique_ptr as_jump; - std::unique_ptr as_cond; - std::unique_ptr as_jump_back; - std::unique_ptr as_asm_switch; - std::unique_ptr as_asm_endswitch; - std::unique_ptr as_asm_dev; + using ptr = std::unique_ptr; - stmt(); - stmt(std::unique_ptr value); - stmt(stmt&& value); - stmt& operator=(stmt&& value); - stmt(stmt const&) = delete; - stmt& operator=(stmt const&) = delete; - ~stmt(); - friend auto operator==(stmt const& lhs, node::type rhs) -> bool; - auto loc() const -> location; - auto kind() const -> node::type; - auto label() const -> std::string; + enum class mode { normal, thread, }; + + virtual ~call() = default; + + template + auto is() const -> bool; + + template + auto as() const -> T const&; + + template + auto as() -> T&; + +protected: + call(node::type t); + call(node::type t, location const& loc); }; -union decl +struct stmt : node { - std::unique_ptr as_node; - std::unique_ptr as_dev_begin; - std::unique_ptr as_dev_end; - std::unique_ptr as_namespace; - std::unique_ptr as_usingtree; - std::unique_ptr as_function; + using ptr = std::unique_ptr; - decl(); - decl(std::unique_ptr value); - decl(decl&& value); - decl& operator=(decl&& value); - decl(decl const&) = delete; - decl& operator=(decl const&) = delete; - ~decl(); - friend auto operator==(decl const& lhs, node::type rhs) -> bool; - auto loc() const -> location; - auto kind() const -> node::type; - auto label() const -> std::string; + virtual ~stmt() = default; + + template + auto is() const -> bool; + + template + auto as() const -> T const&; + + template + auto as() -> T&; + +protected: + stmt(type t); + stmt(type t, location const& loc); }; -struct expr_true : public node +struct decl : node +{ + using ptr = std::unique_ptr; + + virtual ~decl() = default; + + template + auto is() const -> bool; + + template + auto as() const -> T const&; + + template + auto as() -> T&; + +protected: + decl(type t); + decl(type t, location const& loc); +}; + +#define XSK_ARC_AST_MAKE(node_type) \ +template \ +inline static auto make(Args&&... args) -> std::unique_ptr \ +{ \ + return std::unique_ptr(new node_type(std::forward(args)...)); \ +} + +struct node_prescriptcall : public node +{ + using ptr = std::unique_ptr; + + node_prescriptcall(location const& loc); + XSK_ARC_AST_MAKE(node_prescriptcall) +}; + +struct node_voidcodepos : public node +{ + using ptr = std::unique_ptr; + + node_voidcodepos(location const& loc); + XSK_ARC_AST_MAKE(node_voidcodepos) +}; + +struct expr_empty : public expr +{ + using ptr = std::unique_ptr; + + expr_empty(location const& loc); + friend auto operator==(expr_empty const& lhs, expr_empty const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_empty) +}; + +struct expr_true : public expr { using ptr = std::unique_ptr; expr_true(location const& loc); friend auto operator==(expr_true const& lhs, expr_true const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_true) }; -struct expr_false : public node +struct expr_false : public expr { using ptr = std::unique_ptr; expr_false(location const& loc); friend auto operator==(expr_false const& lhs, expr_false const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_false) }; -struct expr_integer : public node +struct expr_integer : public expr { using ptr = std::unique_ptr; @@ -549,9 +295,10 @@ struct expr_integer : public node expr_integer(location const& loc, std::string const& value); friend auto operator==(expr_integer const& lhs, expr_integer const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_integer) }; -struct expr_float : public node +struct expr_float : public expr { using ptr = std::unique_ptr; @@ -559,21 +306,23 @@ struct expr_float : public node expr_float(location const& loc, std::string const& value); friend auto operator==(expr_float const& lhs, expr_float const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_float) }; -struct expr_vector : public node +struct expr_vector : public expr { using ptr = std::unique_ptr; - expr x; - expr y; - expr z; + expr::ptr x; + expr::ptr y; + expr::ptr z; - expr_vector(location const& loc, expr x, expr y, expr z); + expr_vector(location const& loc, expr::ptr x, expr::ptr y, expr::ptr z); friend auto operator==(expr_vector const& lhs, expr_vector const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_vector) }; -struct expr_hash : public node +struct expr_hash : public expr { using ptr = std::unique_ptr; @@ -581,9 +330,10 @@ struct expr_hash : public node expr_hash(location const& loc, std::string const& value); friend auto operator==(expr_hash const& lhs, expr_hash const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_hash) }; -struct expr_string : public node +struct expr_string : public expr { using ptr = std::unique_ptr; @@ -591,9 +341,10 @@ struct expr_string : public node expr_string(location const& loc, std::string const& value); friend auto operator==(expr_string const& lhs, expr_string const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_string) }; -struct expr_istring : public node +struct expr_istring : public expr { using ptr = std::unique_ptr; @@ -601,9 +352,10 @@ struct expr_istring : public node expr_istring(location const& loc, std::string const& value); friend auto operator==(expr_istring const& lhs, expr_istring const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_istring) }; -struct expr_path : public node +struct expr_path : public expr { using ptr = std::unique_ptr; @@ -612,9 +364,10 @@ struct expr_path : public node expr_path(location const& loc); expr_path(location const& loc, std::string const& value); friend auto operator==(expr_path const& lhs, expr_path const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_path) }; -struct expr_identifier : public node +struct expr_identifier : public expr { using ptr = std::unique_ptr; @@ -622,17 +375,19 @@ struct expr_identifier : public node expr_identifier(location const& loc, std::string const& value); friend auto operator==(expr_identifier const& lhs, expr_identifier const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_identifier) }; -struct expr_animtree : public node +struct expr_animtree : public expr { using ptr = std::unique_ptr; expr_animtree(location const& loc); friend auto operator==(expr_animtree const& lhs, expr_animtree const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_animtree) }; -struct expr_animation : public node +struct expr_animation : public expr { using ptr = std::unique_ptr; @@ -640,115 +395,137 @@ struct expr_animation : public node expr_animation(location const& loc, std::string const& value); friend auto operator==(expr_animation const& lhs, expr_animation const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_animation) }; -struct expr_classes : public node +struct expr_classes : public expr { using ptr = std::unique_ptr; expr_classes(location const& loc); friend auto operator==(expr_classes const& lhs, expr_classes const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_classes) }; -struct expr_world : public node +struct expr_world : public expr { using ptr = std::unique_ptr; expr_world(location const& loc); friend auto operator==(expr_world const& lhs, expr_world const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_world) }; -struct expr_level : public node +struct expr_level : public expr { using ptr = std::unique_ptr; expr_level(location const& loc); friend auto operator==(expr_level const& lhs, expr_level const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_level) }; -struct expr_anim : public node +struct expr_anim : public expr { using ptr = std::unique_ptr; expr_anim(location const& loc); friend auto operator==(expr_anim const& lhs, expr_anim const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_anim) }; -struct expr_self : public node +struct expr_self : public expr { using ptr = std::unique_ptr; expr_self(location const& loc); friend auto operator==(expr_self const& lhs, expr_self const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_self) }; -struct expr_game : public node +struct expr_game : public expr { using ptr = std::unique_ptr; expr_game(location const& loc); friend auto operator==(expr_game const& lhs, expr_game const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_game) }; -struct expr_undefined : public node +struct expr_undefined : public expr { using ptr = std::unique_ptr; expr_undefined(location const& loc); friend auto operator==(expr_undefined const& lhs, expr_undefined const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_undefined) }; -struct expr_empty_array : public node +struct expr_empty_array : public expr { using ptr = std::unique_ptr; expr_empty_array(location const& loc); friend auto operator==(expr_empty_array const& lhs, expr_empty_array const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_empty_array) }; -struct expr_paren : public node +struct expr_ellipsis : public expr +{ + using ptr = std::unique_ptr; + + expr_ellipsis(location const& loc); + friend auto operator==(expr_ellipsis const& lhs, expr_ellipsis const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_ellipsis) +}; + +struct expr_paren : public expr { using ptr = std::unique_ptr; - expr value; + expr::ptr value; - expr_paren(location const& loc, expr value); + expr_paren(location const& loc, expr::ptr value); friend auto operator==(expr_paren const& lhs, expr_paren const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_paren) }; -struct expr_size : public node +struct expr_size : public expr { using ptr = std::unique_ptr; - expr obj; + expr::ptr obj; - expr_size(location const& loc, expr obj); + expr_size(location const& loc, expr::ptr obj); friend auto operator==(expr_size const& lhs, expr_size const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_size) }; -struct expr_field : public node +struct expr_field : public expr { using ptr = std::unique_ptr; - expr obj; + expr::ptr obj; expr_identifier::ptr field; - expr_field(location const& loc, expr obj, expr_identifier::ptr field); + expr_field(location const& loc, expr::ptr obj, expr_identifier::ptr field); friend auto operator==(expr_field const& lhs, expr_field const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_field) }; -struct expr_array : public node +struct expr_array : public expr { using ptr = std::unique_ptr; - expr obj; - expr key; + expr::ptr obj; + expr::ptr key; - expr_array(location const& loc, expr obj, expr key); + expr_array(location const& loc, expr::ptr obj, expr::ptr key); friend auto operator==(expr_array const& lhs, expr_array const& rhs) -> bool; + XSK_ARC_AST_MAKE(expr_array) }; -struct expr_reference : public node +struct expr_reference : public expr { using ptr = std::unique_ptr; @@ -756,222 +533,246 @@ struct expr_reference : public node expr_identifier::ptr name; expr_reference(location const& loc, expr_path::ptr path, expr_identifier::ptr name); + XSK_ARC_AST_MAKE(expr_reference) }; -struct expr_getnextarraykey : public node +struct expr_getnextarraykey : public expr { using ptr = std::unique_ptr; - expr arg1; - expr arg2; + expr::ptr arg1; + expr::ptr arg2; - expr_getnextarraykey(location const& loc, expr arg1, expr arg2); + expr_getnextarraykey(location const& loc, expr::ptr arg1, expr::ptr arg2); + XSK_ARC_AST_MAKE(expr_getnextarraykey) }; -struct expr_getfirstarraykey : public node +struct expr_getfirstarraykey : public expr { using ptr = std::unique_ptr; - expr arg; + expr::ptr arg; - expr_getfirstarraykey(location const& loc, expr arg); + expr_getfirstarraykey(location const& loc, expr::ptr arg); + XSK_ARC_AST_MAKE(expr_getfirstarraykey) }; -struct expr_getdvarcoloralpha : public node +struct expr_getdvarcoloralpha : public expr { using ptr = std::unique_ptr; - expr arg; + expr::ptr arg; - expr_getdvarcoloralpha(location const& loc, expr arg); + expr_getdvarcoloralpha(location const& loc, expr::ptr arg); + XSK_ARC_AST_MAKE(expr_getdvarcoloralpha) }; -struct expr_getdvarcolorblue : public node +struct expr_getdvarcolorblue : public expr { using ptr = std::unique_ptr; - expr arg; + expr::ptr arg; - expr_getdvarcolorblue(location const& loc, expr arg); + expr_getdvarcolorblue(location const& loc, expr::ptr arg); + XSK_ARC_AST_MAKE(expr_getdvarcolorblue) }; -struct expr_getdvarcolorgreen : public node +struct expr_getdvarcolorgreen : public expr { using ptr = std::unique_ptr; - expr arg; + expr::ptr arg; - expr_getdvarcolorgreen(location const& loc, expr arg); + expr_getdvarcolorgreen(location const& loc, expr::ptr arg); + XSK_ARC_AST_MAKE(expr_getdvarcolorgreen) }; -struct expr_getdvarcolorred : public node +struct expr_getdvarcolorred : public expr { using ptr = std::unique_ptr; - expr arg; + expr::ptr arg; - expr_getdvarcolorred(location const& loc, expr arg); + expr_getdvarcolorred(location const& loc, expr::ptr arg); + XSK_ARC_AST_MAKE(expr_getdvarcolorred) }; -struct expr_getdvarvector : public node +struct expr_getdvarvector : public expr { using ptr = std::unique_ptr; - expr arg; + expr::ptr arg; - expr_getdvarvector(location const& loc, expr arg); + expr_getdvarvector(location const& loc, expr::ptr arg); + XSK_ARC_AST_MAKE(expr_getdvarvector) }; -struct expr_getdvarfloat : public node +struct expr_getdvarfloat : public expr { using ptr = std::unique_ptr; - expr arg; + expr::ptr arg; - expr_getdvarfloat(location const& loc, expr arg); + expr_getdvarfloat(location const& loc, expr::ptr arg); + XSK_ARC_AST_MAKE(expr_getdvarfloat) }; -struct expr_getdvarint : public node +struct expr_getdvarint : public expr { using ptr = std::unique_ptr; - expr arg; + expr::ptr arg; - expr_getdvarint(location const& loc, expr arg); + expr_getdvarint(location const& loc, expr::ptr arg); + XSK_ARC_AST_MAKE(expr_getdvarint) }; -struct expr_getdvar : public node +struct expr_getdvar : public expr { using ptr = std::unique_ptr; - expr arg; + expr::ptr arg; - expr_getdvar(location const& loc, expr arg); + expr_getdvar(location const& loc, expr::ptr arg); + XSK_ARC_AST_MAKE(expr_getdvar) }; -struct expr_gettime : public node +struct expr_gettime : public expr { using ptr = std::unique_ptr; expr_gettime(location const& loc); + XSK_ARC_AST_MAKE(expr_gettime) }; -struct expr_abs : public node +struct expr_abs : public expr { using ptr = std::unique_ptr; - expr arg; + expr::ptr arg; - expr_abs(location const& loc, expr arg); + expr_abs(location const& loc, expr::ptr arg); + XSK_ARC_AST_MAKE(expr_abs) }; -struct expr_vectortoangles : public node +struct expr_vectortoangles : public expr { using ptr = std::unique_ptr; - expr arg; + expr::ptr arg; - expr_vectortoangles(location const& loc, expr arg); + expr_vectortoangles(location const& loc, expr::ptr arg); + XSK_ARC_AST_MAKE(expr_vectortoangles) }; -struct expr_angleclamp180 : public node +struct expr_angleclamp180 : public expr { using ptr = std::unique_ptr; - expr arg; + expr::ptr arg; - expr_angleclamp180(location const& loc, expr arg); + expr_angleclamp180(location const& loc, expr::ptr arg); + XSK_ARC_AST_MAKE(expr_angleclamp180) }; -struct expr_anglestoforward : public node +struct expr_anglestoforward : public expr { using ptr = std::unique_ptr; - expr arg; + expr::ptr arg; - expr_anglestoforward(const location& loc, expr arg); + expr_anglestoforward(const location& loc, expr::ptr arg); + XSK_ARC_AST_MAKE(expr_anglestoforward) }; -struct expr_anglestoright : public node +struct expr_anglestoright : public expr { using ptr = std::unique_ptr; - expr arg; + expr::ptr arg; - expr_anglestoright(location const& loc, expr arg); + expr_anglestoright(location const& loc, expr::ptr arg); + XSK_ARC_AST_MAKE(expr_anglestoright) }; -struct expr_anglestoup : public node +struct expr_anglestoup : public expr { using ptr = std::unique_ptr; - expr arg; + expr::ptr arg; - expr_anglestoup(location const& loc, expr arg); + expr_anglestoup(location const& loc, expr::ptr arg); + XSK_ARC_AST_MAKE(expr_anglestoup) }; -struct expr_vectorscale : public node +struct expr_vectorscale : public expr { using ptr = std::unique_ptr; - expr arg1; - expr arg2; + expr::ptr arg1; + expr::ptr arg2; - expr_vectorscale(location const& loc, expr arg1, expr arg2); + expr_vectorscale(location const& loc, expr::ptr arg1, expr::ptr arg2); + XSK_ARC_AST_MAKE(expr_vectorscale) }; -struct expr_isdefined : public node +struct expr_isdefined : public expr { using ptr = std::unique_ptr; - expr value; + expr::ptr value; - expr_isdefined(location const& loc, expr value); + expr_isdefined(location const& loc, expr::ptr value); + XSK_ARC_AST_MAKE(expr_isdefined) }; -struct expr_arguments : public node +struct expr_arguments : public expr { using ptr = std::unique_ptr; - std::vector list; + std::vector list; expr_arguments(location const& loc); + XSK_ARC_AST_MAKE(expr_arguments) }; -struct expr_parameters : public node +struct expr_parameters : public expr { using ptr = std::unique_ptr; - std::vector list; + std::vector list; expr_parameters(location const& loc); + XSK_ARC_AST_MAKE(expr_parameters) }; -struct expr_member : public node +struct expr_member : public call { using ptr = std::unique_ptr; - expr obj; + expr::ptr obj; expr_identifier::ptr name; expr_arguments::ptr args; call::mode mode; - expr_member(location const& loc, expr obj, expr_identifier::ptr name, expr_arguments::ptr args, call::mode mode); + expr_member(location const& loc, expr::ptr obj, expr_identifier::ptr name, expr_arguments::ptr args, call::mode mode); + XSK_ARC_AST_MAKE(expr_member) }; -struct expr_pointer : public node +struct expr_pointer : public call { using ptr = std::unique_ptr; - expr func; + expr::ptr func; expr_arguments::ptr args; call::mode mode; - expr_pointer(location const& loc, expr func, expr_arguments::ptr args, call::mode mode); + expr_pointer(location const& loc, expr::ptr func, expr_arguments::ptr args, call::mode mode); + XSK_ARC_AST_MAKE(expr_pointer) }; -struct expr_function : public node +struct expr_function : public call { using ptr = std::unique_ptr; @@ -981,552 +782,364 @@ struct expr_function : public node call::mode mode; expr_function(location const& loc, expr_path::ptr path, expr_identifier::ptr name, expr_arguments::ptr args, call::mode mode); + XSK_ARC_AST_MAKE(expr_function) }; -struct expr_method : public node +struct expr_method : public expr { using ptr = std::unique_ptr; - expr obj; - call value; + expr::ptr obj; + call::ptr value; - expr_method(location const& loc, expr obj, call value); + expr_method(location const& loc, expr::ptr obj, call::ptr value); + XSK_ARC_AST_MAKE(expr_method) }; -struct expr_call : public node +struct expr_call : public expr { using ptr = std::unique_ptr; - call value; + call::ptr value; - expr_call(location const& loc, call value); + expr_call(location const& loc, call::ptr value); + XSK_ARC_AST_MAKE(expr_call) }; -struct expr_new : public node +struct expr_new : public expr { using ptr = std::unique_ptr; expr_identifier::ptr name; expr_new(location const& loc, expr_identifier::ptr name); + XSK_ARC_AST_MAKE(expr_new) }; -struct expr_complement : public node +struct expr_complement : public expr { using ptr = std::unique_ptr; - expr rvalue; + expr::ptr rvalue; - expr_complement(location const& loc, expr rvalue); + expr_complement(location const& loc, expr::ptr rvalue); + XSK_ARC_AST_MAKE(expr_complement) }; -struct expr_negate : public node +struct expr_negate : public expr { using ptr = std::unique_ptr; - expr rvalue; + expr::ptr rvalue; - expr_negate(location const& loc, expr rvalue); + expr_negate(location const& loc, expr::ptr rvalue); + XSK_ARC_AST_MAKE(expr_negate) }; -struct expr_not : public node +struct expr_not : public expr { using ptr = std::unique_ptr; - expr rvalue; + expr::ptr rvalue; - expr_not(location const& loc, expr rvalue); + expr_not(location const& loc, expr::ptr rvalue); + XSK_ARC_AST_MAKE(expr_not) }; -struct expr_binary : public node +struct expr_binary : public expr { using ptr = std::unique_ptr; - expr lvalue; - expr rvalue; + enum class op { seq, sne, eq, ne, le, ge, lt, gt, add, sub, mul, div, mod, shl, shr, bwor, bwand, bwexor, bool_or, bool_and }; - expr_binary(type t, location const& loc, expr lvalue, expr rvalue); + expr::ptr lvalue; + expr::ptr rvalue; + op oper; + + expr_binary(location const& loc, expr::ptr lvalue, expr::ptr rvalue, op oper); + XSK_ARC_AST_MAKE(expr_binary) + auto precedence() -> u8; }; -struct expr_add : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_add(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_sub : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_sub(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_mul : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_mul(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_div : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_div(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_mod : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_mod(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_shift_left : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_shift_left(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_shift_right : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_shift_right(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_bitwise_or : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_bitwise_or(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_bitwise_and : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_bitwise_and(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_bitwise_exor : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_bitwise_exor(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_super_equal : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_super_equal(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_super_not_equal : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_super_not_equal(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_equality : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_equality(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_inequality : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_inequality(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_less_equal : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_less_equal(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_greater_equal : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_greater_equal(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_less : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_less(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_greater : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_greater(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_or : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_or(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_and : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_and(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_ternary : public node +struct expr_ternary : public expr { using ptr = std::unique_ptr; - expr test; - expr true_expr; - expr false_expr; + expr::ptr test; + expr::ptr true_expr; + expr::ptr false_expr; - expr_ternary(location const& loc, expr test, expr true_expr, expr false_expr); + expr_ternary(location const& loc, expr::ptr test, expr::ptr true_expr, expr::ptr false_expr); + XSK_ARC_AST_MAKE(expr_ternary) }; -struct expr_increment : node +struct expr_const : public expr { - using ptr = std::unique_ptr; + using ptr = std::unique_ptr; - expr lvalue; - bool prefix; + expr_identifier::ptr lvalue; + expr::ptr rvalue; - expr_increment(location const& loc, expr lvalue, bool prefix); + expr_const(location const& loc, expr_identifier::ptr lvalue, expr::ptr rvalue); + XSK_ARC_AST_MAKE(expr_const) }; -struct expr_decrement : node -{ - using ptr = std::unique_ptr; - - expr lvalue; - bool prefix; - - expr_decrement(location const& loc, expr lvalue, bool prefix); -}; - -struct expr_assign : public node +struct expr_assign : public expr { using ptr = std::unique_ptr; - expr lvalue; - expr rvalue; + enum class op { eq, add, sub, mul, div, mod, shl, shr, bwor, bwand, bwexor }; - expr_assign(type t, location const& loc, expr lvalue, expr rvalue); + expr::ptr lvalue; + expr::ptr rvalue; + op oper; + + expr_assign(location const& loc, expr::ptr lvalue, expr::ptr rvalue, op oper); + XSK_ARC_AST_MAKE(expr_assign) }; -struct expr_assign_equal : public expr_assign +struct expr_increment : expr { - using ptr = std::unique_ptr; + using ptr = std::unique_ptr; - expr_assign_equal(location const& loc, expr lvalue, expr rvalue); + expr::ptr lvalue; + bool prefix; + + expr_increment(location const& loc, expr::ptr lvalue, bool prefix); + XSK_ARC_AST_MAKE(expr_increment) }; -struct expr_assign_add : public expr_assign +struct expr_decrement : expr { - using ptr = std::unique_ptr; + using ptr = std::unique_ptr; - expr_assign_add(location const& loc, expr lvalue, expr rvalue); + expr::ptr lvalue; + bool prefix; + + expr_decrement(location const& loc, expr::ptr lvalue, bool prefix); + XSK_ARC_AST_MAKE(expr_decrement) }; -struct expr_assign_sub : public expr_assign +struct stmt_empty : public stmt { - using ptr = std::unique_ptr; + using ptr = std::unique_ptr; - expr_assign_sub(location const& loc, expr lvalue, expr rvalue); + stmt_empty(location const& loc); + XSK_ARC_AST_MAKE(stmt_empty) }; -struct expr_assign_mul : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_mul(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_assign_div : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_div(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_assign_mod : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_mod(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_assign_shift_left : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_shift_left(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_assign_shift_right : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_shift_right(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_assign_bitwise_or : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_bitwise_or(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_assign_bitwise_and : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_bitwise_and(location const& loc, expr lvalue, expr rvalue); -}; - -struct expr_assign_bitwise_exor : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_bitwise_exor(location const& loc, expr lvalue, expr rvalue); -}; - -struct stmt_list : public node +struct stmt_list : public stmt { using ptr = std::unique_ptr; - std::vector list; + std::vector list; stmt_list(location const& loc); + XSK_ARC_AST_MAKE(stmt_list) }; -struct stmt_comp : public node +struct stmt_comp : public stmt { using ptr = std::unique_ptr; stmt_list::ptr block; stmt_comp(location const& loc, stmt_list::ptr block); + XSK_ARC_AST_MAKE(stmt_comp) }; -struct stmt_dev : public node +struct stmt_dev : public stmt { using ptr = std::unique_ptr; stmt_list::ptr block; stmt_dev(location const& loc, stmt_list::ptr block); + XSK_ARC_AST_MAKE(stmt_dev) }; -struct stmt_expr : public node +struct stmt_expr : public stmt { using ptr = std::unique_ptr; - expr value; + expr::ptr value; - stmt_expr(location const& loc, expr value); + stmt_expr(location const& loc, expr::ptr value); + XSK_ARC_AST_MAKE(stmt_expr) }; -struct stmt_call : public node -{ - using ptr = std::unique_ptr; - - expr value; - - stmt_call(location const& loc, expr value); -}; - -struct stmt_const : public node -{ - using ptr = std::unique_ptr; - - expr_identifier::ptr lvalue; - expr rvalue; - - stmt_const(location const& loc, expr_identifier::ptr lvalue, expr rvalue); -}; - -struct stmt_assign : public node -{ - using ptr = std::unique_ptr; - - expr value; - - stmt_assign(location const& loc, expr value); -}; - -struct stmt_endon : public node +struct stmt_endon : public stmt { using ptr = std::unique_ptr; - expr obj; - expr event; + expr::ptr obj; + expr::ptr event; - stmt_endon(location const& loc, expr obj, expr event); + stmt_endon(location const& loc, expr::ptr obj, expr::ptr event); + XSK_ARC_AST_MAKE(stmt_endon) }; -struct stmt_notify : public node +struct stmt_notify : public stmt { using ptr = std::unique_ptr; - expr obj; - expr event; + expr::ptr obj; + expr::ptr event; expr_arguments::ptr args; - stmt_notify(location const& loc, expr obj, expr event, expr_arguments::ptr args); + stmt_notify(location const& loc, expr::ptr obj, expr::ptr event, expr_arguments::ptr args); + XSK_ARC_AST_MAKE(stmt_notify) }; -struct stmt_realwait : public node -{ - using ptr = std::unique_ptr; - - expr time; - - stmt_realwait(location const& loc, expr time); -}; - -struct stmt_wait : public node +struct stmt_wait : public stmt { using ptr = std::unique_ptr; - expr time; + expr::ptr time; - stmt_wait(location const& loc, expr time); + stmt_wait(location const& loc, expr::ptr time); + XSK_ARC_AST_MAKE(stmt_wait) }; -struct stmt_waittill : public node +struct stmt_waittill : public stmt { using ptr = std::unique_ptr; - expr obj; - expr event; + expr::ptr obj; + expr::ptr event; expr_arguments::ptr args; - stmt_waittill(location const& loc, expr obj, expr event, expr_arguments::ptr args); + stmt_waittill(location const& loc, expr::ptr obj, expr::ptr event, expr_arguments::ptr args); + XSK_ARC_AST_MAKE(stmt_waittill) }; -struct stmt_waittillmatch : public node +struct stmt_waittillmatch : public stmt { using ptr = std::unique_ptr; - expr obj; - expr event; + expr::ptr obj; + expr::ptr event; expr_arguments::ptr args; - stmt_waittillmatch(location const& loc, expr obj, expr expr, expr_arguments::ptr args); + stmt_waittillmatch(location const& loc, expr::ptr obj, expr::ptr expr, expr_arguments::ptr args); + XSK_ARC_AST_MAKE(stmt_waittillmatch) }; -struct stmt_waittillframeend : public node +struct stmt_waittillframeend : public stmt { using ptr = std::unique_ptr; stmt_waittillframeend(location const& loc); + XSK_ARC_AST_MAKE(stmt_waittillframeend) }; -struct stmt_if : public node +struct stmt_waitrealtime : public stmt +{ + using ptr = std::unique_ptr; + + expr::ptr time; + + stmt_waitrealtime(location const& loc, expr::ptr time); + XSK_ARC_AST_MAKE(stmt_waitrealtime) +}; + +struct stmt_if : public stmt { using ptr = std::unique_ptr; - expr test; - stmt body; + expr::ptr test; + stmt::ptr body; - stmt_if(location const& loc, expr test, stmt body); + stmt_if(location const& loc, expr::ptr test, stmt::ptr body); + XSK_ARC_AST_MAKE(stmt_if) }; -struct stmt_ifelse : public node +struct stmt_ifelse : public stmt { using ptr = std::unique_ptr; - expr test; - stmt stmt_if; - stmt stmt_else; + expr::ptr test; + stmt::ptr stmt_if; + stmt::ptr stmt_else; - stmt_ifelse(location const& loc, expr test, stmt stmt_if, stmt stmt_else); + stmt_ifelse(location const& loc, expr::ptr test, stmt::ptr stmt_if, stmt::ptr stmt_else); + XSK_ARC_AST_MAKE(stmt_ifelse) }; -struct stmt_while : public node +struct stmt_while : public stmt { using ptr = std::unique_ptr; - expr test; - stmt body; + expr::ptr test; + stmt::ptr body; - stmt_while(location const& loc, expr test, stmt body); + stmt_while(location const& loc, expr::ptr test, stmt::ptr body); + XSK_ARC_AST_MAKE(stmt_while) }; -struct stmt_dowhile : public node +struct stmt_dowhile : public stmt { using ptr = std::unique_ptr; - expr test; - stmt body; + expr::ptr test; + stmt::ptr body; - stmt_dowhile(location const& loc, expr test, stmt body); + stmt_dowhile(location const& loc, expr::ptr test, stmt::ptr body); + XSK_ARC_AST_MAKE(stmt_dowhile) }; -struct stmt_for : public node +struct stmt_for : public stmt { using ptr = std::unique_ptr; - stmt init; - expr test; - stmt iter; - stmt body; + stmt::ptr init; + expr::ptr test; + stmt::ptr iter; + stmt::ptr body; - stmt_for(location const& loc, stmt init, expr test, stmt iter, stmt body); + stmt_for(location const& loc, stmt::ptr init, expr::ptr test, stmt::ptr iter, stmt::ptr body); + XSK_ARC_AST_MAKE(stmt_for) }; -struct stmt_foreach : public node +struct stmt_foreach : public stmt { using ptr = std::unique_ptr; - expr container; - expr value; - expr array; - expr key; - stmt body; + expr::ptr container; + expr::ptr value; + expr::ptr array; + expr::ptr key; + stmt::ptr body; bool use_key; - stmt_foreach(location const& loc, expr container, expr value, expr array, expr key, stmt body, bool use_key); + stmt_foreach(location const& loc, expr::ptr container, expr::ptr value, expr::ptr array, expr::ptr key, stmt::ptr body, bool use_key); + XSK_ARC_AST_MAKE(stmt_foreach) }; -struct stmt_switch : public node +struct stmt_switch : public stmt { using ptr = std::unique_ptr; - expr test; + expr::ptr test; stmt_comp::ptr body; - stmt_switch(location const& loc, expr test, stmt_comp::ptr body); + stmt_switch(location const& loc, expr::ptr test, stmt_comp::ptr body); + XSK_ARC_AST_MAKE(stmt_switch) }; -struct stmt_case : public node +struct stmt_case : public stmt { using ptr = std::unique_ptr; - expr value; + expr::ptr value; stmt_list::ptr body; - stmt_case(location const& loc, expr value); - stmt_case(location const& loc, expr value, stmt_list::ptr body); + stmt_case(location const& loc, expr::ptr value); + stmt_case(location const& loc, expr::ptr value, stmt_list::ptr body); + XSK_ARC_AST_MAKE(stmt_case) }; -struct stmt_default : public node +struct stmt_default : public stmt { using ptr = std::unique_ptr; @@ -1534,57 +1147,156 @@ struct stmt_default : public node stmt_default(location const& loc); stmt_default(location const& loc, stmt_list::ptr body); + XSK_ARC_AST_MAKE(stmt_default) }; -struct stmt_break : public node +struct stmt_break : public stmt { using ptr = std::unique_ptr; stmt_break(location const& loc); + XSK_ARC_AST_MAKE(stmt_break) }; -struct stmt_continue : public node +struct stmt_continue : public stmt { using ptr = std::unique_ptr; stmt_continue(location const& loc); + XSK_ARC_AST_MAKE(stmt_continue) }; -struct stmt_return : public node +struct stmt_return : public stmt { using ptr = std::unique_ptr; - expr value; + expr::ptr value; - stmt_return(location const& loc, expr value); + stmt_return(location const& loc, expr::ptr value); + XSK_ARC_AST_MAKE(stmt_return) }; -struct stmt_breakpoint : public node +struct stmt_breakpoint : public stmt { using ptr = std::unique_ptr; stmt_breakpoint(location const& loc); + XSK_ARC_AST_MAKE(stmt_breakpoint) }; -struct stmt_prof_begin : public node +struct stmt_prof_begin : public stmt { using ptr = std::unique_ptr; expr_arguments::ptr args; stmt_prof_begin(location const& loc, expr_arguments::ptr args); + XSK_ARC_AST_MAKE(stmt_prof_begin) }; -struct stmt_prof_end : public node +struct stmt_prof_end : public stmt { using ptr = std::unique_ptr; expr_arguments::ptr args; stmt_prof_end(location const& loc, expr_arguments::ptr args); + XSK_ARC_AST_MAKE(stmt_prof_end) }; -struct decl_function : public node +struct stmt_jmp : public stmt +{ + using ptr = std::unique_ptr; + + std::string value; + + stmt_jmp(location const& loc, std::string const& value); + XSK_ARC_AST_MAKE(stmt_jmp) +}; + +struct stmt_jmp_back : public stmt +{ + using ptr = std::unique_ptr; + + std::string value; + + stmt_jmp_back(location const& loc, std::string const& value); + XSK_ARC_AST_MAKE(stmt_jmp_back) +}; + +struct stmt_jmp_cond : public stmt +{ + using ptr = std::unique_ptr; + + expr::ptr test; + std::string value; + + stmt_jmp_cond(location const& loc, expr::ptr test, std::string const& value); + XSK_ARC_AST_MAKE(stmt_jmp_cond) +}; + +struct stmt_jmp_true : public stmt +{ + using ptr = std::unique_ptr; + + expr::ptr test; + std::string value; + + stmt_jmp_true(location const& loc, expr::ptr test, std::string const& value); + XSK_ARC_AST_MAKE(stmt_jmp_true) +}; + +struct stmt_jmp_false : public stmt +{ + using ptr = std::unique_ptr; + + expr::ptr test; + std::string value; + + stmt_jmp_false(location const& loc, expr::ptr test, std::string const& value); + XSK_ARC_AST_MAKE(stmt_jmp_false) +}; + +struct stmt_jmp_switch : public stmt +{ + using ptr = std::unique_ptr; + + expr::ptr test; + std::string value; + + stmt_jmp_switch(location const& loc, expr::ptr test, std::string const& value); + XSK_ARC_AST_MAKE(stmt_jmp_switch) +}; + +struct stmt_jmp_endswitch : public stmt +{ + using ptr = std::unique_ptr; + + std::vector data; + + stmt_jmp_endswitch(location const& loc, std::vector data); + XSK_ARC_AST_MAKE(stmt_jmp_endswitch) +}; + +struct stmt_jmp_dev : public stmt +{ + using ptr = std::unique_ptr; + + std::string value; + + stmt_jmp_dev(location const& loc, std::string const& value); + XSK_ARC_AST_MAKE(stmt_jmp_dev) +}; + +struct decl_empty : public decl +{ + using ptr = std::unique_ptr; + + decl_empty(location const& loc); + XSK_ARC_AST_MAKE(decl_empty) +}; + +struct decl_function : public decl { using ptr = std::unique_ptr; @@ -1595,39 +1307,44 @@ struct decl_function : public node export_flags flags; decl_function(location const& loc, expr_identifier::ptr space, expr_identifier::ptr name, expr_parameters::ptr params, stmt_comp::ptr body, export_flags flags); + XSK_ARC_AST_MAKE(decl_function) }; -struct decl_usingtree : public node +struct decl_usingtree : public decl { using ptr = std::unique_ptr; expr_string::ptr name; decl_usingtree(location const& loc, expr_string::ptr name); + XSK_ARC_AST_MAKE(decl_usingtree) }; -struct decl_namespace : public node +struct decl_namespace : public decl { using ptr = std::unique_ptr; expr_string::ptr name; decl_namespace(location const& loc, expr_string::ptr name); + XSK_ARC_AST_MAKE(decl_namespace) }; -struct decl_dev_begin : public node +struct decl_dev_begin : public decl { using ptr = std::unique_ptr; decl_dev_begin(location const& loc); + XSK_ARC_AST_MAKE(decl_dev_begin) }; -struct decl_dev_end : public node +struct decl_dev_end : public decl { using ptr = std::unique_ptr; decl_dev_end(location const& loc); + XSK_ARC_AST_MAKE(decl_dev_end) }; struct include : public node @@ -1637,6 +1354,7 @@ struct include : public node expr_path::ptr path; include(location const& loc, expr_path::ptr path); + XSK_ARC_AST_MAKE(include) }; struct program : public node @@ -1644,254 +1362,13 @@ struct program : public node using ptr = std::unique_ptr; std::vector includes; - std::vector declarations; + std::vector declarations; program(); program(location const& loc); + XSK_ARC_AST_MAKE(program) }; -struct asm_loc : public node -{ - using ptr = std::unique_ptr; - - std::string value; - - asm_loc(location const& loc, std::string const& value); -}; - -struct asm_jmp : public node -{ - using ptr = std::unique_ptr; - - std::string value; - - asm_jmp(location const& loc, std::string const& value); -}; - -struct asm_jmp_back : public node -{ - using ptr = std::unique_ptr; - - std::string value; - - asm_jmp_back(location const& loc, std::string const& value); -}; - -struct asm_jmp_cond : public node -{ - using ptr = std::unique_ptr; - - expr test; - std::string value; - - asm_jmp_cond(location const& loc, expr test, std::string const& value); -}; - -struct asm_jmp_true : public node -{ - using ptr = std::unique_ptr; - - expr test; - std::string value; - - asm_jmp_true(location const& loc, expr test, std::string const& value); -}; - -struct asm_jmp_false : public node -{ - using ptr = std::unique_ptr; - - expr test; - std::string value; - - asm_jmp_false(location const& loc, expr test, std::string const& value); -}; - -struct asm_switch : public node -{ - using ptr = std::unique_ptr; - - expr test; - std::string value; - - asm_switch(location const& loc, expr test, std::string const& value); -}; - -struct asm_endswitch : public node -{ - using ptr = std::unique_ptr; - - std::vector data; - - asm_endswitch(location const& loc, std::vector data); -}; - -struct asm_prescriptcall : public node -{ - using ptr = std::unique_ptr; - - asm_prescriptcall(location const& loc); -}; - -struct asm_voidcodepos : public node -{ - using ptr = std::unique_ptr; - - asm_voidcodepos(location const& loc); -}; - -struct asm_dev : public node -{ - using ptr = std::unique_ptr; - - std::string value; - - asm_dev(location const& loc, std::string const& value); -}; - -#define XSK_ARC_MAKE_GENERIC(node_type) \ -template \ -inline auto make_ ## node_type(Args&&... args) -> std::unique_ptr \ -{ \ - return std::unique_ptr(new node_type(std::forward(args)...)); \ -} - -XSK_ARC_MAKE_GENERIC(node) -XSK_ARC_MAKE_GENERIC(expr_true) -XSK_ARC_MAKE_GENERIC(expr_false) -XSK_ARC_MAKE_GENERIC(expr_integer) -XSK_ARC_MAKE_GENERIC(expr_float) -XSK_ARC_MAKE_GENERIC(expr_vector) -XSK_ARC_MAKE_GENERIC(expr_hash) -XSK_ARC_MAKE_GENERIC(expr_string) -XSK_ARC_MAKE_GENERIC(expr_istring) -XSK_ARC_MAKE_GENERIC(expr_path) -XSK_ARC_MAKE_GENERIC(expr_identifier) -XSK_ARC_MAKE_GENERIC(expr_animtree) -XSK_ARC_MAKE_GENERIC(expr_animation) -XSK_ARC_MAKE_GENERIC(expr_classes) -XSK_ARC_MAKE_GENERIC(expr_world) -XSK_ARC_MAKE_GENERIC(expr_level) -XSK_ARC_MAKE_GENERIC(expr_anim) -XSK_ARC_MAKE_GENERIC(expr_self) -XSK_ARC_MAKE_GENERIC(expr_game) -XSK_ARC_MAKE_GENERIC(expr_undefined) -XSK_ARC_MAKE_GENERIC(expr_empty_array) -XSK_ARC_MAKE_GENERIC(expr_paren) -XSK_ARC_MAKE_GENERIC(expr_size) -XSK_ARC_MAKE_GENERIC(expr_field) -XSK_ARC_MAKE_GENERIC(expr_array) -XSK_ARC_MAKE_GENERIC(expr_reference) -XSK_ARC_MAKE_GENERIC(expr_getnextarraykey) -XSK_ARC_MAKE_GENERIC(expr_getfirstarraykey) -XSK_ARC_MAKE_GENERIC(expr_getdvarcoloralpha) -XSK_ARC_MAKE_GENERIC(expr_getdvarcolorblue) -XSK_ARC_MAKE_GENERIC(expr_getdvarcolorgreen) -XSK_ARC_MAKE_GENERIC(expr_getdvarcolorred) -XSK_ARC_MAKE_GENERIC(expr_getdvarvector) -XSK_ARC_MAKE_GENERIC(expr_getdvarfloat) -XSK_ARC_MAKE_GENERIC(expr_getdvarint) -XSK_ARC_MAKE_GENERIC(expr_getdvar) -XSK_ARC_MAKE_GENERIC(expr_gettime) -XSK_ARC_MAKE_GENERIC(expr_abs) -XSK_ARC_MAKE_GENERIC(expr_vectortoangles) -XSK_ARC_MAKE_GENERIC(expr_angleclamp180) -XSK_ARC_MAKE_GENERIC(expr_anglestoforward) -XSK_ARC_MAKE_GENERIC(expr_anglestoright) -XSK_ARC_MAKE_GENERIC(expr_anglestoup) -XSK_ARC_MAKE_GENERIC(expr_vectorscale) -XSK_ARC_MAKE_GENERIC(expr_isdefined) -XSK_ARC_MAKE_GENERIC(expr_arguments) -XSK_ARC_MAKE_GENERIC(expr_parameters) -XSK_ARC_MAKE_GENERIC(expr_member) -XSK_ARC_MAKE_GENERIC(expr_pointer) -XSK_ARC_MAKE_GENERIC(expr_function) -XSK_ARC_MAKE_GENERIC(expr_method) -XSK_ARC_MAKE_GENERIC(expr_call) -XSK_ARC_MAKE_GENERIC(expr_new) -XSK_ARC_MAKE_GENERIC(expr_complement) -XSK_ARC_MAKE_GENERIC(expr_negate) -XSK_ARC_MAKE_GENERIC(expr_not) -XSK_ARC_MAKE_GENERIC(expr_add) -XSK_ARC_MAKE_GENERIC(expr_sub) -XSK_ARC_MAKE_GENERIC(expr_mul) -XSK_ARC_MAKE_GENERIC(expr_div) -XSK_ARC_MAKE_GENERIC(expr_mod) -XSK_ARC_MAKE_GENERIC(expr_shift_left) -XSK_ARC_MAKE_GENERIC(expr_shift_right) -XSK_ARC_MAKE_GENERIC(expr_bitwise_or) -XSK_ARC_MAKE_GENERIC(expr_bitwise_and) -XSK_ARC_MAKE_GENERIC(expr_bitwise_exor) -XSK_ARC_MAKE_GENERIC(expr_super_equal) -XSK_ARC_MAKE_GENERIC(expr_super_not_equal) -XSK_ARC_MAKE_GENERIC(expr_equality) -XSK_ARC_MAKE_GENERIC(expr_inequality) -XSK_ARC_MAKE_GENERIC(expr_less_equal) -XSK_ARC_MAKE_GENERIC(expr_greater_equal) -XSK_ARC_MAKE_GENERIC(expr_less) -XSK_ARC_MAKE_GENERIC(expr_greater) -XSK_ARC_MAKE_GENERIC(expr_or) -XSK_ARC_MAKE_GENERIC(expr_and) -XSK_ARC_MAKE_GENERIC(expr_ternary) -XSK_ARC_MAKE_GENERIC(expr_increment) -XSK_ARC_MAKE_GENERIC(expr_decrement) -XSK_ARC_MAKE_GENERIC(expr_assign_equal) -XSK_ARC_MAKE_GENERIC(expr_assign_add) -XSK_ARC_MAKE_GENERIC(expr_assign_sub) -XSK_ARC_MAKE_GENERIC(expr_assign_mul) -XSK_ARC_MAKE_GENERIC(expr_assign_div) -XSK_ARC_MAKE_GENERIC(expr_assign_mod) -XSK_ARC_MAKE_GENERIC(expr_assign_shift_left) -XSK_ARC_MAKE_GENERIC(expr_assign_shift_right) -XSK_ARC_MAKE_GENERIC(expr_assign_bitwise_or) -XSK_ARC_MAKE_GENERIC(expr_assign_bitwise_and) -XSK_ARC_MAKE_GENERIC(expr_assign_bitwise_exor) -XSK_ARC_MAKE_GENERIC(stmt_list) -XSK_ARC_MAKE_GENERIC(stmt_comp) -XSK_ARC_MAKE_GENERIC(stmt_dev) -XSK_ARC_MAKE_GENERIC(stmt_expr) -XSK_ARC_MAKE_GENERIC(stmt_call) -XSK_ARC_MAKE_GENERIC(stmt_assign) -XSK_ARC_MAKE_GENERIC(stmt_endon) -XSK_ARC_MAKE_GENERIC(stmt_notify) -XSK_ARC_MAKE_GENERIC(stmt_realwait) -XSK_ARC_MAKE_GENERIC(stmt_wait) -XSK_ARC_MAKE_GENERIC(stmt_waittill) -XSK_ARC_MAKE_GENERIC(stmt_waittillmatch) -XSK_ARC_MAKE_GENERIC(stmt_waittillframeend) -XSK_ARC_MAKE_GENERIC(stmt_if) -XSK_ARC_MAKE_GENERIC(stmt_ifelse) -XSK_ARC_MAKE_GENERIC(stmt_while) -XSK_ARC_MAKE_GENERIC(stmt_dowhile) -XSK_ARC_MAKE_GENERIC(stmt_for) -XSK_ARC_MAKE_GENERIC(stmt_foreach) -XSK_ARC_MAKE_GENERIC(stmt_switch) -XSK_ARC_MAKE_GENERIC(stmt_case) -XSK_ARC_MAKE_GENERIC(stmt_default) -XSK_ARC_MAKE_GENERIC(stmt_break) -XSK_ARC_MAKE_GENERIC(stmt_continue) -XSK_ARC_MAKE_GENERIC(stmt_return) -XSK_ARC_MAKE_GENERIC(stmt_breakpoint) -XSK_ARC_MAKE_GENERIC(stmt_prof_begin) -XSK_ARC_MAKE_GENERIC(stmt_prof_end) -XSK_ARC_MAKE_GENERIC(decl_function) -XSK_ARC_MAKE_GENERIC(decl_usingtree) -XSK_ARC_MAKE_GENERIC(decl_dev_begin) -XSK_ARC_MAKE_GENERIC(decl_dev_end) -XSK_ARC_MAKE_GENERIC(include) -XSK_ARC_MAKE_GENERIC(program) -XSK_ARC_MAKE_GENERIC(asm_loc) -XSK_ARC_MAKE_GENERIC(asm_jmp) -XSK_ARC_MAKE_GENERIC(asm_jmp_back) -XSK_ARC_MAKE_GENERIC(asm_jmp_cond) -XSK_ARC_MAKE_GENERIC(asm_jmp_false) -XSK_ARC_MAKE_GENERIC(asm_jmp_true) -XSK_ARC_MAKE_GENERIC(asm_switch) -XSK_ARC_MAKE_GENERIC(asm_endswitch) -XSK_ARC_MAKE_GENERIC(asm_prescriptcall) -XSK_ARC_MAKE_GENERIC(asm_voidcodepos) -XSK_ARC_MAKE_GENERIC(asm_dev) - -#undef XSK_ARC_MAKE_GENERIC +#undef XSK_GSC_AST_MAKE } // namespace xsk::arc diff --git a/include/xsk/arc/common/define.hpp b/include/xsk/arc/common/define.hpp new file mode 100644 index 00000000..dfdd81f7 --- /dev/null +++ b/include/xsk/arc/common/define.hpp @@ -0,0 +1,21 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::arc +{ + +struct define +{ + enum kind : u8 { PLAIN, BUILTIN, OBJECT, FUNCTION }; + + kind type; +// bool vararg; + std::vector args; + std::vector exp; +}; + +} // namespace xsk::arc diff --git a/include/xsk/arc/common/directive.hpp b/include/xsk/arc/common/directive.hpp new file mode 100644 index 00000000..98ba5b34 --- /dev/null +++ b/include/xsk/arc/common/directive.hpp @@ -0,0 +1,19 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::arc +{ + +struct directive +{ + enum kind : u8 { IF, IFDEF, IFNDEF, ELIF, ELIFDEF, ELIFNDEF, ELSE, ENDIF, DEFINE, UNDEF, PRAGMA, WARNING, ERROR, LINE, INCLUDE, INLINE, INSERT, USINGTREE }; + + kind type; + bool skip; +}; + +} // namespace xsk::arc diff --git a/include/xsk/arc/common/lookahead.hpp b/include/xsk/arc/common/lookahead.hpp new file mode 100644 index 00000000..6c23d2e3 --- /dev/null +++ b/include/xsk/arc/common/lookahead.hpp @@ -0,0 +1,23 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::arc +{ + +struct lookahead +{ + char const* buffer_pos; + usize available; + char last_byte; + char curr_byte; + + lookahead(char const* data, usize size); + auto advance() -> void; + auto ended() { return available == 0; }; +}; + +} // namespace xsk::arc diff --git a/include/xsk/arc/common/scope.hpp b/include/xsk/arc/common/scope.hpp new file mode 100644 index 00000000..96efe5bf --- /dev/null +++ b/include/xsk/arc/common/scope.hpp @@ -0,0 +1,33 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::arc +{ + +struct scope +{ + using ptr = std::unique_ptr; + + enum abort_type + { + abort_none = 0, + abort_continue = 1, + abort_break = 2, + abort_return = 3, + }; + + std::string end; + std::string cnt; + std::string brk; + abort_type abort; + bool is_dev; + + scope() : abort(abort_type::abort_none), is_dev(false) {} + scope(std::string const& brk, std::string const& cnt) : cnt{ cnt }, brk{ brk }, abort(abort_type::abort_none), is_dev(false) {} +}; + +} // namespace xsk::arc diff --git a/include/xsk/arc/common/space.hpp b/include/xsk/arc/common/space.hpp new file mode 100644 index 00000000..be6c12ba --- /dev/null +++ b/include/xsk/arc/common/space.hpp @@ -0,0 +1,19 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::arc +{ + +enum class spacing : u8 +{ + none = 0, // no space between tokens + null = 1, // token just after new line + back = 2, // token after space + empty = 4, // token after new line + space +}; + +} // namespace xsk::arc diff --git a/include/xsk/arc/common/token.hpp b/include/xsk/arc/common/token.hpp new file mode 100644 index 00000000..f18ef549 --- /dev/null +++ b/include/xsk/arc/common/token.hpp @@ -0,0 +1,43 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +namespace xsk::arc +{ + +struct token +{ + enum kind : u8 + { + PLUS, MINUS, STAR, DIV, MOD, BITOR, BITAND, BITEXOR, SHL, SHR, + ASSIGN, PLUSEQ, MINUSEQ, STAREQ, DIVEQ, MODEQ, BITOREQ, BITANDEQ, BITEXOREQ, SHLEQ, SHREQ, + INC, DEC, GT, LT, GE, LE, NE, EQ, OR, AND, TILDE, BANG, QMARK, COLON, SHARP, COMMA, DOT, + DOUBLEDOT, ELLIPSIS, SEMICOLON, DOUBLECOLON, LBRACKET, RBRACKET, LBRACE, RBRACE, LPAREN, RPAREN, + + NAME, PATH, STRING, ISTRING, HASHSTR, INT, FLT, + + DEVBEGIN, DEVEND, INLINE, INCLUDE, USINGTREE, ANIMTREE, AUTOEXEC, CODECALL, PRIVATE, + ENDON, NOTIFY, WAIT, WAITTILL, WAITTILLMATCH, WAITTILLFRAMEEND, IF, ELSE, DO, WHILE, + FOR, FOREACH, IN, SWITCH, CASE, DEFAULT, BREAK, CONTINUE, RETURN, PROFBEGIN, PROFEND, + THREAD, TRUE, FALSE, UNDEFINED, SIZE, GAME, SELF, ANIM, LEVEL, + CONST, ISDEFINED, VECTORSCALE, ANGLESTOUP, ANGLESTORIGHT, ANGLESTOFORWARD, ANGLECLAMP180, + VECTORTOANGLES, ABS, GETTIME, GETDVAR, GETDVARINT, GETDVARFLOAT, GETDVARVECTOR, GETDVARCOLORRED, + GETDVARCOLORGREEN, GETDVARCOLORBLUE, GETDVARCOLORALPHA, GETFIRSTARRAYKEY, GETNEXTARRAYKEY, + + HASH, NEWLINE, EOS, DEFINED, MACROBEGIN, MACROEND, MACROARG, MACROVAOPT, MACROVAARGS, STRINGIZE, PASTE + }; + + kind type; + spacing space; + location pos; + std::string data; + + token(kind type, spacing space, location pos) : type{ type }, space{ space }, pos{ pos }, data{} {} + token(kind type, spacing space, location pos, std::string data) : type{ type }, space{ space }, pos{ pos }, data{ std::move(data) } {} + auto to_string() -> std::string; +}; + +} // namespace xsk::arc diff --git a/include/xsk/arc/common/types.hpp b/include/xsk/arc/common/types.hpp index 1414d957..d9a6ccd2 100644 --- a/include/xsk/arc/common/types.hpp +++ b/include/xsk/arc/common/types.hpp @@ -5,12 +5,18 @@ #pragma once -#include "asset.hpp" -#include "assembly.hpp" -#include "buffer.hpp" -#include "location.hpp" -#include "exception.hpp" -#include "ast.hpp" +#include "xsk/arc/common/asset.hpp" +#include "xsk/arc/common/assembly.hpp" +#include "xsk/arc/common/buffer.hpp" +#include "xsk/arc/common/location.hpp" +#include "xsk/arc/common/exception.hpp" +#include "xsk/arc/common/lookahead.hpp" +#include "xsk/arc/common/directive.hpp" +#include "xsk/arc/common/scope.hpp" +#include "xsk/arc/common/space.hpp" +#include "xsk/arc/common/token.hpp" +#include "xsk/arc/common/define.hpp" +#include "xsk/arc/common/ast.hpp" namespace xsk::arc { @@ -37,7 +43,12 @@ enum class system : u8 { pc, ps3, + ps4, + ps5, xb2, + xb3, + xb4, + wiiu, }; enum class engine : u8 @@ -52,8 +63,19 @@ struct props { enum values : u32 { - none = 0 << 0, - version2 = 1 << 0, + none = 0 << 0, + v2 = 1 << 0, + v3 = 1 << 1, + header64 = 1 << 2, + header72 = 1 << 3, + headerxx = 1 << 4, + size64 = 1 << 5, + hashids = 1 << 6, + devstr = 1 << 7, + spaces = 1 << 8, + globals = 1 << 9, + refvarg = 1 << 10, + foreach = 1 << 11, }; props(values value) : value_(value) {} diff --git a/include/xsk/arc/compiler.hpp b/include/xsk/arc/compiler.hpp new file mode 100644 index 00000000..47ad5fd7 --- /dev/null +++ b/include/xsk/arc/compiler.hpp @@ -0,0 +1,153 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "xsk/arc/common/types.hpp" + +namespace xsk::arc +{ + +class compiler +{ + context* ctx_; + assembly::ptr assembly_; + function::ptr function_; + std::vector localfuncs_; + std::vector stackframe_; + std::vector scopes_; + std::unordered_map constants_; + std::string animtree_; + u32 index_; + u32 label_idx_; + bool can_break_; + bool can_continue_; + bool developer_thread_; + +public: + compiler(context* ctx); + auto compile(program const& data) -> assembly::ptr; + auto compile(std::string const& file, std::vector& data) -> assembly::ptr; + +private: + auto emit_program(program const& prog) -> void; + auto emit_include(include const& inc) -> void; + auto emit_decl(decl const& dec) -> void; + auto emit_decl_usingtree(decl_usingtree const& animtree) -> void; + auto emit_decl_function(decl_function const& func) -> void; + auto emit_stmt(stmt const& stm) -> void; + auto emit_stmt_list(stmt_list const& stm) -> void; + auto emit_stmt_comp(stmt_comp const& stm) -> void; + auto emit_stmt_dev(stmt_dev const& stm) -> void; + auto emit_stmt_expr(stmt_expr const& stm) -> void; + auto emit_stmt_endon(stmt_endon const& stm) -> void; + auto emit_stmt_notify(stmt_notify const& stm) -> void; + auto emit_stmt_wait(stmt_wait const& stm) -> void; + auto emit_stmt_waittill(stmt_waittill const& stm) -> void; + auto emit_stmt_waittillmatch(stmt_waittillmatch const& stm) -> void; + auto emit_stmt_waittillframeend(stmt_waittillframeend const& stm) -> void; + auto emit_stmt_if(stmt_if const& stm) -> void; + auto emit_stmt_ifelse(stmt_ifelse const& stm) -> void; + auto emit_stmt_while(stmt_while const& stm) -> void; + auto emit_stmt_dowhile(stmt_dowhile const& stm) -> void; + auto emit_stmt_for(stmt_for const& stm) -> void; + auto emit_stmt_foreach(stmt_foreach const& stm) -> void; + auto emit_stmt_switch(stmt_switch const& stm) -> void; + auto emit_stmt_case(stmt_case const& stm) -> void; + auto emit_stmt_default(stmt_default const& stm) -> void; + auto emit_stmt_break(stmt_break const& stm) -> void; + auto emit_stmt_continue(stmt_continue const& stm) -> void; + auto emit_stmt_return(stmt_return const& stm) -> void; + auto emit_stmt_breakpoint(stmt_breakpoint const& stm) -> void; + auto emit_stmt_prof_begin(stmt_prof_begin const& stm) -> void; + auto emit_stmt_prof_end(stmt_prof_end const& stm) -> void; + auto emit_expr(expr const& exp) -> void; + auto emit_expr_const(expr_const const& exp) -> void; + auto emit_expr_assign(expr_assign const& exp) -> void; + auto emit_expr_clear(expr const& exp) -> void; + auto emit_expr_clear_local(expr_identifier const& exp) -> void; + auto emit_expr_increment(expr_increment const& exp, bool is_stmt) -> void; + auto emit_expr_decrement(expr_decrement const& exp, bool is_stmt) -> void; + auto emit_expr_ternary(expr_ternary const& exp) -> void; + auto emit_expr_binary(expr_binary const& exp) -> void; + auto emit_expr_complement(expr_complement const& exp) -> void; + auto emit_expr_negate(expr_negate const& exp) -> void; + auto emit_expr_not(expr_not const& exp) -> void; + auto emit_expr_call(expr_call const& exp, bool is_stmt) -> void; + auto emit_expr_call_pointer(expr_pointer const& exp, bool is_stmt) -> void; + auto emit_expr_call_function(expr_function const& exp, bool is_stmt) -> void; + auto emit_expr_method(expr_method const& exp, bool is_stmt) -> void; + auto emit_expr_method_pointer(expr_pointer const& exp, expr const& obj, bool is_stmt) -> void; + auto emit_expr_method_function(expr_function const& exp, expr const& obj, bool is_stmt) -> void; + auto emit_expr_parameters(expr_parameters const& exp) -> void; + auto emit_expr_arguments(expr_arguments const& exp) -> void; + auto emit_expr_isdefined(expr_isdefined const& exp) -> void; + auto emit_expr_vectorscale(expr_vectorscale const& exp) -> void; + auto emit_expr_anglestoup(expr_anglestoup const& exp) -> void; + auto emit_expr_anglestoright(expr_anglestoright const& exp) -> void; + auto emit_expr_anglestoforward(expr_anglestoforward const& exp) -> void; + auto emit_expr_angleclamp180(expr_angleclamp180 const& exp) -> void; + auto emit_expr_vectortoangles(expr_vectortoangles const& exp) -> void; + auto emit_expr_abs(expr_abs const& exp) -> void; + auto emit_expr_gettime(expr_gettime const& exp) -> void; + auto emit_expr_getdvar(expr_getdvar const& exp) -> void; + auto emit_expr_getdvarint(expr_getdvarint const& exp) -> void; + auto emit_expr_getdvarfloat(expr_getdvarfloat const& exp) -> void; + auto emit_expr_getdvarvector(expr_getdvarvector const& exp) -> void; + auto emit_expr_getdvarcolorred(expr_getdvarcolorred const& exp) -> void; + auto emit_expr_getdvarcolorgreen(expr_getdvarcolorgreen const& exp) -> void; + auto emit_expr_getdvarcolorblue(expr_getdvarcolorblue const& exp) -> void; + auto emit_expr_getdvarcoloralpha(expr_getdvarcoloralpha const& exp) -> void; + auto emit_expr_getfirstarraykey(expr_getfirstarraykey const& exp) -> void; + auto emit_expr_getnextarraykey(expr_getnextarraykey const& exp) -> void; + auto emit_expr_reference(expr_reference const& exp) -> void; + auto emit_expr_size(expr_size const& exp) -> void; + auto emit_expr_variable_ref(expr const& exp, bool set) -> void; + auto emit_expr_array_ref(expr_array const& exp, bool set) -> void; + auto emit_expr_field_ref(expr_field const& exp, bool set) -> void; + auto emit_expr_local_ref(expr_identifier const& exp, bool set) -> void; + auto emit_expr_variable(expr const& exp) -> void; + auto emit_expr_array(expr_array const& exp) -> void; + auto emit_expr_field(expr_field const& exp) -> void; + auto emit_expr_local(expr_identifier const& exp) -> void; + auto emit_expr_object(expr const& exp) -> void; + auto emit_expr_vector(expr_vector const& exp) -> void; + auto emit_expr_animation(expr_animation const& exp) -> void; + auto emit_expr_animtree(expr_animtree const& exp) -> void; + auto emit_expr_istring(expr_istring const& exp) -> void; + auto emit_expr_string(expr_string const& exp) -> void; + auto emit_expr_hash(expr_hash const& exp) -> void; + auto emit_expr_float(expr_float const& exp) -> void; + auto emit_expr_integer(expr_integer const& exp) -> void; + auto emit_expr_false(expr_false const& exp) -> void; + auto emit_expr_true(expr_true const& exp) -> void; + auto emit_opcode(opcode op) -> void; + auto emit_opcode(opcode op, std::string const& data) -> void; + auto emit_opcode(opcode op, std::vector const& data) -> void; + auto process_function(decl_function const& func) -> void; + auto process_stmt(stmt const& stm) -> void; + auto process_stmt_list(stmt_list const& stm) -> void; + auto process_stmt_comp(stmt_comp const& stm) -> void; + auto process_stmt_dev(stmt_dev const& stm) -> void; + auto process_stmt_expr(stmt_expr const& stm) -> void; + auto process_stmt_waittill(stmt_waittill const& stm) -> void; + auto process_stmt_if(stmt_if const& stm) -> void; + auto process_stmt_ifelse(stmt_ifelse const& stm) -> void; + auto process_stmt_while(stmt_while const& stm) -> void; + auto process_stmt_dowhile(stmt_dowhile const& stm) -> void; + auto process_stmt_for(stmt_for const& stm) -> void; + auto process_stmt_foreach(stmt_foreach const& stm) -> void; + auto process_stmt_switch(stmt_switch const& stm) -> void; + auto process_expr(expr const& exp) -> void; + auto process_expr_parameters(expr_parameters const& exp) -> void; + auto variable_register(expr_identifier const& exp) -> void; + auto variable_access(expr_identifier const& exp) -> u8; + auto is_constant_condition(expr const& exp) -> bool; + auto insert_label(std::string const& label) -> void; + auto insert_label() -> std::string; + auto create_label() -> std::string; +}; + +} // namespace xsk::arc diff --git a/include/xsk/arc/context.hpp b/include/xsk/arc/context.hpp index 04cc36fa..bc20ef73 100644 --- a/include/xsk/arc/context.hpp +++ b/include/xsk/arc/context.hpp @@ -5,10 +5,12 @@ #pragma once -#include "common/types.hpp" -#include "source.hpp" -#include "disassembler.hpp" -#include "decompiler.hpp" +#include "xsk/arc/common/types.hpp" +#include "xsk/arc/source.hpp" +#include "xsk/arc/assembler.hpp" +#include "xsk/arc/disassembler.hpp" +#include "xsk/arc/compiler.hpp" +#include "xsk/arc/decompiler.hpp" namespace xsk::arc { @@ -28,7 +30,9 @@ public: auto instance() const -> instance { return instance_; } auto magic() const -> u64 { return magic_; } auto source() -> source& { return source_; } + auto assembler() -> assembler& { return assembler_; } auto disassembler() -> disassembler& { return disassembler_; } + auto compiler() -> compiler& { return compiler_; } auto decompiler() -> decompiler& { return decompiler_; } auto init(arc::build build, fs_callback callback) -> void; @@ -36,14 +40,14 @@ public: auto engine_name() const -> std::string_view; auto opcode_size(opcode op) const -> u32; - auto opcode_id(opcode op) const -> u8; + auto opcode_id(opcode op) const -> u16; auto opcode_name(opcode op) const -> std::string; auto opcode_enum(std::string const& name) const -> opcode; auto opcode_enum(u16 id) const -> opcode; - auto dvar_id(std::string const& name) const -> u32; - auto dvar_name(u32 id) const -> std::string; auto hash_id(std::string const& name) const -> u32; auto hash_name(u32 id) const -> std::string; + auto make_token(std::string_view str) const -> std::string; + auto load_header(std::string const& name) -> std::tuple; protected: arc::props props_; @@ -54,16 +58,18 @@ protected: arc::instance instance_; u64 magic_; arc::source source_; + arc::assembler assembler_; arc::disassembler disassembler_; + arc::compiler compiler_; arc::decompiler decompiler_; fs_callback fs_callback_; std::unordered_map opcode_map_; std::unordered_map opcode_map_rev_; std::unordered_map code_map_; - std::unordered_map code_map_rev_; - std::unordered_map dvar_map_; + std::unordered_map code_map_rev_; std::unordered_map hash_map_; + std::unordered_map> header_files_; }; } // namespace xsk::arc diff --git a/include/xsk/arc/decompiler.hpp b/include/xsk/arc/decompiler.hpp index 24e09de3..2757d733 100644 --- a/include/xsk/arc/decompiler.hpp +++ b/include/xsk/arc/decompiler.hpp @@ -5,7 +5,7 @@ #pragma once -#include "common/types.hpp" +#include "xsk/arc/common/types.hpp" namespace xsk::arc { @@ -20,6 +20,7 @@ class decompiler std::vector expr_labels_; std::vector tern_labels_; std::vector locals_; + std::vector params_; std::stack stack_; locjmp locs_; bool in_waittill_; @@ -52,7 +53,7 @@ private: auto find_location_reference(stmt_list const& stm, usize begin, usize end, std::string const& loc) -> bool; auto find_location_index(stmt_list const& stm, std::string const& loc) -> usize; auto last_location_index(stmt_list const& stm, usize index) -> bool; - auto lvalues_match(stmt_assign const& stm1, stmt_assign const& stm2) -> bool; + auto lvalues_match(stmt_expr const& stm1, stmt_expr const& stm2) -> bool; auto resolve_label(std::string const& name) -> u32; auto process_function(decl_function& func) -> void; auto process_stmt(stmt& stm) -> void; @@ -60,14 +61,12 @@ private: auto process_stmt_comp(stmt_comp& stm) -> void; auto process_stmt_dev(stmt_dev& stm) -> void; auto process_stmt_expr(stmt_expr& stm) -> void; - auto process_stmt_call(stmt_call& stm) -> void; - auto process_stmt_assign(stmt_assign& stm) -> void; auto process_stmt_endon(stmt_endon& stm) -> void; auto process_stmt_notify(stmt_notify& stm) -> void; - auto process_stmt_realwait(stmt_realwait& stm) -> void; auto process_stmt_wait(stmt_wait& stm) -> void; auto process_stmt_waittill(stmt_waittill& stm) -> void; auto process_stmt_waittillmatch(stmt_waittillmatch& stm) -> void; + auto process_stmt_waitrealtime(stmt_waitrealtime& stm) -> void; auto process_stmt_if(stmt_if& stm) -> void; auto process_stmt_ifelse(stmt_ifelse& stm) -> void; auto process_stmt_while(stmt_while& stm) -> void; @@ -78,14 +77,12 @@ private: auto process_stmt_break(stmt_break& stm) -> void; auto process_stmt_continue(stmt_continue& stm) -> void; auto process_stmt_return(stmt_return& stm) -> void; - auto process_expr(expr& exp) -> void; - auto process_expr_assign(expr_assign::ptr& exp) -> void; + auto process_expr(expr::ptr& exp) -> void; auto process_expr_increment(expr_increment& exp) -> void; auto process_expr_decrement(expr_decrement& exp) -> void; + auto process_expr_assign(expr_assign::ptr& exp) -> void; auto process_expr_ternary(expr_ternary& exp) -> void; auto process_expr_binary(expr_binary& exp) -> void; - auto process_expr_and(expr_and& exp) -> void; - auto process_expr_or(expr_or& exp) -> void; auto process_expr_complement(expr_complement& exp) -> void; auto process_expr_not(expr_not& exp) -> void; auto process_expr_call(expr_call& exp) -> void; @@ -93,8 +90,8 @@ private: auto process_expr_call_member(expr_member& exp) -> void; auto process_expr_call_pointer(expr_pointer& exp) -> void; auto process_expr_call_function(expr_function& exp) -> void; - auto process_expr_method_pointer(expr_pointer& exp, expr& obj) -> void; - auto process_expr_method_function(expr_function& exp, expr& obj) -> void; + auto process_expr_method_pointer(expr_pointer& exp, expr::ptr& obj) -> void; + auto process_expr_method_function(expr_function& exp, expr::ptr& obj) -> void; auto process_expr_parameters(expr_parameters& exp) -> void; auto process_expr_arguments(expr_arguments& exp) -> void; auto process_expr_size(expr_size& exp) -> void; diff --git a/include/xsk/arc/disassembler.hpp b/include/xsk/arc/disassembler.hpp index 78779f79..569e9a11 100644 --- a/include/xsk/arc/disassembler.hpp +++ b/include/xsk/arc/disassembler.hpp @@ -5,8 +5,8 @@ #pragma once -#include "common/types.hpp" #include "xsk/utils/reader.hpp" +#include "xsk/arc/common/types.hpp" namespace xsk::arc { diff --git a/include/xsk/arc/engine/t6.hpp b/include/xsk/arc/engine/t6.hpp index 9f8b88af..c255eb7d 100644 --- a/include/xsk/arc/engine/t6.hpp +++ b/include/xsk/arc/engine/t6.hpp @@ -12,13 +12,6 @@ namespace xsk::arc::t6 { constexpr usize code_count = 125; -constexpr usize dvar_count = 3326; -constexpr u64 header_magic = 0x06000A0D43534780; +constexpr usize hash_count = 3326; -class context : public arc::context -{ -public: - context(); -}; - -} // namespace xsk::gsc::t6 +} // namespace xsk::arc::t6 diff --git a/include/xsk/arc/engine/t6_pc.hpp b/include/xsk/arc/engine/t6_pc.hpp new file mode 100644 index 00000000..20b19302 --- /dev/null +++ b/include/xsk/arc/engine/t6_pc.hpp @@ -0,0 +1,21 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "xsk/arc/engine/t6.hpp" + +namespace xsk::arc::t6::pc +{ + +constexpr u64 header_magic = 0x06000A0D43534780; + +class context : public arc::context +{ +public: + context(); +}; + +} // namespace xsk::arc::t6::pc diff --git a/include/xsk/arc/engine/t6_ps3.hpp b/include/xsk/arc/engine/t6_ps3.hpp new file mode 100644 index 00000000..4db37913 --- /dev/null +++ b/include/xsk/arc/engine/t6_ps3.hpp @@ -0,0 +1,21 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "xsk/arc/engine/t6.hpp" + +namespace xsk::arc::t6::ps3 +{ + +constexpr u64 header_magic = 0x804753430D0A0006; + +class context : public arc::context +{ +public: + context(); +}; + +} // namespace xsk::arc::t6::ps3 diff --git a/include/xsk/arc/engine/t6_wiiu.hpp b/include/xsk/arc/engine/t6_wiiu.hpp new file mode 100644 index 00000000..7b84f4d5 --- /dev/null +++ b/include/xsk/arc/engine/t6_wiiu.hpp @@ -0,0 +1,21 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "xsk/arc/engine/t6.hpp" + +namespace xsk::arc::t6::wiiu +{ + +constexpr u64 header_magic = 0x804753430D0A0006; + +class context : public arc::context +{ +public: + context(); +}; + +} // namespace xsk::arc::t6::wiiu diff --git a/include/xsk/arc/engine/t6_xb2.hpp b/include/xsk/arc/engine/t6_xb2.hpp new file mode 100644 index 00000000..2f90baaf --- /dev/null +++ b/include/xsk/arc/engine/t6_xb2.hpp @@ -0,0 +1,21 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "xsk/arc/engine/t6.hpp" + +namespace xsk::arc::t6::xb2 +{ + +constexpr u64 header_magic = 0x804753430D0A0006; + +class context : public arc::context +{ +public: + context(); +}; + +} // namespace xsk::arc::t6::xb2 diff --git a/include/xsk/arc/engine/t7.hpp b/include/xsk/arc/engine/t7.hpp index fdcb036f..4bfa92d9 100644 --- a/include/xsk/arc/engine/t7.hpp +++ b/include/xsk/arc/engine/t7.hpp @@ -11,9 +11,8 @@ namespace xsk::arc::t7 { -constexpr usize code_count = 8192; -constexpr usize dvar_count = 0; -constexpr usize hash_count = 178717; +constexpr usize code_count = 16384; +constexpr usize hash_count = 178806; constexpr u64 header_magic = 0x1C000A0D43534780; class context : public arc::context diff --git a/include/xsk/arc/engine/t8.hpp b/include/xsk/arc/engine/t8.hpp index 9cc746c9..bca84688 100644 --- a/include/xsk/arc/engine/t8.hpp +++ b/include/xsk/arc/engine/t8.hpp @@ -12,9 +12,8 @@ namespace xsk::arc::t8 { constexpr usize code_count = 0; -constexpr usize dvar_count = 0; constexpr usize hash_count = 0; -constexpr u64 header_magic = 0; +constexpr u64 header_magic = 0x36000A0D43534780; class context : public arc::context { diff --git a/include/xsk/arc/engine/t9.hpp b/include/xsk/arc/engine/t9.hpp index 19225eba..77f53022 100644 --- a/include/xsk/arc/engine/t9.hpp +++ b/include/xsk/arc/engine/t9.hpp @@ -12,9 +12,8 @@ namespace xsk::arc::t9 { constexpr usize code_count = 0; -constexpr usize dvar_count = 0; constexpr usize hash_count = 0; -constexpr u64 header_magic = 0; +constexpr u64 header_magic = 0x38000A0D43534780; class context : public arc::context { diff --git a/include/xsk/arc/lexer.hpp b/include/xsk/arc/lexer.hpp new file mode 100644 index 00000000..45a9a284 --- /dev/null +++ b/include/xsk/arc/lexer.hpp @@ -0,0 +1,33 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "xsk/arc/common/types.hpp" + +namespace xsk::arc +{ + +class lexer +{ + context const* ctx_; + lookahead reader_; + location loc_; + usize buflen_; + spacing spacing_; + bool indev_; + std::array buffer_; + +public: + lexer(context const* ctx, std::string const& name, char const* data, usize size); + auto lex() -> token; + +private: + auto push(char c) -> void; + auto advance() -> void; + auto linewrap() -> void; +}; + +} // namespace xsk::arc diff --git a/include/xsk/t6/parser.hpp b/include/xsk/arc/parser.hpp similarity index 64% rename from include/xsk/t6/parser.hpp rename to include/xsk/arc/parser.hpp index ef2bb21f..16e5ea41 100644 --- a/include/xsk/t6/parser.hpp +++ b/include/xsk/arc/parser.hpp @@ -33,7 +33,7 @@ /** ** \file parser.hpp - ** Define the xsk::arc::t6::parser class. + ** Define the xsk::arc::parser class. */ // C++ LALR(1) parser skeleton written by Akim Demaille. @@ -42,17 +42,17 @@ // especially those whose name start with YY_ or yy_. They are // private implementation details that can be changed or removed. -#ifndef YY_T6_PARSER_HPP_INCLUDED -# define YY_T6_PARSER_HPP_INCLUDED +#ifndef YY_ARC_PARSER_HPP_INCLUDED +# define YY_ARC_PARSER_HPP_INCLUDED // "%code requires" blocks. -#line 28 "parser.ypp" +#line 31 "parser.ypp" #ifdef _MSC_VER #pragma warning(disable:4065) #pragma warning(disable:4127) #endif -#include "t6.hpp" -namespace xsk::arc::t6 { class lexer; } +#include "context.hpp" +namespace xsk::arc { class preprocessor; } #line 58 "parser.hpp" @@ -101,9 +101,9 @@ namespace xsk::arc::t6 { class lexer; } #endif #include -#ifndef T6_ASSERT +#ifndef ARC_ASSERT # include -# define T6_ASSERT assert +# define ARC_ASSERT assert #endif @@ -189,20 +189,20 @@ namespace xsk::arc::t6 { class lexer; } # endif /* Debug traces. */ -#ifndef T6DEBUG +#ifndef ARCDEBUG # if defined YYDEBUG #if YYDEBUG -# define T6DEBUG 1 +# define ARCDEBUG 1 # else -# define T6DEBUG 0 +# define ARCDEBUG 0 # endif # else /* ! defined YYDEBUG */ -# define T6DEBUG 1 +# define ARCDEBUG 1 # endif /* ! defined YYDEBUG */ -#endif /* ! defined T6DEBUG */ +#endif /* ! defined ARCDEBUG */ #line 13 "parser.ypp" -namespace xsk { namespace arc { namespace t6 { +namespace xsk { namespace arc { #line 207 "parser.hpp" @@ -212,11 +212,11 @@ namespace xsk { namespace arc { namespace t6 { class parser { public: -#ifdef T6STYPE +#ifdef ARCSTYPE # ifdef __GNUC__ -# pragma GCC message "bison: do not #define T6STYPE in C++, use %define api.value.type" +# pragma GCC message "bison: do not #define ARCSTYPE in C++, use %define api.value.type" # endif - typedef T6STYPE value_type; + typedef ARCSTYPE value_type; #else /// A buffer to store and retrieve objects. /// @@ -240,7 +240,7 @@ namespace xsk { namespace arc { namespace t6 { value_type (YY_RVREF (T) t) : yytypeid_ (&typeid (T)) { - T6_ASSERT (sizeof (T) <= size); + ARC_ASSERT (sizeof (T) <= size); new (yyas_ ()) T (YY_MOVE (t)); } @@ -254,7 +254,7 @@ namespace xsk { namespace arc { namespace t6 { /// Destruction, allowed only if empty. ~value_type () YY_NOEXCEPT { - T6_ASSERT (!yytypeid_); + ARC_ASSERT (!yytypeid_); } # if 201103L <= YY_CPLUSPLUS @@ -263,8 +263,8 @@ namespace xsk { namespace arc { namespace t6 { T& emplace (U&&... u) { - T6_ASSERT (!yytypeid_); - T6_ASSERT (sizeof (T) <= size); + ARC_ASSERT (!yytypeid_); + ARC_ASSERT (sizeof (T) <= size); yytypeid_ = & typeid (T); return *new (yyas_ ()) T (std::forward (u)...); } @@ -274,8 +274,8 @@ namespace xsk { namespace arc { namespace t6 { T& emplace () { - T6_ASSERT (!yytypeid_); - T6_ASSERT (sizeof (T) <= size); + ARC_ASSERT (!yytypeid_); + ARC_ASSERT (sizeof (T) <= size); yytypeid_ = & typeid (T); return *new (yyas_ ()) T (); } @@ -285,8 +285,8 @@ namespace xsk { namespace arc { namespace t6 { T& emplace (const T& t) { - T6_ASSERT (!yytypeid_); - T6_ASSERT (sizeof (T) <= size); + ARC_ASSERT (!yytypeid_); + ARC_ASSERT (sizeof (T) <= size); yytypeid_ = & typeid (T); return *new (yyas_ ()) T (t); } @@ -315,9 +315,9 @@ namespace xsk { namespace arc { namespace t6 { T& as () YY_NOEXCEPT { - T6_ASSERT (yytypeid_); - T6_ASSERT (*yytypeid_ == typeid (T)); - T6_ASSERT (sizeof (T) <= size); + ARC_ASSERT (yytypeid_); + ARC_ASSERT (*yytypeid_ == typeid (T)); + ARC_ASSERT (sizeof (T) <= size); return *yyas_ (); } @@ -326,9 +326,9 @@ namespace xsk { namespace arc { namespace t6 { const T& as () const YY_NOEXCEPT { - T6_ASSERT (yytypeid_); - T6_ASSERT (*yytypeid_ == typeid (T)); - T6_ASSERT (sizeof (T) <= size); + ARC_ASSERT (yytypeid_); + ARC_ASSERT (*yytypeid_ == typeid (T)); + ARC_ASSERT (sizeof (T) <= size); return *yyas_ (); } @@ -344,8 +344,8 @@ namespace xsk { namespace arc { namespace t6 { void swap (self_type& that) YY_NOEXCEPT { - T6_ASSERT (yytypeid_); - T6_ASSERT (*yytypeid_ == *that.yytypeid_); + ARC_ASSERT (yytypeid_); + ARC_ASSERT (*yytypeid_ == *that.yytypeid_); std::swap (as (), that.as ()); } @@ -424,276 +424,272 @@ namespace xsk { namespace arc { namespace t6 { { // expr_function // expr_pointer - char dummy1[sizeof (ast::call)]; + char dummy1[sizeof (call::ptr)]; // declaration - char dummy2[sizeof (ast::decl)]; + char dummy2[sizeof (decl::ptr)]; - // decl_thread - char dummy3[sizeof (ast::decl_thread::ptr)]; + // decl_function + char dummy3[sizeof (decl_function::ptr)]; // decl_usingtree - char dummy4[sizeof (ast::decl_usingtree::ptr)]; + char dummy4[sizeof (decl_usingtree::ptr)]; // expr // expr_or_empty - // expr_assign // expr_increment // expr_decrement + // expr_assign // expr_ternary // expr_binary // expr_primitive // expr_parameters_default // expr_object - char dummy5[sizeof (ast::expr)]; + char dummy5[sizeof (expr::ptr)]; // expr_abs - char dummy6[sizeof (ast::expr_abs::ptr)]; + char dummy6[sizeof (expr_abs::ptr)]; // expr_angleclamp180 - char dummy7[sizeof (ast::expr_angleclamp180::ptr)]; + char dummy7[sizeof (expr_angleclamp180::ptr)]; // expr_anglestoforward - char dummy8[sizeof (ast::expr_anglestoforward::ptr)]; + char dummy8[sizeof (expr_anglestoforward::ptr)]; // expr_anglestoright - char dummy9[sizeof (ast::expr_anglestoright::ptr)]; + char dummy9[sizeof (expr_anglestoright::ptr)]; // expr_anglestoup - char dummy10[sizeof (ast::expr_anglestoup::ptr)]; + char dummy10[sizeof (expr_anglestoup::ptr)]; // expr_anim - char dummy11[sizeof (ast::expr_anim::ptr)]; + char dummy11[sizeof (expr_anim::ptr)]; // expr_animation - char dummy12[sizeof (ast::expr_animation::ptr)]; + char dummy12[sizeof (expr_animation::ptr)]; // expr_animtree - char dummy13[sizeof (ast::expr_animtree::ptr)]; + char dummy13[sizeof (expr_animtree::ptr)]; // expr_arguments // expr_arguments_no_empty - char dummy14[sizeof (ast::expr_arguments::ptr)]; + char dummy14[sizeof (expr_arguments::ptr)]; // expr_array - char dummy15[sizeof (ast::expr_array::ptr)]; + char dummy15[sizeof (expr_array::ptr)]; // expr_call - char dummy16[sizeof (ast::expr_call::ptr)]; + char dummy16[sizeof (expr_call::ptr)]; // expr_complement - char dummy17[sizeof (ast::expr_complement::ptr)]; + char dummy17[sizeof (expr_complement::ptr)]; // expr_empty_array - char dummy18[sizeof (ast::expr_empty_array::ptr)]; + char dummy18[sizeof (expr_empty_array::ptr)]; // expr_false - char dummy19[sizeof (ast::expr_false::ptr)]; + char dummy19[sizeof (expr_false::ptr)]; // expr_field - char dummy20[sizeof (ast::expr_field::ptr)]; + char dummy20[sizeof (expr_field::ptr)]; // expr_float - char dummy21[sizeof (ast::expr_float::ptr)]; + char dummy21[sizeof (expr_float::ptr)]; // expr_game - char dummy22[sizeof (ast::expr_game::ptr)]; + char dummy22[sizeof (expr_game::ptr)]; // expr_getdvar - char dummy23[sizeof (ast::expr_getdvar::ptr)]; + char dummy23[sizeof (expr_getdvar::ptr)]; // expr_getdvarcoloralpha - char dummy24[sizeof (ast::expr_getdvarcoloralpha::ptr)]; + char dummy24[sizeof (expr_getdvarcoloralpha::ptr)]; // expr_getdvarcolorblue - char dummy25[sizeof (ast::expr_getdvarcolorblue::ptr)]; + char dummy25[sizeof (expr_getdvarcolorblue::ptr)]; // expr_getdvarcolorgreen - char dummy26[sizeof (ast::expr_getdvarcolorgreen::ptr)]; + char dummy26[sizeof (expr_getdvarcolorgreen::ptr)]; // expr_getdvarcolorred - char dummy27[sizeof (ast::expr_getdvarcolorred::ptr)]; + char dummy27[sizeof (expr_getdvarcolorred::ptr)]; // expr_getdvarfloat - char dummy28[sizeof (ast::expr_getdvarfloat::ptr)]; + char dummy28[sizeof (expr_getdvarfloat::ptr)]; // expr_getdvarint - char dummy29[sizeof (ast::expr_getdvarint::ptr)]; + char dummy29[sizeof (expr_getdvarint::ptr)]; // expr_getdvarvector - char dummy30[sizeof (ast::expr_getdvarvector::ptr)]; + char dummy30[sizeof (expr_getdvarvector::ptr)]; // expr_getfirstarraykey - char dummy31[sizeof (ast::expr_getfirstarraykey::ptr)]; + char dummy31[sizeof (expr_getfirstarraykey::ptr)]; // expr_getnextarraykey - char dummy32[sizeof (ast::expr_getnextarraykey::ptr)]; + char dummy32[sizeof (expr_getnextarraykey::ptr)]; // expr_gettime - char dummy33[sizeof (ast::expr_gettime::ptr)]; + char dummy33[sizeof (expr_gettime::ptr)]; // expr_hash - char dummy34[sizeof (ast::expr_hash::ptr)]; + char dummy34[sizeof (expr_hash::ptr)]; // expr_identifier_nosize // expr_identifier - char dummy35[sizeof (ast::expr_identifier::ptr)]; + char dummy35[sizeof (expr_identifier::ptr)]; // expr_integer - char dummy36[sizeof (ast::expr_integer::ptr)]; + char dummy36[sizeof (expr_integer::ptr)]; // expr_isdefined - char dummy37[sizeof (ast::expr_isdefined::ptr)]; + char dummy37[sizeof (expr_isdefined::ptr)]; // expr_istring - char dummy38[sizeof (ast::expr_istring::ptr)]; + char dummy38[sizeof (expr_istring::ptr)]; // expr_level - char dummy39[sizeof (ast::expr_level::ptr)]; + char dummy39[sizeof (expr_level::ptr)]; // expr_method - char dummy40[sizeof (ast::expr_method::ptr)]; + char dummy40[sizeof (expr_method::ptr)]; // expr_negate - char dummy41[sizeof (ast::expr_negate::ptr)]; + char dummy41[sizeof (expr_negate::ptr)]; // expr_not - char dummy42[sizeof (ast::expr_not::ptr)]; + char dummy42[sizeof (expr_not::ptr)]; // expr_parameters - char dummy43[sizeof (ast::expr_parameters::ptr)]; + char dummy43[sizeof (expr_parameters::ptr)]; // expr_paren - char dummy44[sizeof (ast::expr_paren::ptr)]; + char dummy44[sizeof (expr_paren::ptr)]; // expr_path - char dummy45[sizeof (ast::expr_path::ptr)]; + char dummy45[sizeof (expr_path::ptr)]; // expr_reference - char dummy46[sizeof (ast::expr_reference::ptr)]; + char dummy46[sizeof (expr_reference::ptr)]; // expr_self - char dummy47[sizeof (ast::expr_self::ptr)]; + char dummy47[sizeof (expr_self::ptr)]; // expr_size - char dummy48[sizeof (ast::expr_size::ptr)]; + char dummy48[sizeof (expr_size::ptr)]; // expr_string - char dummy49[sizeof (ast::expr_string::ptr)]; + char dummy49[sizeof (expr_string::ptr)]; // expr_true - char dummy50[sizeof (ast::expr_true::ptr)]; + char dummy50[sizeof (expr_true::ptr)]; // expr_undefined - char dummy51[sizeof (ast::expr_undefined::ptr)]; + char dummy51[sizeof (expr_undefined::ptr)]; // expr_vector - char dummy52[sizeof (ast::expr_vector::ptr)]; + char dummy52[sizeof (expr_vector::ptr)]; // expr_vectorscale - char dummy53[sizeof (ast::expr_vectorscale::ptr)]; + char dummy53[sizeof (expr_vectorscale::ptr)]; // expr_vectortoangles - char dummy54[sizeof (ast::expr_vectortoangles::ptr)]; + char dummy54[sizeof (expr_vectortoangles::ptr)]; // include - char dummy55[sizeof (ast::include::ptr)]; + char dummy55[sizeof (include::ptr)]; // program - char dummy56[sizeof (ast::program::ptr)]; - - // stmt - // stmt_or_dev - char dummy57[sizeof (ast::stmt)]; - - // stmt_assign - char dummy58[sizeof (ast::stmt_assign::ptr)]; - - // stmt_break - char dummy59[sizeof (ast::stmt_break::ptr)]; - - // stmt_call - char dummy60[sizeof (ast::stmt_call::ptr)]; - - // stmt_case - char dummy61[sizeof (ast::stmt_case::ptr)]; - - // stmt_const - char dummy62[sizeof (ast::stmt_const::ptr)]; - - // stmt_continue - char dummy63[sizeof (ast::stmt_continue::ptr)]; - - // stmt_default - char dummy64[sizeof (ast::stmt_default::ptr)]; - - // stmt_dev - char dummy65[sizeof (ast::stmt_dev::ptr)]; - - // stmt_dowhile - char dummy66[sizeof (ast::stmt_dowhile::ptr)]; - - // stmt_endon - char dummy67[sizeof (ast::stmt_endon::ptr)]; - - // stmt_expr - char dummy68[sizeof (ast::stmt_expr::ptr)]; - - // stmt_for - char dummy69[sizeof (ast::stmt_for::ptr)]; - - // stmt_foreach - char dummy70[sizeof (ast::stmt_foreach::ptr)]; - - // stmt_if - char dummy71[sizeof (ast::stmt_if::ptr)]; - - // stmt_ifelse - char dummy72[sizeof (ast::stmt_ifelse::ptr)]; - - // stmt_list - // stmt_or_dev_list - // stmt_block - char dummy73[sizeof (ast::stmt_list::ptr)]; - - // stmt_notify - char dummy74[sizeof (ast::stmt_notify::ptr)]; - - // stmt_prof_begin - char dummy75[sizeof (ast::stmt_prof_begin::ptr)]; - - // stmt_prof_end - char dummy76[sizeof (ast::stmt_prof_end::ptr)]; - - // stmt_return - char dummy77[sizeof (ast::stmt_return::ptr)]; - - // stmt_switch - char dummy78[sizeof (ast::stmt_switch::ptr)]; - - // stmt_wait - char dummy79[sizeof (ast::stmt_wait::ptr)]; - - // stmt_waittill - char dummy80[sizeof (ast::stmt_waittill::ptr)]; - - // stmt_waittillframeend - char dummy81[sizeof (ast::stmt_waittillframeend::ptr)]; - - // stmt_waittillmatch - char dummy82[sizeof (ast::stmt_waittillmatch::ptr)]; - - // stmt_while - char dummy83[sizeof (ast::stmt_while::ptr)]; + char dummy56[sizeof (program::ptr)]; // "path" // "identifier" // "string literal" // "localized string" - // "hash" + // "hash string" // "float" // "integer" - char dummy84[sizeof (std::string)]; + char dummy57[sizeof (std::string)]; + + // stmt + // stmt_or_dev + char dummy58[sizeof (stmt::ptr)]; + + // stmt_break + char dummy59[sizeof (stmt_break::ptr)]; + + // stmt_case + char dummy60[sizeof (stmt_case::ptr)]; + + // stmt_comp + char dummy61[sizeof (stmt_comp::ptr)]; + + // stmt_continue + char dummy62[sizeof (stmt_continue::ptr)]; + + // stmt_default + char dummy63[sizeof (stmt_default::ptr)]; + + // stmt_dev + char dummy64[sizeof (stmt_dev::ptr)]; + + // stmt_dowhile + char dummy65[sizeof (stmt_dowhile::ptr)]; + + // stmt_endon + char dummy66[sizeof (stmt_endon::ptr)]; + + // stmt_expr + // stmt_call + // stmt_const + // stmt_assign + char dummy67[sizeof (stmt_expr::ptr)]; + + // stmt_for + char dummy68[sizeof (stmt_for::ptr)]; + + // stmt_foreach + char dummy69[sizeof (stmt_foreach::ptr)]; + + // stmt_if + char dummy70[sizeof (stmt_if::ptr)]; + + // stmt_ifelse + char dummy71[sizeof (stmt_ifelse::ptr)]; + + // stmt_list + // stmt_or_dev_list + char dummy72[sizeof (stmt_list::ptr)]; + + // stmt_notify + char dummy73[sizeof (stmt_notify::ptr)]; + + // stmt_prof_begin + char dummy74[sizeof (stmt_prof_begin::ptr)]; + + // stmt_prof_end + char dummy75[sizeof (stmt_prof_end::ptr)]; + + // stmt_return + char dummy76[sizeof (stmt_return::ptr)]; + + // stmt_switch + char dummy77[sizeof (stmt_switch::ptr)]; + + // stmt_wait + char dummy78[sizeof (stmt_wait::ptr)]; + + // stmt_waittill + char dummy79[sizeof (stmt_waittill::ptr)]; + + // stmt_waittillframeend + char dummy80[sizeof (stmt_waittillframeend::ptr)]; + + // stmt_waittillmatch + char dummy81[sizeof (stmt_waittillmatch::ptr)]; + + // stmt_while + char dummy82[sizeof (stmt_while::ptr)]; }; /// The size of the largest semantic type. @@ -742,138 +738,133 @@ namespace xsk { namespace arc { namespace t6 { { enum token_kind_type { - T6EMPTY = -2, - T6EOF = 0, // "end of file" - T6error = 1, // error - T6UNDEF = 2, // "invalid token" - SH_DEFINE = 3, // "#define" - SH_UNDEF = 4, // "#undef" - SH_IFDEF = 5, // "#ifdef" - SH_IFNDEF = 6, // "#ifndef" - SH_IF = 7, // "#if" - SH_ELIF = 8, // "#elif" - SH_ELSE = 9, // "#else" - SH_ENDIF = 10, // "#endif" - DEVBEGIN = 11, // "/#" - DEVEND = 12, // "#/" - INLINE = 13, // "#inline" - INCLUDE = 14, // "#include" - USINGTREE = 15, // "#using_animtree" - ANIMTREE = 16, // "#animtree" - AUTOEXEC = 17, // "autoexec" - CODECALL = 18, // "codecall" - PRIVATE = 19, // "private" - ENDON = 20, // "endon" - NOTIFY = 21, // "notify" - WAIT = 22, // "wait" - WAITTILL = 23, // "waittill" - WAITTILLMATCH = 24, // "waittillmatch" - WAITTILLFRAMEEND = 25, // "waittillframeend" - IF = 26, // "if" - ELSE = 27, // "else" - DO = 28, // "do" - WHILE = 29, // "while" - FOR = 30, // "for" - FOREACH = 31, // "foreach" - IN = 32, // "in" - SWITCH = 33, // "switch" - CASE = 34, // "case" - DEFAULT = 35, // "default" - BREAK = 36, // "break" - CONTINUE = 37, // "continue" - RETURN = 38, // "return" - PROFBEGIN = 39, // "prof_begin" - PROFEND = 40, // "prof_end" - THREAD = 41, // "thread" - TRUE = 42, // "true" - FALSE = 43, // "false" - UNDEFINED = 44, // "undefined" - SIZE = 45, // "size" - GAME = 46, // "game" - SELF = 47, // "self" - ANIM = 48, // "anim" - LEVEL = 49, // "level" - CONST = 50, // "const" - GETNEXTARRAYKEY = 51, // "getnextarraykey" - GETFIRSTARRAYKEY = 52, // "getfirstarraykey" - GETDVARCOLORALPHA = 53, // "getdvarcoloralpha" - GETDVARCOLORBLUE = 54, // "getdvarcolorblue" - GETDVARCOLORGREEN = 55, // "getdvarcolorgreen" - GETDVARCOLORRED = 56, // "getdvarcolorred" - GETDVARVECTOR = 57, // "getdvarvector" - GETDVARFLOAT = 58, // "getdvarfloat" - GETDVARINT = 59, // "getdvarint" - GETDVAR = 60, // "getdvar" - GETTIME = 61, // "gettime" - ABS = 62, // "abs" - VECTORTOANGLES = 63, // "vectortoangles" - ANGLECLAMP180 = 64, // "angleclamp180" - ANGLESTOFORWARD = 65, // "anglestoforward" - ANGLESTORIGHT = 66, // "anglestoright" - ANGLESTOUP = 67, // "anglestoup" - VECTORSCALE = 68, // "vectorscale" - ISDEFINED = 69, // "isdefined" - LPAREN = 70, // "(" - RPAREN = 71, // ")" - LBRACE = 72, // "{" - RBRACE = 73, // "}" - LBRACKET = 74, // "[" - RBRACKET = 75, // "]" - COMMA = 76, // "," - DOT = 77, // "." - DOUBLECOLON = 78, // "::" - COLON = 79, // ":" - SEMICOLON = 80, // ";" - QMARK = 81, // "?" - INCREMENT = 82, // "++" - DECREMENT = 83, // "--" - LSHIFT = 84, // "<<" - RSHIFT = 85, // ">>" - OR = 86, // "||" - AND = 87, // "&&" - EQUALITY = 88, // "==" - INEQUALITY = 89, // "!=" - LESS_EQUAL = 90, // "<=" - GREATER_EQUAL = 91, // ">=" - LESS = 92, // "<" - GREATER = 93, // ">" - NOT = 94, // "!" - COMPLEMENT = 95, // "~" - ASSIGN = 96, // "=" - ASSIGN_ADD = 97, // "+=" - ASSIGN_SUB = 98, // "-=" - ASSIGN_MUL = 99, // "*=" - ASSIGN_DIV = 100, // "/=" - ASSIGN_MOD = 101, // "%=" - ASSIGN_BW_OR = 102, // "|=" - ASSIGN_BW_AND = 103, // "&=" - ASSIGN_BW_EXOR = 104, // "^=" - ASSIGN_RSHIFT = 105, // ">>=" - ASSIGN_LSHIFT = 106, // "<<=" - BITWISE_OR = 107, // "|" - BITWISE_AND = 108, // "&" - BITWISE_EXOR = 109, // "^" - ADD = 110, // "+" - SUB = 111, // "-" - MUL = 112, // "*" - DIV = 113, // "/" - MOD = 114, // "%" - PATH = 115, // "path" - IDENTIFIER = 116, // "identifier" - STRING = 117, // "string literal" - ISTRING = 118, // "localized string" - HASH = 119, // "hash" - FLOAT = 120, // "float" - INTEGER = 121, // "integer" - SIZEOF = 122, // SIZEOF - THEN = 123, // THEN - TERN = 124, // TERN - NEG = 125, // NEG - ANIMREF = 126, // ANIMREF - PREINC = 127, // PREINC - PREDEC = 128, // PREDEC - POSTINC = 129, // POSTINC - POSTDEC = 130 // POSTDEC + ARCEMPTY = -2, + ARCEOF = 0, // "end of file" + ARCerror = 1, // error + ARCUNDEF = 2, // "invalid token" + HASH = 3, // "#" + DEVBEGIN = 4, // "/#" + DEVEND = 5, // "#/" + INLINE = 6, // "#inline" + INCLUDE = 7, // "#include" + USINGTREE = 8, // "#using_animtree" + ANIMTREE = 9, // "#animtree" + AUTOEXEC = 10, // "autoexec" + CODECALL = 11, // "codecall" + PRIVATE = 12, // "private" + ENDON = 13, // "endon" + NOTIFY = 14, // "notify" + WAIT = 15, // "wait" + WAITTILL = 16, // "waittill" + WAITTILLMATCH = 17, // "waittillmatch" + WAITTILLFRAMEEND = 18, // "waittillframeend" + IF = 19, // "if" + ELSE = 20, // "else" + DO = 21, // "do" + WHILE = 22, // "while" + FOR = 23, // "for" + FOREACH = 24, // "foreach" + IN = 25, // "in" + SWITCH = 26, // "switch" + CASE = 27, // "case" + DEFAULT = 28, // "default" + BREAK = 29, // "break" + CONTINUE = 30, // "continue" + RETURN = 31, // "return" + PROFBEGIN = 32, // "prof_begin" + PROFEND = 33, // "prof_end" + THREAD = 34, // "thread" + TRUE = 35, // "true" + FALSE = 36, // "false" + UNDEFINED = 37, // "undefined" + SIZE = 38, // "size" + GAME = 39, // "game" + SELF = 40, // "self" + ANIM = 41, // "anim" + LEVEL = 42, // "level" + CONST = 43, // "const" + GETNEXTARRAYKEY = 44, // "getnextarraykey" + GETFIRSTARRAYKEY = 45, // "getfirstarraykey" + GETDVARCOLORALPHA = 46, // "getdvarcoloralpha" + GETDVARCOLORBLUE = 47, // "getdvarcolorblue" + GETDVARCOLORGREEN = 48, // "getdvarcolorgreen" + GETDVARCOLORRED = 49, // "getdvarcolorred" + GETDVARVECTOR = 50, // "getdvarvector" + GETDVARFLOAT = 51, // "getdvarfloat" + GETDVARINT = 52, // "getdvarint" + GETDVAR = 53, // "getdvar" + GETTIME = 54, // "gettime" + ABS = 55, // "abs" + VECTORTOANGLES = 56, // "vectortoangles" + ANGLECLAMP180 = 57, // "angleclamp180" + ANGLESTOFORWARD = 58, // "anglestoforward" + ANGLESTORIGHT = 59, // "anglestoright" + ANGLESTOUP = 60, // "anglestoup" + VECTORSCALE = 61, // "vectorscale" + ISDEFINED = 62, // "isdefined" + LPAREN = 63, // "(" + RPAREN = 64, // ")" + LBRACE = 65, // "{" + RBRACE = 66, // "}" + LBRACKET = 67, // "[" + RBRACKET = 68, // "]" + COMMA = 69, // "," + DOT = 70, // "." + DOUBLEDOT = 71, // ".." + ELLIPSIS = 72, // "..." + DOUBLECOLON = 73, // "::" + COLON = 74, // ":" + SEMICOLON = 75, // ";" + QMARK = 76, // "?" + INCREMENT = 77, // "++" + DECREMENT = 78, // "--" + LSHIFT = 79, // "<<" + RSHIFT = 80, // ">>" + OR = 81, // "||" + AND = 82, // "&&" + EQUALITY = 83, // "==" + INEQUALITY = 84, // "!=" + LESS_EQUAL = 85, // "<=" + GREATER_EQUAL = 86, // ">=" + LESS = 87, // "<" + GREATER = 88, // ">" + NOT = 89, // "!" + COMPLEMENT = 90, // "~" + ASSIGN = 91, // "=" + ASSIGN_ADD = 92, // "+=" + ASSIGN_SUB = 93, // "-=" + ASSIGN_MUL = 94, // "*=" + ASSIGN_DIV = 95, // "/=" + ASSIGN_MOD = 96, // "%=" + ASSIGN_BW_OR = 97, // "|=" + ASSIGN_BW_AND = 98, // "&=" + ASSIGN_BW_EXOR = 99, // "^=" + ASSIGN_RSHIFT = 100, // ">>=" + ASSIGN_LSHIFT = 101, // "<<=" + BITWISE_OR = 102, // "|" + BITWISE_AND = 103, // "&" + BITWISE_EXOR = 104, // "^" + ADD = 105, // "+" + SUB = 106, // "-" + MUL = 107, // "*" + DIV = 108, // "/" + MOD = 109, // "%" + PATH = 110, // "path" + IDENTIFIER = 111, // "identifier" + STRING = 112, // "string literal" + ISTRING = 113, // "localized string" + HASHSTR = 114, // "hash string" + FLOAT = 115, // "float" + INTEGER = 116, // "integer" + SIZEOF = 117, // SIZEOF + THEN = 118, // THEN + TERN = 119, // TERN + NEG = 120, // NEG + ANIMREF = 121, // ANIMREF + PREINC = 122, // PREINC + PREDEC = 123, // PREDEC + POSTINC = 124, // POSTINC + POSTDEC = 125 // POSTDEC }; /// Backward compatibility alias (Bison 3.6). typedef token_kind_type yytokentype; @@ -890,240 +881,235 @@ namespace xsk { namespace arc { namespace t6 { { enum symbol_kind_type { - YYNTOKENS = 131, ///< Number of tokens. + YYNTOKENS = 126, ///< Number of tokens. S_YYEMPTY = -2, S_YYEOF = 0, // "end of file" S_YYerror = 1, // error S_YYUNDEF = 2, // "invalid token" - S_SH_DEFINE = 3, // "#define" - S_SH_UNDEF = 4, // "#undef" - S_SH_IFDEF = 5, // "#ifdef" - S_SH_IFNDEF = 6, // "#ifndef" - S_SH_IF = 7, // "#if" - S_SH_ELIF = 8, // "#elif" - S_SH_ELSE = 9, // "#else" - S_SH_ENDIF = 10, // "#endif" - S_DEVBEGIN = 11, // "/#" - S_DEVEND = 12, // "#/" - S_INLINE = 13, // "#inline" - S_INCLUDE = 14, // "#include" - S_USINGTREE = 15, // "#using_animtree" - S_ANIMTREE = 16, // "#animtree" - S_AUTOEXEC = 17, // "autoexec" - S_CODECALL = 18, // "codecall" - S_PRIVATE = 19, // "private" - S_ENDON = 20, // "endon" - S_NOTIFY = 21, // "notify" - S_WAIT = 22, // "wait" - S_WAITTILL = 23, // "waittill" - S_WAITTILLMATCH = 24, // "waittillmatch" - S_WAITTILLFRAMEEND = 25, // "waittillframeend" - S_IF = 26, // "if" - S_ELSE = 27, // "else" - S_DO = 28, // "do" - S_WHILE = 29, // "while" - S_FOR = 30, // "for" - S_FOREACH = 31, // "foreach" - S_IN = 32, // "in" - S_SWITCH = 33, // "switch" - S_CASE = 34, // "case" - S_DEFAULT = 35, // "default" - S_BREAK = 36, // "break" - S_CONTINUE = 37, // "continue" - S_RETURN = 38, // "return" - S_PROFBEGIN = 39, // "prof_begin" - S_PROFEND = 40, // "prof_end" - S_THREAD = 41, // "thread" - S_TRUE = 42, // "true" - S_FALSE = 43, // "false" - S_UNDEFINED = 44, // "undefined" - S_SIZE = 45, // "size" - S_GAME = 46, // "game" - S_SELF = 47, // "self" - S_ANIM = 48, // "anim" - S_LEVEL = 49, // "level" - S_CONST = 50, // "const" - S_GETNEXTARRAYKEY = 51, // "getnextarraykey" - S_GETFIRSTARRAYKEY = 52, // "getfirstarraykey" - S_GETDVARCOLORALPHA = 53, // "getdvarcoloralpha" - S_GETDVARCOLORBLUE = 54, // "getdvarcolorblue" - S_GETDVARCOLORGREEN = 55, // "getdvarcolorgreen" - S_GETDVARCOLORRED = 56, // "getdvarcolorred" - S_GETDVARVECTOR = 57, // "getdvarvector" - S_GETDVARFLOAT = 58, // "getdvarfloat" - S_GETDVARINT = 59, // "getdvarint" - S_GETDVAR = 60, // "getdvar" - S_GETTIME = 61, // "gettime" - S_ABS = 62, // "abs" - S_VECTORTOANGLES = 63, // "vectortoangles" - S_ANGLECLAMP180 = 64, // "angleclamp180" - S_ANGLESTOFORWARD = 65, // "anglestoforward" - S_ANGLESTORIGHT = 66, // "anglestoright" - S_ANGLESTOUP = 67, // "anglestoup" - S_VECTORSCALE = 68, // "vectorscale" - S_ISDEFINED = 69, // "isdefined" - S_LPAREN = 70, // "(" - S_RPAREN = 71, // ")" - S_LBRACE = 72, // "{" - S_RBRACE = 73, // "}" - S_LBRACKET = 74, // "[" - S_RBRACKET = 75, // "]" - S_COMMA = 76, // "," - S_DOT = 77, // "." - S_DOUBLECOLON = 78, // "::" - S_COLON = 79, // ":" - S_SEMICOLON = 80, // ";" - S_QMARK = 81, // "?" - S_INCREMENT = 82, // "++" - S_DECREMENT = 83, // "--" - S_LSHIFT = 84, // "<<" - S_RSHIFT = 85, // ">>" - S_OR = 86, // "||" - S_AND = 87, // "&&" - S_EQUALITY = 88, // "==" - S_INEQUALITY = 89, // "!=" - S_LESS_EQUAL = 90, // "<=" - S_GREATER_EQUAL = 91, // ">=" - S_LESS = 92, // "<" - S_GREATER = 93, // ">" - S_NOT = 94, // "!" - S_COMPLEMENT = 95, // "~" - S_ASSIGN = 96, // "=" - S_ASSIGN_ADD = 97, // "+=" - S_ASSIGN_SUB = 98, // "-=" - S_ASSIGN_MUL = 99, // "*=" - S_ASSIGN_DIV = 100, // "/=" - S_ASSIGN_MOD = 101, // "%=" - S_ASSIGN_BW_OR = 102, // "|=" - S_ASSIGN_BW_AND = 103, // "&=" - S_ASSIGN_BW_EXOR = 104, // "^=" - S_ASSIGN_RSHIFT = 105, // ">>=" - S_ASSIGN_LSHIFT = 106, // "<<=" - S_BITWISE_OR = 107, // "|" - S_BITWISE_AND = 108, // "&" - S_BITWISE_EXOR = 109, // "^" - S_ADD = 110, // "+" - S_SUB = 111, // "-" - S_MUL = 112, // "*" - S_DIV = 113, // "/" - S_MOD = 114, // "%" - S_PATH = 115, // "path" - S_IDENTIFIER = 116, // "identifier" - S_STRING = 117, // "string literal" - S_ISTRING = 118, // "localized string" - S_HASH = 119, // "hash" - S_FLOAT = 120, // "float" - S_INTEGER = 121, // "integer" - S_SIZEOF = 122, // SIZEOF - S_THEN = 123, // THEN - S_TERN = 124, // TERN - S_NEG = 125, // NEG - S_ANIMREF = 126, // ANIMREF - S_PREINC = 127, // PREINC - S_PREDEC = 128, // PREDEC - S_POSTINC = 129, // POSTINC - S_POSTDEC = 130, // POSTDEC - S_YYACCEPT = 131, // $accept - S_root = 132, // root - S_program = 133, // program - S_inline = 134, // inline - S_include = 135, // include - S_declaration = 136, // declaration - S_decl_usingtree = 137, // decl_usingtree - S_decl_thread = 138, // decl_thread - S_stmt = 139, // stmt - S_stmt_or_dev = 140, // stmt_or_dev - S_stmt_list = 141, // stmt_list - S_stmt_or_dev_list = 142, // stmt_or_dev_list - S_stmt_dev = 143, // stmt_dev - S_stmt_block = 144, // stmt_block - S_stmt_expr = 145, // stmt_expr - S_stmt_call = 146, // stmt_call - S_stmt_const = 147, // stmt_const - S_stmt_assign = 148, // stmt_assign - S_stmt_endon = 149, // stmt_endon - S_stmt_notify = 150, // stmt_notify - S_stmt_wait = 151, // stmt_wait - S_stmt_waittill = 152, // stmt_waittill - S_stmt_waittillmatch = 153, // stmt_waittillmatch - S_stmt_waittillframeend = 154, // stmt_waittillframeend - S_stmt_if = 155, // stmt_if - S_stmt_ifelse = 156, // stmt_ifelse - S_stmt_while = 157, // stmt_while - S_stmt_dowhile = 158, // stmt_dowhile - S_stmt_for = 159, // stmt_for - S_stmt_foreach = 160, // stmt_foreach - S_stmt_switch = 161, // stmt_switch - S_stmt_case = 162, // stmt_case - S_stmt_default = 163, // stmt_default - S_stmt_break = 164, // stmt_break - S_stmt_continue = 165, // stmt_continue - S_stmt_return = 166, // stmt_return - S_stmt_prof_begin = 167, // stmt_prof_begin - S_stmt_prof_end = 168, // stmt_prof_end - S_expr = 169, // expr - S_expr_or_empty = 170, // expr_or_empty - S_expr_assign = 171, // expr_assign - S_expr_increment = 172, // expr_increment - S_expr_decrement = 173, // expr_decrement - S_expr_ternary = 174, // expr_ternary - S_expr_binary = 175, // expr_binary - S_expr_primitive = 176, // expr_primitive - S_expr_complement = 177, // expr_complement - S_expr_negate = 178, // expr_negate - S_expr_not = 179, // expr_not - S_expr_call = 180, // expr_call - S_expr_method = 181, // expr_method - S_expr_function = 182, // expr_function - S_expr_pointer = 183, // expr_pointer - S_expr_parameters = 184, // expr_parameters - S_expr_parameters_default = 185, // expr_parameters_default - S_expr_arguments = 186, // expr_arguments - S_expr_arguments_no_empty = 187, // expr_arguments_no_empty - S_expr_getnextarraykey = 188, // expr_getnextarraykey - S_expr_getfirstarraykey = 189, // expr_getfirstarraykey - S_expr_getdvarcoloralpha = 190, // expr_getdvarcoloralpha - S_expr_getdvarcolorblue = 191, // expr_getdvarcolorblue - S_expr_getdvarcolorgreen = 192, // expr_getdvarcolorgreen - S_expr_getdvarcolorred = 193, // expr_getdvarcolorred - S_expr_getdvarvector = 194, // expr_getdvarvector - S_expr_getdvarfloat = 195, // expr_getdvarfloat - S_expr_getdvarint = 196, // expr_getdvarint - S_expr_getdvar = 197, // expr_getdvar - S_expr_gettime = 198, // expr_gettime - S_expr_abs = 199, // expr_abs - S_expr_vectortoangles = 200, // expr_vectortoangles - S_expr_angleclamp180 = 201, // expr_angleclamp180 - S_expr_anglestoforward = 202, // expr_anglestoforward - S_expr_anglestoright = 203, // expr_anglestoright - S_expr_anglestoup = 204, // expr_anglestoup - S_expr_vectorscale = 205, // expr_vectorscale - S_expr_isdefined = 206, // expr_isdefined - S_expr_reference = 207, // expr_reference - S_expr_array = 208, // expr_array - S_expr_field = 209, // expr_field - S_expr_size = 210, // expr_size - S_expr_paren = 211, // expr_paren - S_expr_object = 212, // expr_object - S_expr_empty_array = 213, // expr_empty_array - S_expr_undefined = 214, // expr_undefined - S_expr_game = 215, // expr_game - S_expr_self = 216, // expr_self - S_expr_anim = 217, // expr_anim - S_expr_level = 218, // expr_level - S_expr_animation = 219, // expr_animation - S_expr_animtree = 220, // expr_animtree - S_expr_identifier_nosize = 221, // expr_identifier_nosize - S_expr_identifier = 222, // expr_identifier - S_expr_path = 223, // expr_path - S_expr_istring = 224, // expr_istring - S_expr_string = 225, // expr_string - S_expr_vector = 226, // expr_vector - S_expr_hash = 227, // expr_hash - S_expr_float = 228, // expr_float - S_expr_integer = 229, // expr_integer - S_expr_false = 230, // expr_false - S_expr_true = 231 // expr_true + S_HASH = 3, // "#" + S_DEVBEGIN = 4, // "/#" + S_DEVEND = 5, // "#/" + S_INLINE = 6, // "#inline" + S_INCLUDE = 7, // "#include" + S_USINGTREE = 8, // "#using_animtree" + S_ANIMTREE = 9, // "#animtree" + S_AUTOEXEC = 10, // "autoexec" + S_CODECALL = 11, // "codecall" + S_PRIVATE = 12, // "private" + S_ENDON = 13, // "endon" + S_NOTIFY = 14, // "notify" + S_WAIT = 15, // "wait" + S_WAITTILL = 16, // "waittill" + S_WAITTILLMATCH = 17, // "waittillmatch" + S_WAITTILLFRAMEEND = 18, // "waittillframeend" + S_IF = 19, // "if" + S_ELSE = 20, // "else" + S_DO = 21, // "do" + S_WHILE = 22, // "while" + S_FOR = 23, // "for" + S_FOREACH = 24, // "foreach" + S_IN = 25, // "in" + S_SWITCH = 26, // "switch" + S_CASE = 27, // "case" + S_DEFAULT = 28, // "default" + S_BREAK = 29, // "break" + S_CONTINUE = 30, // "continue" + S_RETURN = 31, // "return" + S_PROFBEGIN = 32, // "prof_begin" + S_PROFEND = 33, // "prof_end" + S_THREAD = 34, // "thread" + S_TRUE = 35, // "true" + S_FALSE = 36, // "false" + S_UNDEFINED = 37, // "undefined" + S_SIZE = 38, // "size" + S_GAME = 39, // "game" + S_SELF = 40, // "self" + S_ANIM = 41, // "anim" + S_LEVEL = 42, // "level" + S_CONST = 43, // "const" + S_GETNEXTARRAYKEY = 44, // "getnextarraykey" + S_GETFIRSTARRAYKEY = 45, // "getfirstarraykey" + S_GETDVARCOLORALPHA = 46, // "getdvarcoloralpha" + S_GETDVARCOLORBLUE = 47, // "getdvarcolorblue" + S_GETDVARCOLORGREEN = 48, // "getdvarcolorgreen" + S_GETDVARCOLORRED = 49, // "getdvarcolorred" + S_GETDVARVECTOR = 50, // "getdvarvector" + S_GETDVARFLOAT = 51, // "getdvarfloat" + S_GETDVARINT = 52, // "getdvarint" + S_GETDVAR = 53, // "getdvar" + S_GETTIME = 54, // "gettime" + S_ABS = 55, // "abs" + S_VECTORTOANGLES = 56, // "vectortoangles" + S_ANGLECLAMP180 = 57, // "angleclamp180" + S_ANGLESTOFORWARD = 58, // "anglestoforward" + S_ANGLESTORIGHT = 59, // "anglestoright" + S_ANGLESTOUP = 60, // "anglestoup" + S_VECTORSCALE = 61, // "vectorscale" + S_ISDEFINED = 62, // "isdefined" + S_LPAREN = 63, // "(" + S_RPAREN = 64, // ")" + S_LBRACE = 65, // "{" + S_RBRACE = 66, // "}" + S_LBRACKET = 67, // "[" + S_RBRACKET = 68, // "]" + S_COMMA = 69, // "," + S_DOT = 70, // "." + S_DOUBLEDOT = 71, // ".." + S_ELLIPSIS = 72, // "..." + S_DOUBLECOLON = 73, // "::" + S_COLON = 74, // ":" + S_SEMICOLON = 75, // ";" + S_QMARK = 76, // "?" + S_INCREMENT = 77, // "++" + S_DECREMENT = 78, // "--" + S_LSHIFT = 79, // "<<" + S_RSHIFT = 80, // ">>" + S_OR = 81, // "||" + S_AND = 82, // "&&" + S_EQUALITY = 83, // "==" + S_INEQUALITY = 84, // "!=" + S_LESS_EQUAL = 85, // "<=" + S_GREATER_EQUAL = 86, // ">=" + S_LESS = 87, // "<" + S_GREATER = 88, // ">" + S_NOT = 89, // "!" + S_COMPLEMENT = 90, // "~" + S_ASSIGN = 91, // "=" + S_ASSIGN_ADD = 92, // "+=" + S_ASSIGN_SUB = 93, // "-=" + S_ASSIGN_MUL = 94, // "*=" + S_ASSIGN_DIV = 95, // "/=" + S_ASSIGN_MOD = 96, // "%=" + S_ASSIGN_BW_OR = 97, // "|=" + S_ASSIGN_BW_AND = 98, // "&=" + S_ASSIGN_BW_EXOR = 99, // "^=" + S_ASSIGN_RSHIFT = 100, // ">>=" + S_ASSIGN_LSHIFT = 101, // "<<=" + S_BITWISE_OR = 102, // "|" + S_BITWISE_AND = 103, // "&" + S_BITWISE_EXOR = 104, // "^" + S_ADD = 105, // "+" + S_SUB = 106, // "-" + S_MUL = 107, // "*" + S_DIV = 108, // "/" + S_MOD = 109, // "%" + S_PATH = 110, // "path" + S_IDENTIFIER = 111, // "identifier" + S_STRING = 112, // "string literal" + S_ISTRING = 113, // "localized string" + S_HASHSTR = 114, // "hash string" + S_FLOAT = 115, // "float" + S_INTEGER = 116, // "integer" + S_SIZEOF = 117, // SIZEOF + S_THEN = 118, // THEN + S_TERN = 119, // TERN + S_NEG = 120, // NEG + S_ANIMREF = 121, // ANIMREF + S_PREINC = 122, // PREINC + S_PREDEC = 123, // PREDEC + S_POSTINC = 124, // POSTINC + S_POSTDEC = 125, // POSTDEC + S_YYACCEPT = 126, // $accept + S_root = 127, // root + S_program = 128, // program + S_inline = 129, // inline + S_include = 130, // include + S_declaration = 131, // declaration + S_decl_usingtree = 132, // decl_usingtree + S_decl_function = 133, // decl_function + S_stmt = 134, // stmt + S_stmt_or_dev = 135, // stmt_or_dev + S_stmt_list = 136, // stmt_list + S_stmt_or_dev_list = 137, // stmt_or_dev_list + S_stmt_dev = 138, // stmt_dev + S_stmt_comp = 139, // stmt_comp + S_stmt_expr = 140, // stmt_expr + S_stmt_call = 141, // stmt_call + S_stmt_const = 142, // stmt_const + S_stmt_assign = 143, // stmt_assign + S_stmt_endon = 144, // stmt_endon + S_stmt_notify = 145, // stmt_notify + S_stmt_wait = 146, // stmt_wait + S_stmt_waittill = 147, // stmt_waittill + S_stmt_waittillmatch = 148, // stmt_waittillmatch + S_stmt_waittillframeend = 149, // stmt_waittillframeend + S_stmt_if = 150, // stmt_if + S_stmt_ifelse = 151, // stmt_ifelse + S_stmt_while = 152, // stmt_while + S_stmt_dowhile = 153, // stmt_dowhile + S_stmt_for = 154, // stmt_for + S_stmt_foreach = 155, // stmt_foreach + S_stmt_switch = 156, // stmt_switch + S_stmt_case = 157, // stmt_case + S_stmt_default = 158, // stmt_default + S_stmt_break = 159, // stmt_break + S_stmt_continue = 160, // stmt_continue + S_stmt_return = 161, // stmt_return + S_stmt_prof_begin = 162, // stmt_prof_begin + S_stmt_prof_end = 163, // stmt_prof_end + S_expr = 164, // expr + S_expr_or_empty = 165, // expr_or_empty + S_expr_increment = 166, // expr_increment + S_expr_decrement = 167, // expr_decrement + S_expr_assign = 168, // expr_assign + S_expr_ternary = 169, // expr_ternary + S_expr_binary = 170, // expr_binary + S_expr_primitive = 171, // expr_primitive + S_expr_complement = 172, // expr_complement + S_expr_negate = 173, // expr_negate + S_expr_not = 174, // expr_not + S_expr_call = 175, // expr_call + S_expr_method = 176, // expr_method + S_expr_function = 177, // expr_function + S_expr_pointer = 178, // expr_pointer + S_expr_parameters = 179, // expr_parameters + S_expr_parameters_default = 180, // expr_parameters_default + S_expr_arguments = 181, // expr_arguments + S_expr_arguments_no_empty = 182, // expr_arguments_no_empty + S_expr_getnextarraykey = 183, // expr_getnextarraykey + S_expr_getfirstarraykey = 184, // expr_getfirstarraykey + S_expr_getdvarcoloralpha = 185, // expr_getdvarcoloralpha + S_expr_getdvarcolorblue = 186, // expr_getdvarcolorblue + S_expr_getdvarcolorgreen = 187, // expr_getdvarcolorgreen + S_expr_getdvarcolorred = 188, // expr_getdvarcolorred + S_expr_getdvarvector = 189, // expr_getdvarvector + S_expr_getdvarfloat = 190, // expr_getdvarfloat + S_expr_getdvarint = 191, // expr_getdvarint + S_expr_getdvar = 192, // expr_getdvar + S_expr_gettime = 193, // expr_gettime + S_expr_abs = 194, // expr_abs + S_expr_vectortoangles = 195, // expr_vectortoangles + S_expr_angleclamp180 = 196, // expr_angleclamp180 + S_expr_anglestoforward = 197, // expr_anglestoforward + S_expr_anglestoright = 198, // expr_anglestoright + S_expr_anglestoup = 199, // expr_anglestoup + S_expr_vectorscale = 200, // expr_vectorscale + S_expr_isdefined = 201, // expr_isdefined + S_expr_reference = 202, // expr_reference + S_expr_array = 203, // expr_array + S_expr_field = 204, // expr_field + S_expr_size = 205, // expr_size + S_expr_paren = 206, // expr_paren + S_expr_object = 207, // expr_object + S_expr_empty_array = 208, // expr_empty_array + S_expr_undefined = 209, // expr_undefined + S_expr_game = 210, // expr_game + S_expr_self = 211, // expr_self + S_expr_anim = 212, // expr_anim + S_expr_level = 213, // expr_level + S_expr_animation = 214, // expr_animation + S_expr_animtree = 215, // expr_animtree + S_expr_identifier_nosize = 216, // expr_identifier_nosize + S_expr_identifier = 217, // expr_identifier + S_expr_path = 218, // expr_path + S_expr_istring = 219, // expr_istring + S_expr_string = 220, // expr_string + S_expr_vector = 221, // expr_vector + S_expr_hash = 222, // expr_hash + S_expr_float = 223, // expr_float + S_expr_integer = 224, // expr_integer + S_expr_false = 225, // expr_false + S_expr_true = 226 // expr_true }; }; @@ -1162,361 +1148,355 @@ namespace xsk { namespace arc { namespace t6 { { case symbol_kind::S_expr_function: // expr_function case symbol_kind::S_expr_pointer: // expr_pointer - value.move< ast::call > (std::move (that.value)); + value.move< call::ptr > (std::move (that.value)); break; case symbol_kind::S_declaration: // declaration - value.move< ast::decl > (std::move (that.value)); + value.move< decl::ptr > (std::move (that.value)); break; - case symbol_kind::S_decl_thread: // decl_thread - value.move< ast::decl_thread::ptr > (std::move (that.value)); + case symbol_kind::S_decl_function: // decl_function + value.move< decl_function::ptr > (std::move (that.value)); break; case symbol_kind::S_decl_usingtree: // decl_usingtree - value.move< ast::decl_usingtree::ptr > (std::move (that.value)); + value.move< decl_usingtree::ptr > (std::move (that.value)); break; case symbol_kind::S_expr: // expr case symbol_kind::S_expr_or_empty: // expr_or_empty - case symbol_kind::S_expr_assign: // expr_assign case symbol_kind::S_expr_increment: // expr_increment case symbol_kind::S_expr_decrement: // expr_decrement + case symbol_kind::S_expr_assign: // expr_assign case symbol_kind::S_expr_ternary: // expr_ternary case symbol_kind::S_expr_binary: // expr_binary case symbol_kind::S_expr_primitive: // expr_primitive case symbol_kind::S_expr_parameters_default: // expr_parameters_default case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (std::move (that.value)); + value.move< expr::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_abs: // expr_abs - value.move< ast::expr_abs::ptr > (std::move (that.value)); + value.move< expr_abs::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_angleclamp180: // expr_angleclamp180 - value.move< ast::expr_angleclamp180::ptr > (std::move (that.value)); + value.move< expr_angleclamp180::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_anglestoforward: // expr_anglestoforward - value.move< ast::expr_anglestoforward::ptr > (std::move (that.value)); + value.move< expr_anglestoforward::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_anglestoright: // expr_anglestoright - value.move< ast::expr_anglestoright::ptr > (std::move (that.value)); + value.move< expr_anglestoright::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_anglestoup: // expr_anglestoup - value.move< ast::expr_anglestoup::ptr > (std::move (that.value)); + value.move< expr_anglestoup::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (std::move (that.value)); + value.move< expr_anim::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (std::move (that.value)); + value.move< expr_animation::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (std::move (that.value)); + value.move< expr_animtree::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_arguments: // expr_arguments case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (std::move (that.value)); + value.move< expr_arguments::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (std::move (that.value)); + value.move< expr_array::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (std::move (that.value)); + value.move< expr_call::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (std::move (that.value)); + value.move< expr_complement::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (std::move (that.value)); + value.move< expr_empty_array::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (std::move (that.value)); + value.move< expr_false::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (std::move (that.value)); + value.move< expr_field::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (std::move (that.value)); + value.move< expr_float::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (std::move (that.value)); + value.move< expr_game::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_getdvar: // expr_getdvar - value.move< ast::expr_getdvar::ptr > (std::move (that.value)); + value.move< expr_getdvar::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_getdvarcoloralpha: // expr_getdvarcoloralpha - value.move< ast::expr_getdvarcoloralpha::ptr > (std::move (that.value)); + value.move< expr_getdvarcoloralpha::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_getdvarcolorblue: // expr_getdvarcolorblue - value.move< ast::expr_getdvarcolorblue::ptr > (std::move (that.value)); + value.move< expr_getdvarcolorblue::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_getdvarcolorgreen: // expr_getdvarcolorgreen - value.move< ast::expr_getdvarcolorgreen::ptr > (std::move (that.value)); + value.move< expr_getdvarcolorgreen::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_getdvarcolorred: // expr_getdvarcolorred - value.move< ast::expr_getdvarcolorred::ptr > (std::move (that.value)); + value.move< expr_getdvarcolorred::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_getdvarfloat: // expr_getdvarfloat - value.move< ast::expr_getdvarfloat::ptr > (std::move (that.value)); + value.move< expr_getdvarfloat::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_getdvarint: // expr_getdvarint - value.move< ast::expr_getdvarint::ptr > (std::move (that.value)); + value.move< expr_getdvarint::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_getdvarvector: // expr_getdvarvector - value.move< ast::expr_getdvarvector::ptr > (std::move (that.value)); + value.move< expr_getdvarvector::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_getfirstarraykey: // expr_getfirstarraykey - value.move< ast::expr_getfirstarraykey::ptr > (std::move (that.value)); + value.move< expr_getfirstarraykey::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_getnextarraykey: // expr_getnextarraykey - value.move< ast::expr_getnextarraykey::ptr > (std::move (that.value)); + value.move< expr_getnextarraykey::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_gettime: // expr_gettime - value.move< ast::expr_gettime::ptr > (std::move (that.value)); + value.move< expr_gettime::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_hash: // expr_hash - value.move< ast::expr_hash::ptr > (std::move (that.value)); + value.move< expr_hash::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (std::move (that.value)); + value.move< expr_identifier::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (std::move (that.value)); + value.move< expr_integer::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_isdefined: // expr_isdefined - value.move< ast::expr_isdefined::ptr > (std::move (that.value)); + value.move< expr_isdefined::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (std::move (that.value)); + value.move< expr_istring::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (std::move (that.value)); + value.move< expr_level::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (std::move (that.value)); + value.move< expr_method::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (std::move (that.value)); + value.move< expr_negate::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (std::move (that.value)); + value.move< expr_not::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (std::move (that.value)); + value.move< expr_parameters::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (std::move (that.value)); + value.move< expr_paren::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (std::move (that.value)); + value.move< expr_path::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (std::move (that.value)); + value.move< expr_reference::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (std::move (that.value)); + value.move< expr_self::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (std::move (that.value)); + value.move< expr_size::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (std::move (that.value)); + value.move< expr_string::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_true: // expr_true - value.move< ast::expr_true::ptr > (std::move (that.value)); + value.move< expr_true::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_undefined: // expr_undefined - value.move< ast::expr_undefined::ptr > (std::move (that.value)); + value.move< expr_undefined::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_vector: // expr_vector - value.move< ast::expr_vector::ptr > (std::move (that.value)); + value.move< expr_vector::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_vectorscale: // expr_vectorscale - value.move< ast::expr_vectorscale::ptr > (std::move (that.value)); + value.move< expr_vectorscale::ptr > (std::move (that.value)); break; case symbol_kind::S_expr_vectortoangles: // expr_vectortoangles - value.move< ast::expr_vectortoangles::ptr > (std::move (that.value)); + value.move< expr_vectortoangles::ptr > (std::move (that.value)); break; case symbol_kind::S_include: // include - value.move< ast::include::ptr > (std::move (that.value)); + value.move< include::ptr > (std::move (that.value)); break; case symbol_kind::S_program: // program - value.move< ast::program::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt: // stmt - case symbol_kind::S_stmt_or_dev: // stmt_or_dev - value.move< ast::stmt > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_assign: // stmt_assign - value.move< ast::stmt_assign::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_break: // stmt_break - value.move< ast::stmt_break::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_call: // stmt_call - value.move< ast::stmt_call::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_case: // stmt_case - value.move< ast::stmt_case::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_const: // stmt_const - value.move< ast::stmt_const::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_continue: // stmt_continue - value.move< ast::stmt_continue::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_default: // stmt_default - value.move< ast::stmt_default::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_dev: // stmt_dev - value.move< ast::stmt_dev::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_dowhile: // stmt_dowhile - value.move< ast::stmt_dowhile::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_endon: // stmt_endon - value.move< ast::stmt_endon::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_expr: // stmt_expr - value.move< ast::stmt_expr::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_for: // stmt_for - value.move< ast::stmt_for::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_foreach: // stmt_foreach - value.move< ast::stmt_foreach::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_if: // stmt_if - value.move< ast::stmt_if::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_ifelse: // stmt_ifelse - value.move< ast::stmt_ifelse::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_list: // stmt_list - case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list - case symbol_kind::S_stmt_block: // stmt_block - value.move< ast::stmt_list::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_notify: // stmt_notify - value.move< ast::stmt_notify::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin - value.move< ast::stmt_prof_begin::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_prof_end: // stmt_prof_end - value.move< ast::stmt_prof_end::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_return: // stmt_return - value.move< ast::stmt_return::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_switch: // stmt_switch - value.move< ast::stmt_switch::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_wait: // stmt_wait - value.move< ast::stmt_wait::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.move< ast::stmt_waittill::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.move< ast::stmt_waittillframeend::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.move< ast::stmt_waittillmatch::ptr > (std::move (that.value)); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.move< ast::stmt_while::ptr > (std::move (that.value)); + value.move< program::ptr > (std::move (that.value)); break; case symbol_kind::S_PATH: // "path" case symbol_kind::S_IDENTIFIER: // "identifier" case symbol_kind::S_STRING: // "string literal" case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_HASH: // "hash" + case symbol_kind::S_HASHSTR: // "hash string" case symbol_kind::S_FLOAT: // "float" case symbol_kind::S_INTEGER: // "integer" value.move< std::string > (std::move (that.value)); break; + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_stmt_or_dev: // stmt_or_dev + value.move< stmt::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_comp: // stmt_comp + value.move< stmt_comp::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_dev: // stmt_dev + value.move< stmt_dev::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_dowhile: // stmt_dowhile + value.move< stmt_dowhile::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_expr: // stmt_expr + case symbol_kind::S_stmt_call: // stmt_call + case symbol_kind::S_stmt_const: // stmt_const + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_expr::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_list: // stmt_list + case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list + value.move< stmt_list::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin + value.move< stmt_prof_begin::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_prof_end: // stmt_prof_end + value.move< stmt_prof_end::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while::ptr > (std::move (that.value)); + break; + default: break; } @@ -1541,13 +1521,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::call&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, call::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::call& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const call::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1555,13 +1535,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::decl&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, decl::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::decl& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const decl::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1569,13 +1549,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::decl_thread::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, decl_function::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::decl_thread::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const decl_function::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1583,13 +1563,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::decl_usingtree::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, decl_usingtree::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::decl_usingtree::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const decl_usingtree::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1597,13 +1577,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1611,13 +1591,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_abs::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_abs::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_abs::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_abs::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1625,13 +1605,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_angleclamp180::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_angleclamp180::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_angleclamp180::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_angleclamp180::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1639,13 +1619,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_anglestoforward::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_anglestoforward::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_anglestoforward::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_anglestoforward::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1653,13 +1633,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_anglestoright::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_anglestoright::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_anglestoright::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_anglestoright::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1667,13 +1647,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_anglestoup::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_anglestoup::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_anglestoup::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_anglestoup::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1681,13 +1661,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_anim::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_anim::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_anim::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_anim::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1695,13 +1675,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_animation::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_animation::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_animation::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_animation::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1709,13 +1689,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_animtree::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_animtree::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_animtree::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_animtree::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1723,13 +1703,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_arguments::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_arguments::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_arguments::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_arguments::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1737,13 +1717,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_array::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_array::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_array::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_array::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1751,13 +1731,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_call::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_call::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_call::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_call::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1765,13 +1745,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_complement::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_complement::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_complement::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_complement::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1779,13 +1759,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_empty_array::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_empty_array::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_empty_array::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_empty_array::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1793,13 +1773,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_false::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_false::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_false::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_false::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1807,13 +1787,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_field::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_field::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_field::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_field::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1821,13 +1801,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_float::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_float::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_float::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_float::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1835,13 +1815,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_game::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_game::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_game::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_game::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1849,13 +1829,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_getdvar::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_getdvar::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_getdvar::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_getdvar::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1863,13 +1843,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_getdvarcoloralpha::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_getdvarcoloralpha::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_getdvarcoloralpha::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_getdvarcoloralpha::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1877,13 +1857,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_getdvarcolorblue::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_getdvarcolorblue::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_getdvarcolorblue::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_getdvarcolorblue::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1891,13 +1871,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_getdvarcolorgreen::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_getdvarcolorgreen::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_getdvarcolorgreen::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_getdvarcolorgreen::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1905,13 +1885,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_getdvarcolorred::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_getdvarcolorred::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_getdvarcolorred::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_getdvarcolorred::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1919,13 +1899,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_getdvarfloat::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_getdvarfloat::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_getdvarfloat::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_getdvarfloat::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1933,13 +1913,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_getdvarint::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_getdvarint::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_getdvarint::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_getdvarint::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1947,13 +1927,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_getdvarvector::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_getdvarvector::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_getdvarvector::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_getdvarvector::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1961,13 +1941,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_getfirstarraykey::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_getfirstarraykey::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_getfirstarraykey::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_getfirstarraykey::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1975,13 +1955,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_getnextarraykey::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_getnextarraykey::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_getnextarraykey::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_getnextarraykey::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1989,13 +1969,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_gettime::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_gettime::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_gettime::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_gettime::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2003,13 +1983,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_hash::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_hash::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_hash::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_hash::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2017,13 +1997,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_identifier::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_identifier::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_identifier::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_identifier::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2031,13 +2011,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_integer::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_integer::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_integer::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_integer::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2045,13 +2025,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_isdefined::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_isdefined::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_isdefined::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_isdefined::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2059,13 +2039,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_istring::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_istring::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_istring::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_istring::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2073,13 +2053,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_level::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_level::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_level::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_level::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2087,13 +2067,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_method::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_method::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_method::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_method::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2101,13 +2081,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_negate::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_negate::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_negate::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_negate::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2115,13 +2095,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_not::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_not::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_not::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_not::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2129,13 +2109,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_parameters::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_parameters::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_parameters::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_parameters::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2143,13 +2123,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_paren::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_paren::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_paren::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_paren::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2157,13 +2137,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_path::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_path::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_path::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_path::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2171,13 +2151,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_reference::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_reference::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_reference::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_reference::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2185,13 +2165,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_self::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_self::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_self::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_self::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2199,13 +2179,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_size::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_size::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_size::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_size::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2213,13 +2193,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_string::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_string::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_string::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_string::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2227,13 +2207,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_true::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_true::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_true::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_true::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2241,13 +2221,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_undefined::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_undefined::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_undefined::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_undefined::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2255,13 +2235,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_vector::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_vector::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_vector::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_vector::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2269,13 +2249,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_vectorscale::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_vectorscale::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_vectorscale::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_vectorscale::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2283,13 +2263,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::expr_vectortoangles::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, expr_vectortoangles::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::expr_vectortoangles::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const expr_vectortoangles::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2297,13 +2277,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::include::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, include::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::include::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const include::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2311,391 +2291,13 @@ namespace xsk { namespace arc { namespace t6 { #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::program::ptr&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, program::ptr&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const ast::program::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_assign::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_assign::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_break::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_break::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_call::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_call::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_case::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_case::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_const::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_const::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_continue::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_continue::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_default::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_default::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_dev::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_dev::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_dowhile::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_dowhile::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_endon::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_endon::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_expr::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_expr::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_for::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_for::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_foreach::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_foreach::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_if::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_if::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_ifelse::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_ifelse::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_list::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_list::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_notify::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_notify::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_prof_begin::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_prof_begin::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_prof_end::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_prof_end::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_return::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_return::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_switch::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_switch::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_wait::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_wait::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_waittill::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_waittill::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_waittillframeend::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_waittillframeend::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_waittillmatch::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_waittillmatch::ptr& v, const location_type& l) - : Base (t) - , value (v) - , location (l) - {} -#endif - -#if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, ast::stmt_while::ptr&& v, location_type&& l) - : Base (t) - , value (std::move (v)) - , location (std::move (l)) - {} -#else - basic_symbol (typename Base::kind_type t, const ast::stmt_while::ptr& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const program::ptr& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -2716,6 +2318,356 @@ namespace xsk { namespace arc { namespace t6 { {} #endif +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_break::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_break::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_case::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_case::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_comp::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_comp::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_continue::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_continue::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_default::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_default::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_dev::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_dev::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_dowhile::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_dowhile::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_endon::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_endon::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_expr::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_expr::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_for::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_for::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_foreach::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_foreach::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_if::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_if::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_ifelse::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_ifelse::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_list::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_list::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_notify::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_notify::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_prof_begin::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_prof_begin::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_prof_end::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_prof_end::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_return::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_return::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_switch::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_switch::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_wait::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_wait::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittill::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittill::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittillframeend::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittillframeend::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_waittillmatch::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_waittillmatch::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, stmt_while::ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const stmt_while::ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + /// Destroy the symbol. ~basic_symbol () { @@ -2742,361 +2694,355 @@ switch (yykind) { case symbol_kind::S_expr_function: // expr_function case symbol_kind::S_expr_pointer: // expr_pointer - value.template destroy< ast::call > (); + value.template destroy< call::ptr > (); break; case symbol_kind::S_declaration: // declaration - value.template destroy< ast::decl > (); + value.template destroy< decl::ptr > (); break; - case symbol_kind::S_decl_thread: // decl_thread - value.template destroy< ast::decl_thread::ptr > (); + case symbol_kind::S_decl_function: // decl_function + value.template destroy< decl_function::ptr > (); break; case symbol_kind::S_decl_usingtree: // decl_usingtree - value.template destroy< ast::decl_usingtree::ptr > (); + value.template destroy< decl_usingtree::ptr > (); break; case symbol_kind::S_expr: // expr case symbol_kind::S_expr_or_empty: // expr_or_empty - case symbol_kind::S_expr_assign: // expr_assign case symbol_kind::S_expr_increment: // expr_increment case symbol_kind::S_expr_decrement: // expr_decrement + case symbol_kind::S_expr_assign: // expr_assign case symbol_kind::S_expr_ternary: // expr_ternary case symbol_kind::S_expr_binary: // expr_binary case symbol_kind::S_expr_primitive: // expr_primitive case symbol_kind::S_expr_parameters_default: // expr_parameters_default case symbol_kind::S_expr_object: // expr_object - value.template destroy< ast::expr > (); + value.template destroy< expr::ptr > (); break; case symbol_kind::S_expr_abs: // expr_abs - value.template destroy< ast::expr_abs::ptr > (); + value.template destroy< expr_abs::ptr > (); break; case symbol_kind::S_expr_angleclamp180: // expr_angleclamp180 - value.template destroy< ast::expr_angleclamp180::ptr > (); + value.template destroy< expr_angleclamp180::ptr > (); break; case symbol_kind::S_expr_anglestoforward: // expr_anglestoforward - value.template destroy< ast::expr_anglestoforward::ptr > (); + value.template destroy< expr_anglestoforward::ptr > (); break; case symbol_kind::S_expr_anglestoright: // expr_anglestoright - value.template destroy< ast::expr_anglestoright::ptr > (); + value.template destroy< expr_anglestoright::ptr > (); break; case symbol_kind::S_expr_anglestoup: // expr_anglestoup - value.template destroy< ast::expr_anglestoup::ptr > (); + value.template destroy< expr_anglestoup::ptr > (); break; case symbol_kind::S_expr_anim: // expr_anim - value.template destroy< ast::expr_anim::ptr > (); + value.template destroy< expr_anim::ptr > (); break; case symbol_kind::S_expr_animation: // expr_animation - value.template destroy< ast::expr_animation::ptr > (); + value.template destroy< expr_animation::ptr > (); break; case symbol_kind::S_expr_animtree: // expr_animtree - value.template destroy< ast::expr_animtree::ptr > (); + value.template destroy< expr_animtree::ptr > (); break; case symbol_kind::S_expr_arguments: // expr_arguments case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.template destroy< ast::expr_arguments::ptr > (); + value.template destroy< expr_arguments::ptr > (); break; case symbol_kind::S_expr_array: // expr_array - value.template destroy< ast::expr_array::ptr > (); + value.template destroy< expr_array::ptr > (); break; case symbol_kind::S_expr_call: // expr_call - value.template destroy< ast::expr_call::ptr > (); + value.template destroy< expr_call::ptr > (); break; case symbol_kind::S_expr_complement: // expr_complement - value.template destroy< ast::expr_complement::ptr > (); + value.template destroy< expr_complement::ptr > (); break; case symbol_kind::S_expr_empty_array: // expr_empty_array - value.template destroy< ast::expr_empty_array::ptr > (); + value.template destroy< expr_empty_array::ptr > (); break; case symbol_kind::S_expr_false: // expr_false - value.template destroy< ast::expr_false::ptr > (); + value.template destroy< expr_false::ptr > (); break; case symbol_kind::S_expr_field: // expr_field - value.template destroy< ast::expr_field::ptr > (); + value.template destroy< expr_field::ptr > (); break; case symbol_kind::S_expr_float: // expr_float - value.template destroy< ast::expr_float::ptr > (); + value.template destroy< expr_float::ptr > (); break; case symbol_kind::S_expr_game: // expr_game - value.template destroy< ast::expr_game::ptr > (); + value.template destroy< expr_game::ptr > (); break; case symbol_kind::S_expr_getdvar: // expr_getdvar - value.template destroy< ast::expr_getdvar::ptr > (); + value.template destroy< expr_getdvar::ptr > (); break; case symbol_kind::S_expr_getdvarcoloralpha: // expr_getdvarcoloralpha - value.template destroy< ast::expr_getdvarcoloralpha::ptr > (); + value.template destroy< expr_getdvarcoloralpha::ptr > (); break; case symbol_kind::S_expr_getdvarcolorblue: // expr_getdvarcolorblue - value.template destroy< ast::expr_getdvarcolorblue::ptr > (); + value.template destroy< expr_getdvarcolorblue::ptr > (); break; case symbol_kind::S_expr_getdvarcolorgreen: // expr_getdvarcolorgreen - value.template destroy< ast::expr_getdvarcolorgreen::ptr > (); + value.template destroy< expr_getdvarcolorgreen::ptr > (); break; case symbol_kind::S_expr_getdvarcolorred: // expr_getdvarcolorred - value.template destroy< ast::expr_getdvarcolorred::ptr > (); + value.template destroy< expr_getdvarcolorred::ptr > (); break; case symbol_kind::S_expr_getdvarfloat: // expr_getdvarfloat - value.template destroy< ast::expr_getdvarfloat::ptr > (); + value.template destroy< expr_getdvarfloat::ptr > (); break; case symbol_kind::S_expr_getdvarint: // expr_getdvarint - value.template destroy< ast::expr_getdvarint::ptr > (); + value.template destroy< expr_getdvarint::ptr > (); break; case symbol_kind::S_expr_getdvarvector: // expr_getdvarvector - value.template destroy< ast::expr_getdvarvector::ptr > (); + value.template destroy< expr_getdvarvector::ptr > (); break; case symbol_kind::S_expr_getfirstarraykey: // expr_getfirstarraykey - value.template destroy< ast::expr_getfirstarraykey::ptr > (); + value.template destroy< expr_getfirstarraykey::ptr > (); break; case symbol_kind::S_expr_getnextarraykey: // expr_getnextarraykey - value.template destroy< ast::expr_getnextarraykey::ptr > (); + value.template destroy< expr_getnextarraykey::ptr > (); break; case symbol_kind::S_expr_gettime: // expr_gettime - value.template destroy< ast::expr_gettime::ptr > (); + value.template destroy< expr_gettime::ptr > (); break; case symbol_kind::S_expr_hash: // expr_hash - value.template destroy< ast::expr_hash::ptr > (); + value.template destroy< expr_hash::ptr > (); break; case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize case symbol_kind::S_expr_identifier: // expr_identifier - value.template destroy< ast::expr_identifier::ptr > (); + value.template destroy< expr_identifier::ptr > (); break; case symbol_kind::S_expr_integer: // expr_integer - value.template destroy< ast::expr_integer::ptr > (); + value.template destroy< expr_integer::ptr > (); break; case symbol_kind::S_expr_isdefined: // expr_isdefined - value.template destroy< ast::expr_isdefined::ptr > (); + value.template destroy< expr_isdefined::ptr > (); break; case symbol_kind::S_expr_istring: // expr_istring - value.template destroy< ast::expr_istring::ptr > (); + value.template destroy< expr_istring::ptr > (); break; case symbol_kind::S_expr_level: // expr_level - value.template destroy< ast::expr_level::ptr > (); + value.template destroy< expr_level::ptr > (); break; case symbol_kind::S_expr_method: // expr_method - value.template destroy< ast::expr_method::ptr > (); + value.template destroy< expr_method::ptr > (); break; case symbol_kind::S_expr_negate: // expr_negate - value.template destroy< ast::expr_negate::ptr > (); + value.template destroy< expr_negate::ptr > (); break; case symbol_kind::S_expr_not: // expr_not - value.template destroy< ast::expr_not::ptr > (); + value.template destroy< expr_not::ptr > (); break; case symbol_kind::S_expr_parameters: // expr_parameters - value.template destroy< ast::expr_parameters::ptr > (); + value.template destroy< expr_parameters::ptr > (); break; case symbol_kind::S_expr_paren: // expr_paren - value.template destroy< ast::expr_paren::ptr > (); + value.template destroy< expr_paren::ptr > (); break; case symbol_kind::S_expr_path: // expr_path - value.template destroy< ast::expr_path::ptr > (); + value.template destroy< expr_path::ptr > (); break; case symbol_kind::S_expr_reference: // expr_reference - value.template destroy< ast::expr_reference::ptr > (); + value.template destroy< expr_reference::ptr > (); break; case symbol_kind::S_expr_self: // expr_self - value.template destroy< ast::expr_self::ptr > (); + value.template destroy< expr_self::ptr > (); break; case symbol_kind::S_expr_size: // expr_size - value.template destroy< ast::expr_size::ptr > (); + value.template destroy< expr_size::ptr > (); break; case symbol_kind::S_expr_string: // expr_string - value.template destroy< ast::expr_string::ptr > (); + value.template destroy< expr_string::ptr > (); break; case symbol_kind::S_expr_true: // expr_true - value.template destroy< ast::expr_true::ptr > (); + value.template destroy< expr_true::ptr > (); break; case symbol_kind::S_expr_undefined: // expr_undefined - value.template destroy< ast::expr_undefined::ptr > (); + value.template destroy< expr_undefined::ptr > (); break; case symbol_kind::S_expr_vector: // expr_vector - value.template destroy< ast::expr_vector::ptr > (); + value.template destroy< expr_vector::ptr > (); break; case symbol_kind::S_expr_vectorscale: // expr_vectorscale - value.template destroy< ast::expr_vectorscale::ptr > (); + value.template destroy< expr_vectorscale::ptr > (); break; case symbol_kind::S_expr_vectortoangles: // expr_vectortoangles - value.template destroy< ast::expr_vectortoangles::ptr > (); + value.template destroy< expr_vectortoangles::ptr > (); break; case symbol_kind::S_include: // include - value.template destroy< ast::include::ptr > (); + value.template destroy< include::ptr > (); break; case symbol_kind::S_program: // program - value.template destroy< ast::program::ptr > (); - break; - - case symbol_kind::S_stmt: // stmt - case symbol_kind::S_stmt_or_dev: // stmt_or_dev - value.template destroy< ast::stmt > (); - break; - - case symbol_kind::S_stmt_assign: // stmt_assign - value.template destroy< ast::stmt_assign::ptr > (); - break; - - case symbol_kind::S_stmt_break: // stmt_break - value.template destroy< ast::stmt_break::ptr > (); - break; - - case symbol_kind::S_stmt_call: // stmt_call - value.template destroy< ast::stmt_call::ptr > (); - break; - - case symbol_kind::S_stmt_case: // stmt_case - value.template destroy< ast::stmt_case::ptr > (); - break; - - case symbol_kind::S_stmt_const: // stmt_const - value.template destroy< ast::stmt_const::ptr > (); - break; - - case symbol_kind::S_stmt_continue: // stmt_continue - value.template destroy< ast::stmt_continue::ptr > (); - break; - - case symbol_kind::S_stmt_default: // stmt_default - value.template destroy< ast::stmt_default::ptr > (); - break; - - case symbol_kind::S_stmt_dev: // stmt_dev - value.template destroy< ast::stmt_dev::ptr > (); - break; - - case symbol_kind::S_stmt_dowhile: // stmt_dowhile - value.template destroy< ast::stmt_dowhile::ptr > (); - break; - - case symbol_kind::S_stmt_endon: // stmt_endon - value.template destroy< ast::stmt_endon::ptr > (); - break; - - case symbol_kind::S_stmt_expr: // stmt_expr - value.template destroy< ast::stmt_expr::ptr > (); - break; - - case symbol_kind::S_stmt_for: // stmt_for - value.template destroy< ast::stmt_for::ptr > (); - break; - - case symbol_kind::S_stmt_foreach: // stmt_foreach - value.template destroy< ast::stmt_foreach::ptr > (); - break; - - case symbol_kind::S_stmt_if: // stmt_if - value.template destroy< ast::stmt_if::ptr > (); - break; - - case symbol_kind::S_stmt_ifelse: // stmt_ifelse - value.template destroy< ast::stmt_ifelse::ptr > (); - break; - - case symbol_kind::S_stmt_list: // stmt_list - case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list - case symbol_kind::S_stmt_block: // stmt_block - value.template destroy< ast::stmt_list::ptr > (); - break; - - case symbol_kind::S_stmt_notify: // stmt_notify - value.template destroy< ast::stmt_notify::ptr > (); - break; - - case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin - value.template destroy< ast::stmt_prof_begin::ptr > (); - break; - - case symbol_kind::S_stmt_prof_end: // stmt_prof_end - value.template destroy< ast::stmt_prof_end::ptr > (); - break; - - case symbol_kind::S_stmt_return: // stmt_return - value.template destroy< ast::stmt_return::ptr > (); - break; - - case symbol_kind::S_stmt_switch: // stmt_switch - value.template destroy< ast::stmt_switch::ptr > (); - break; - - case symbol_kind::S_stmt_wait: // stmt_wait - value.template destroy< ast::stmt_wait::ptr > (); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.template destroy< ast::stmt_waittill::ptr > (); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.template destroy< ast::stmt_waittillframeend::ptr > (); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.template destroy< ast::stmt_waittillmatch::ptr > (); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.template destroy< ast::stmt_while::ptr > (); + value.template destroy< program::ptr > (); break; case symbol_kind::S_PATH: // "path" case symbol_kind::S_IDENTIFIER: // "identifier" case symbol_kind::S_STRING: // "string literal" case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_HASH: // "hash" + case symbol_kind::S_HASHSTR: // "hash string" case symbol_kind::S_FLOAT: // "float" case symbol_kind::S_INTEGER: // "integer" value.template destroy< std::string > (); break; + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_stmt_or_dev: // stmt_or_dev + value.template destroy< stmt::ptr > (); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.template destroy< stmt_break::ptr > (); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.template destroy< stmt_case::ptr > (); + break; + + case symbol_kind::S_stmt_comp: // stmt_comp + value.template destroy< stmt_comp::ptr > (); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.template destroy< stmt_continue::ptr > (); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.template destroy< stmt_default::ptr > (); + break; + + case symbol_kind::S_stmt_dev: // stmt_dev + value.template destroy< stmt_dev::ptr > (); + break; + + case symbol_kind::S_stmt_dowhile: // stmt_dowhile + value.template destroy< stmt_dowhile::ptr > (); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.template destroy< stmt_endon::ptr > (); + break; + + case symbol_kind::S_stmt_expr: // stmt_expr + case symbol_kind::S_stmt_call: // stmt_call + case symbol_kind::S_stmt_const: // stmt_const + case symbol_kind::S_stmt_assign: // stmt_assign + value.template destroy< stmt_expr::ptr > (); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.template destroy< stmt_for::ptr > (); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.template destroy< stmt_foreach::ptr > (); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.template destroy< stmt_if::ptr > (); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.template destroy< stmt_ifelse::ptr > (); + break; + + case symbol_kind::S_stmt_list: // stmt_list + case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list + value.template destroy< stmt_list::ptr > (); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.template destroy< stmt_notify::ptr > (); + break; + + case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin + value.template destroy< stmt_prof_begin::ptr > (); + break; + + case symbol_kind::S_stmt_prof_end: // stmt_prof_end + value.template destroy< stmt_prof_end::ptr > (); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.template destroy< stmt_return::ptr > (); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.template destroy< stmt_switch::ptr > (); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.template destroy< stmt_wait::ptr > (); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.template destroy< stmt_waittill::ptr > (); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.template destroy< stmt_waittillframeend::ptr > (); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.template destroy< stmt_waittillmatch::ptr > (); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.template destroy< stmt_while::ptr > (); + break; + default: break; } @@ -3194,8 +3140,8 @@ switch (yykind) #endif { #if !defined _MSC_VER || defined __clang__ - T6_ASSERT (tok == token::T6EOF - || (token::T6error <= tok && tok <= token::MOD) + ARC_ASSERT (tok == token::ARCEOF + || (token::ARCerror <= tok && tok <= token::MOD) || (token::SIZEOF <= tok && tok <= token::POSTDEC)); #endif } @@ -3208,13 +3154,13 @@ switch (yykind) #endif { #if !defined _MSC_VER || defined __clang__ - T6_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); + ARC_ASSERT ((token::PATH <= tok && tok <= token::INTEGER)); #endif } }; /// Build a parser object. - parser (xsk::arc::t6::lexer& lexer_yyarg, xsk::arc::ast::program::ptr& ast_yyarg); + parser (xsk::arc::context const* ctx__yyarg, xsk::arc::preprocessor& ppr_yyarg, xsk::arc::program::ptr& ast_yyarg, std::uint32_t index_yyarg); virtual ~parser (); #if 201103L <= YY_CPLUSPLUS @@ -3232,7 +3178,7 @@ switch (yykind) /// \returns 0 iff parsing succeeded. virtual int parse (); -#if T6DEBUG +#if ARCDEBUG /// The current debugging stream. std::ostream& debug_stream () const YY_ATTRIBUTE_PURE; /// Set the current debugging stream. @@ -3262,166 +3208,61 @@ switch (yykind) #if 201103L <= YY_CPLUSPLUS static symbol_type - make_T6EOF (location_type l) + make_ARCEOF (location_type l) { - return symbol_type (token::T6EOF, std::move (l)); + return symbol_type (token::ARCEOF, std::move (l)); } #else static symbol_type - make_T6EOF (const location_type& l) + make_ARCEOF (const location_type& l) { - return symbol_type (token::T6EOF, l); + return symbol_type (token::ARCEOF, l); } #endif #if 201103L <= YY_CPLUSPLUS static symbol_type - make_T6error (location_type l) + make_ARCerror (location_type l) { - return symbol_type (token::T6error, std::move (l)); + return symbol_type (token::ARCerror, std::move (l)); } #else static symbol_type - make_T6error (const location_type& l) + make_ARCerror (const location_type& l) { - return symbol_type (token::T6error, l); + return symbol_type (token::ARCerror, l); } #endif #if 201103L <= YY_CPLUSPLUS static symbol_type - make_T6UNDEF (location_type l) + make_ARCUNDEF (location_type l) { - return symbol_type (token::T6UNDEF, std::move (l)); + return symbol_type (token::ARCUNDEF, std::move (l)); } #else static symbol_type - make_T6UNDEF (const location_type& l) + make_ARCUNDEF (const location_type& l) { - return symbol_type (token::T6UNDEF, l); + return symbol_type (token::ARCUNDEF, l); } #endif #if 201103L <= YY_CPLUSPLUS static symbol_type - make_SH_DEFINE (location_type l) + make_HASH (location_type l) { - return symbol_type (token::SH_DEFINE, std::move (l)); + return symbol_type (token::HASH, std::move (l)); } #else static symbol_type - make_SH_DEFINE (const location_type& l) + make_HASH (const location_type& l) { - return symbol_type (token::SH_DEFINE, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_SH_UNDEF (location_type l) - { - return symbol_type (token::SH_UNDEF, std::move (l)); - } -#else - static - symbol_type - make_SH_UNDEF (const location_type& l) - { - return symbol_type (token::SH_UNDEF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_SH_IFDEF (location_type l) - { - return symbol_type (token::SH_IFDEF, std::move (l)); - } -#else - static - symbol_type - make_SH_IFDEF (const location_type& l) - { - return symbol_type (token::SH_IFDEF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_SH_IFNDEF (location_type l) - { - return symbol_type (token::SH_IFNDEF, std::move (l)); - } -#else - static - symbol_type - make_SH_IFNDEF (const location_type& l) - { - return symbol_type (token::SH_IFNDEF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_SH_IF (location_type l) - { - return symbol_type (token::SH_IF, std::move (l)); - } -#else - static - symbol_type - make_SH_IF (const location_type& l) - { - return symbol_type (token::SH_IF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_SH_ELIF (location_type l) - { - return symbol_type (token::SH_ELIF, std::move (l)); - } -#else - static - symbol_type - make_SH_ELIF (const location_type& l) - { - return symbol_type (token::SH_ELIF, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_SH_ELSE (location_type l) - { - return symbol_type (token::SH_ELSE, std::move (l)); - } -#else - static - symbol_type - make_SH_ELSE (const location_type& l) - { - return symbol_type (token::SH_ELSE, l); - } -#endif -#if 201103L <= YY_CPLUSPLUS - static - symbol_type - make_SH_ENDIF (location_type l) - { - return symbol_type (token::SH_ENDIF, std::move (l)); - } -#else - static - symbol_type - make_SH_ENDIF (const location_type& l) - { - return symbol_type (token::SH_ENDIF, l); + return symbol_type (token::HASH, l); } #endif #if 201103L <= YY_CPLUSPLUS @@ -4429,6 +4270,36 @@ switch (yykind) return symbol_type (token::DOT, l); } #endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DOUBLEDOT (location_type l) + { + return symbol_type (token::DOUBLEDOT, std::move (l)); + } +#else + static + symbol_type + make_DOUBLEDOT (const location_type& l) + { + return symbol_type (token::DOUBLEDOT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ELLIPSIS (location_type l) + { + return symbol_type (token::ELLIPSIS, std::move (l)); + } +#else + static + symbol_type + make_ELLIPSIS (const location_type& l) + { + return symbol_type (token::ELLIPSIS, l); + } +#endif #if 201103L <= YY_CPLUSPLUS static symbol_type @@ -5047,16 +4918,16 @@ switch (yykind) #if 201103L <= YY_CPLUSPLUS static symbol_type - make_HASH (std::string v, location_type l) + make_HASHSTR (std::string v, location_type l) { - return symbol_type (token::HASH, std::move (v), std::move (l)); + return symbol_type (token::HASHSTR, std::move (v), std::move (l)); } #else static symbol_type - make_HASH (const std::string& v, const location_type& l) + make_HASHSTR (const std::string& v, const location_type& l) { - return symbol_type (token::HASH, v, l); + return symbol_type (token::HASHSTR, v, l); } #endif #if 201103L <= YY_CPLUSPLUS @@ -5330,7 +5201,7 @@ switch (yykind) static const signed char yyr2_[]; -#if T6DEBUG +#if ARCDEBUG // YYRLINE[YYN] -- Source line where rule number YYN was defined. static const short yyrline_[]; /// Report on the debug stream that the rule \a r is going to be reduced. @@ -5568,15 +5439,17 @@ switch (yykind) /// Constants. enum { - yylast_ = 3635, ///< Last index in yytable_. + yylast_ = 3314, ///< Last index in yytable_. yynnts_ = 101, ///< Number of nonterminal symbols. - yyfinal_ = 27 ///< Termination state number. + yyfinal_ = 28 ///< Termination state number. }; // User arguments. - xsk::arc::t6::lexer& lexer; - xsk::arc::ast::program::ptr& ast; + xsk::arc::context const* ctx_; + xsk::arc::preprocessor& ppr; + xsk::arc::program::ptr& ast; + std::uint32_t index; }; @@ -5598,361 +5471,355 @@ switch (yykind) { case symbol_kind::S_expr_function: // expr_function case symbol_kind::S_expr_pointer: // expr_pointer - value.copy< ast::call > (YY_MOVE (that.value)); + value.copy< call::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_declaration: // declaration - value.copy< ast::decl > (YY_MOVE (that.value)); + value.copy< decl::ptr > (YY_MOVE (that.value)); break; - case symbol_kind::S_decl_thread: // decl_thread - value.copy< ast::decl_thread::ptr > (YY_MOVE (that.value)); + case symbol_kind::S_decl_function: // decl_function + value.copy< decl_function::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_decl_usingtree: // decl_usingtree - value.copy< ast::decl_usingtree::ptr > (YY_MOVE (that.value)); + value.copy< decl_usingtree::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr: // expr case symbol_kind::S_expr_or_empty: // expr_or_empty - case symbol_kind::S_expr_assign: // expr_assign case symbol_kind::S_expr_increment: // expr_increment case symbol_kind::S_expr_decrement: // expr_decrement + case symbol_kind::S_expr_assign: // expr_assign case symbol_kind::S_expr_ternary: // expr_ternary case symbol_kind::S_expr_binary: // expr_binary case symbol_kind::S_expr_primitive: // expr_primitive case symbol_kind::S_expr_parameters_default: // expr_parameters_default case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (YY_MOVE (that.value)); + value.copy< expr::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_abs: // expr_abs - value.copy< ast::expr_abs::ptr > (YY_MOVE (that.value)); + value.copy< expr_abs::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_angleclamp180: // expr_angleclamp180 - value.copy< ast::expr_angleclamp180::ptr > (YY_MOVE (that.value)); + value.copy< expr_angleclamp180::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_anglestoforward: // expr_anglestoforward - value.copy< ast::expr_anglestoforward::ptr > (YY_MOVE (that.value)); + value.copy< expr_anglestoforward::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_anglestoright: // expr_anglestoright - value.copy< ast::expr_anglestoright::ptr > (YY_MOVE (that.value)); + value.copy< expr_anglestoright::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_anglestoup: // expr_anglestoup - value.copy< ast::expr_anglestoup::ptr > (YY_MOVE (that.value)); + value.copy< expr_anglestoup::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_anim: // expr_anim - value.copy< ast::expr_anim::ptr > (YY_MOVE (that.value)); + value.copy< expr_anim::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_animation: // expr_animation - value.copy< ast::expr_animation::ptr > (YY_MOVE (that.value)); + value.copy< expr_animation::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (YY_MOVE (that.value)); + value.copy< expr_animtree::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_arguments: // expr_arguments case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.copy< ast::expr_arguments::ptr > (YY_MOVE (that.value)); + value.copy< expr_arguments::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_array: // expr_array - value.copy< ast::expr_array::ptr > (YY_MOVE (that.value)); + value.copy< expr_array::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_call: // expr_call - value.copy< ast::expr_call::ptr > (YY_MOVE (that.value)); + value.copy< expr_call::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_complement: // expr_complement - value.copy< ast::expr_complement::ptr > (YY_MOVE (that.value)); + value.copy< expr_complement::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_empty_array: // expr_empty_array - value.copy< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); + value.copy< expr_empty_array::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_false: // expr_false - value.copy< ast::expr_false::ptr > (YY_MOVE (that.value)); + value.copy< expr_false::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_field: // expr_field - value.copy< ast::expr_field::ptr > (YY_MOVE (that.value)); + value.copy< expr_field::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_float: // expr_float - value.copy< ast::expr_float::ptr > (YY_MOVE (that.value)); + value.copy< expr_float::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_game: // expr_game - value.copy< ast::expr_game::ptr > (YY_MOVE (that.value)); + value.copy< expr_game::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_getdvar: // expr_getdvar - value.copy< ast::expr_getdvar::ptr > (YY_MOVE (that.value)); + value.copy< expr_getdvar::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_getdvarcoloralpha: // expr_getdvarcoloralpha - value.copy< ast::expr_getdvarcoloralpha::ptr > (YY_MOVE (that.value)); + value.copy< expr_getdvarcoloralpha::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_getdvarcolorblue: // expr_getdvarcolorblue - value.copy< ast::expr_getdvarcolorblue::ptr > (YY_MOVE (that.value)); + value.copy< expr_getdvarcolorblue::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_getdvarcolorgreen: // expr_getdvarcolorgreen - value.copy< ast::expr_getdvarcolorgreen::ptr > (YY_MOVE (that.value)); + value.copy< expr_getdvarcolorgreen::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_getdvarcolorred: // expr_getdvarcolorred - value.copy< ast::expr_getdvarcolorred::ptr > (YY_MOVE (that.value)); + value.copy< expr_getdvarcolorred::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_getdvarfloat: // expr_getdvarfloat - value.copy< ast::expr_getdvarfloat::ptr > (YY_MOVE (that.value)); + value.copy< expr_getdvarfloat::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_getdvarint: // expr_getdvarint - value.copy< ast::expr_getdvarint::ptr > (YY_MOVE (that.value)); + value.copy< expr_getdvarint::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_getdvarvector: // expr_getdvarvector - value.copy< ast::expr_getdvarvector::ptr > (YY_MOVE (that.value)); + value.copy< expr_getdvarvector::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_getfirstarraykey: // expr_getfirstarraykey - value.copy< ast::expr_getfirstarraykey::ptr > (YY_MOVE (that.value)); + value.copy< expr_getfirstarraykey::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_getnextarraykey: // expr_getnextarraykey - value.copy< ast::expr_getnextarraykey::ptr > (YY_MOVE (that.value)); + value.copy< expr_getnextarraykey::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_gettime: // expr_gettime - value.copy< ast::expr_gettime::ptr > (YY_MOVE (that.value)); + value.copy< expr_gettime::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_hash: // expr_hash - value.copy< ast::expr_hash::ptr > (YY_MOVE (that.value)); + value.copy< expr_hash::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize case symbol_kind::S_expr_identifier: // expr_identifier - value.copy< ast::expr_identifier::ptr > (YY_MOVE (that.value)); + value.copy< expr_identifier::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_integer: // expr_integer - value.copy< ast::expr_integer::ptr > (YY_MOVE (that.value)); + value.copy< expr_integer::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_isdefined: // expr_isdefined - value.copy< ast::expr_isdefined::ptr > (YY_MOVE (that.value)); + value.copy< expr_isdefined::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_istring: // expr_istring - value.copy< ast::expr_istring::ptr > (YY_MOVE (that.value)); + value.copy< expr_istring::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_level: // expr_level - value.copy< ast::expr_level::ptr > (YY_MOVE (that.value)); + value.copy< expr_level::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_method: // expr_method - value.copy< ast::expr_method::ptr > (YY_MOVE (that.value)); + value.copy< expr_method::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (YY_MOVE (that.value)); + value.copy< expr_negate::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (YY_MOVE (that.value)); + value.copy< expr_not::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_parameters: // expr_parameters - value.copy< ast::expr_parameters::ptr > (YY_MOVE (that.value)); + value.copy< expr_parameters::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_paren: // expr_paren - value.copy< ast::expr_paren::ptr > (YY_MOVE (that.value)); + value.copy< expr_paren::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_path: // expr_path - value.copy< ast::expr_path::ptr > (YY_MOVE (that.value)); + value.copy< expr_path::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_reference: // expr_reference - value.copy< ast::expr_reference::ptr > (YY_MOVE (that.value)); + value.copy< expr_reference::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_self: // expr_self - value.copy< ast::expr_self::ptr > (YY_MOVE (that.value)); + value.copy< expr_self::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_size: // expr_size - value.copy< ast::expr_size::ptr > (YY_MOVE (that.value)); + value.copy< expr_size::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_string: // expr_string - value.copy< ast::expr_string::ptr > (YY_MOVE (that.value)); + value.copy< expr_string::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_true: // expr_true - value.copy< ast::expr_true::ptr > (YY_MOVE (that.value)); + value.copy< expr_true::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_undefined: // expr_undefined - value.copy< ast::expr_undefined::ptr > (YY_MOVE (that.value)); + value.copy< expr_undefined::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_vector: // expr_vector - value.copy< ast::expr_vector::ptr > (YY_MOVE (that.value)); + value.copy< expr_vector::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_vectorscale: // expr_vectorscale - value.copy< ast::expr_vectorscale::ptr > (YY_MOVE (that.value)); + value.copy< expr_vectorscale::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_expr_vectortoangles: // expr_vectortoangles - value.copy< ast::expr_vectortoangles::ptr > (YY_MOVE (that.value)); + value.copy< expr_vectortoangles::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_include: // include - value.copy< ast::include::ptr > (YY_MOVE (that.value)); + value.copy< include::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_program: // program - value.copy< ast::program::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt: // stmt - case symbol_kind::S_stmt_or_dev: // stmt_or_dev - value.copy< ast::stmt > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_assign: // stmt_assign - value.copy< ast::stmt_assign::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_break: // stmt_break - value.copy< ast::stmt_break::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_call: // stmt_call - value.copy< ast::stmt_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_case: // stmt_case - value.copy< ast::stmt_case::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_const: // stmt_const - value.copy< ast::stmt_const::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_continue: // stmt_continue - value.copy< ast::stmt_continue::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_default: // stmt_default - value.copy< ast::stmt_default::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_dev: // stmt_dev - value.copy< ast::stmt_dev::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_dowhile: // stmt_dowhile - value.copy< ast::stmt_dowhile::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_endon: // stmt_endon - value.copy< ast::stmt_endon::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_expr: // stmt_expr - value.copy< ast::stmt_expr::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_for: // stmt_for - value.copy< ast::stmt_for::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_foreach: // stmt_foreach - value.copy< ast::stmt_foreach::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_if: // stmt_if - value.copy< ast::stmt_if::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_ifelse: // stmt_ifelse - value.copy< ast::stmt_ifelse::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_list: // stmt_list - case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list - case symbol_kind::S_stmt_block: // stmt_block - value.copy< ast::stmt_list::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_notify: // stmt_notify - value.copy< ast::stmt_notify::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin - value.copy< ast::stmt_prof_begin::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_prof_end: // stmt_prof_end - value.copy< ast::stmt_prof_end::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_return: // stmt_return - value.copy< ast::stmt_return::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_switch: // stmt_switch - value.copy< ast::stmt_switch::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_wait: // stmt_wait - value.copy< ast::stmt_wait::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.copy< ast::stmt_waittill::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.copy< ast::stmt_waittillframeend::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.copy< ast::stmt_waittillmatch::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.copy< ast::stmt_while::ptr > (YY_MOVE (that.value)); + value.copy< program::ptr > (YY_MOVE (that.value)); break; case symbol_kind::S_PATH: // "path" case symbol_kind::S_IDENTIFIER: // "identifier" case symbol_kind::S_STRING: // "string literal" case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_HASH: // "hash" + case symbol_kind::S_HASHSTR: // "hash string" case symbol_kind::S_FLOAT: // "float" case symbol_kind::S_INTEGER: // "integer" value.copy< std::string > (YY_MOVE (that.value)); break; + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_stmt_or_dev: // stmt_or_dev + value.copy< stmt::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.copy< stmt_break::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.copy< stmt_case::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_comp: // stmt_comp + value.copy< stmt_comp::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.copy< stmt_continue::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.copy< stmt_default::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_dev: // stmt_dev + value.copy< stmt_dev::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_dowhile: // stmt_dowhile + value.copy< stmt_dowhile::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.copy< stmt_endon::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_expr: // stmt_expr + case symbol_kind::S_stmt_call: // stmt_call + case symbol_kind::S_stmt_const: // stmt_const + case symbol_kind::S_stmt_assign: // stmt_assign + value.copy< stmt_expr::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.copy< stmt_for::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.copy< stmt_foreach::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.copy< stmt_if::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.copy< stmt_ifelse::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_list: // stmt_list + case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list + value.copy< stmt_list::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.copy< stmt_notify::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin + value.copy< stmt_prof_begin::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_prof_end: // stmt_prof_end + value.copy< stmt_prof_end::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.copy< stmt_return::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.copy< stmt_switch::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.copy< stmt_wait::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.copy< stmt_waittill::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.copy< stmt_waittillframeend::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.copy< stmt_waittillmatch::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.copy< stmt_while::ptr > (YY_MOVE (that.value)); + break; + default: break; } @@ -5986,361 +5853,355 @@ switch (yykind) { case symbol_kind::S_expr_function: // expr_function case symbol_kind::S_expr_pointer: // expr_pointer - value.move< ast::call > (YY_MOVE (s.value)); + value.move< call::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_declaration: // declaration - value.move< ast::decl > (YY_MOVE (s.value)); + value.move< decl::ptr > (YY_MOVE (s.value)); break; - case symbol_kind::S_decl_thread: // decl_thread - value.move< ast::decl_thread::ptr > (YY_MOVE (s.value)); + case symbol_kind::S_decl_function: // decl_function + value.move< decl_function::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_decl_usingtree: // decl_usingtree - value.move< ast::decl_usingtree::ptr > (YY_MOVE (s.value)); + value.move< decl_usingtree::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr: // expr case symbol_kind::S_expr_or_empty: // expr_or_empty - case symbol_kind::S_expr_assign: // expr_assign case symbol_kind::S_expr_increment: // expr_increment case symbol_kind::S_expr_decrement: // expr_decrement + case symbol_kind::S_expr_assign: // expr_assign case symbol_kind::S_expr_ternary: // expr_ternary case symbol_kind::S_expr_binary: // expr_binary case symbol_kind::S_expr_primitive: // expr_primitive case symbol_kind::S_expr_parameters_default: // expr_parameters_default case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (s.value)); + value.move< expr::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_abs: // expr_abs - value.move< ast::expr_abs::ptr > (YY_MOVE (s.value)); + value.move< expr_abs::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_angleclamp180: // expr_angleclamp180 - value.move< ast::expr_angleclamp180::ptr > (YY_MOVE (s.value)); + value.move< expr_angleclamp180::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_anglestoforward: // expr_anglestoforward - value.move< ast::expr_anglestoforward::ptr > (YY_MOVE (s.value)); + value.move< expr_anglestoforward::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_anglestoright: // expr_anglestoright - value.move< ast::expr_anglestoright::ptr > (YY_MOVE (s.value)); + value.move< expr_anglestoright::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_anglestoup: // expr_anglestoup - value.move< ast::expr_anglestoup::ptr > (YY_MOVE (s.value)); + value.move< expr_anglestoup::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (YY_MOVE (s.value)); + value.move< expr_anim::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (YY_MOVE (s.value)); + value.move< expr_animation::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (s.value)); + value.move< expr_animtree::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_arguments: // expr_arguments case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (s.value)); + value.move< expr_arguments::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (YY_MOVE (s.value)); + value.move< expr_array::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (YY_MOVE (s.value)); + value.move< expr_call::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (YY_MOVE (s.value)); + value.move< expr_complement::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (YY_MOVE (s.value)); + value.move< expr_empty_array::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (YY_MOVE (s.value)); + value.move< expr_false::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (YY_MOVE (s.value)); + value.move< expr_field::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (YY_MOVE (s.value)); + value.move< expr_float::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (YY_MOVE (s.value)); + value.move< expr_game::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_getdvar: // expr_getdvar - value.move< ast::expr_getdvar::ptr > (YY_MOVE (s.value)); + value.move< expr_getdvar::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_getdvarcoloralpha: // expr_getdvarcoloralpha - value.move< ast::expr_getdvarcoloralpha::ptr > (YY_MOVE (s.value)); + value.move< expr_getdvarcoloralpha::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_getdvarcolorblue: // expr_getdvarcolorblue - value.move< ast::expr_getdvarcolorblue::ptr > (YY_MOVE (s.value)); + value.move< expr_getdvarcolorblue::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_getdvarcolorgreen: // expr_getdvarcolorgreen - value.move< ast::expr_getdvarcolorgreen::ptr > (YY_MOVE (s.value)); + value.move< expr_getdvarcolorgreen::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_getdvarcolorred: // expr_getdvarcolorred - value.move< ast::expr_getdvarcolorred::ptr > (YY_MOVE (s.value)); + value.move< expr_getdvarcolorred::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_getdvarfloat: // expr_getdvarfloat - value.move< ast::expr_getdvarfloat::ptr > (YY_MOVE (s.value)); + value.move< expr_getdvarfloat::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_getdvarint: // expr_getdvarint - value.move< ast::expr_getdvarint::ptr > (YY_MOVE (s.value)); + value.move< expr_getdvarint::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_getdvarvector: // expr_getdvarvector - value.move< ast::expr_getdvarvector::ptr > (YY_MOVE (s.value)); + value.move< expr_getdvarvector::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_getfirstarraykey: // expr_getfirstarraykey - value.move< ast::expr_getfirstarraykey::ptr > (YY_MOVE (s.value)); + value.move< expr_getfirstarraykey::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_getnextarraykey: // expr_getnextarraykey - value.move< ast::expr_getnextarraykey::ptr > (YY_MOVE (s.value)); + value.move< expr_getnextarraykey::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_gettime: // expr_gettime - value.move< ast::expr_gettime::ptr > (YY_MOVE (s.value)); + value.move< expr_gettime::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_hash: // expr_hash - value.move< ast::expr_hash::ptr > (YY_MOVE (s.value)); + value.move< expr_hash::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (YY_MOVE (s.value)); + value.move< expr_identifier::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (YY_MOVE (s.value)); + value.move< expr_integer::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_isdefined: // expr_isdefined - value.move< ast::expr_isdefined::ptr > (YY_MOVE (s.value)); + value.move< expr_isdefined::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (YY_MOVE (s.value)); + value.move< expr_istring::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (YY_MOVE (s.value)); + value.move< expr_level::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (YY_MOVE (s.value)); + value.move< expr_method::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (s.value)); + value.move< expr_negate::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (s.value)); + value.move< expr_not::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (YY_MOVE (s.value)); + value.move< expr_parameters::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (YY_MOVE (s.value)); + value.move< expr_paren::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (YY_MOVE (s.value)); + value.move< expr_path::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (YY_MOVE (s.value)); + value.move< expr_reference::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (YY_MOVE (s.value)); + value.move< expr_self::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (YY_MOVE (s.value)); + value.move< expr_size::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (YY_MOVE (s.value)); + value.move< expr_string::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_true: // expr_true - value.move< ast::expr_true::ptr > (YY_MOVE (s.value)); + value.move< expr_true::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_undefined: // expr_undefined - value.move< ast::expr_undefined::ptr > (YY_MOVE (s.value)); + value.move< expr_undefined::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_vector: // expr_vector - value.move< ast::expr_vector::ptr > (YY_MOVE (s.value)); + value.move< expr_vector::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_vectorscale: // expr_vectorscale - value.move< ast::expr_vectorscale::ptr > (YY_MOVE (s.value)); + value.move< expr_vectorscale::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_expr_vectortoangles: // expr_vectortoangles - value.move< ast::expr_vectortoangles::ptr > (YY_MOVE (s.value)); + value.move< expr_vectortoangles::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_include: // include - value.move< ast::include::ptr > (YY_MOVE (s.value)); + value.move< include::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_program: // program - value.move< ast::program::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt: // stmt - case symbol_kind::S_stmt_or_dev: // stmt_or_dev - value.move< ast::stmt > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_assign: // stmt_assign - value.move< ast::stmt_assign::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_break: // stmt_break - value.move< ast::stmt_break::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_call: // stmt_call - value.move< ast::stmt_call::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_case: // stmt_case - value.move< ast::stmt_case::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_const: // stmt_const - value.move< ast::stmt_const::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_continue: // stmt_continue - value.move< ast::stmt_continue::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_default: // stmt_default - value.move< ast::stmt_default::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_dev: // stmt_dev - value.move< ast::stmt_dev::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_dowhile: // stmt_dowhile - value.move< ast::stmt_dowhile::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_endon: // stmt_endon - value.move< ast::stmt_endon::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_expr: // stmt_expr - value.move< ast::stmt_expr::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_for: // stmt_for - value.move< ast::stmt_for::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_foreach: // stmt_foreach - value.move< ast::stmt_foreach::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_if: // stmt_if - value.move< ast::stmt_if::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_ifelse: // stmt_ifelse - value.move< ast::stmt_ifelse::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_list: // stmt_list - case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list - case symbol_kind::S_stmt_block: // stmt_block - value.move< ast::stmt_list::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_notify: // stmt_notify - value.move< ast::stmt_notify::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin - value.move< ast::stmt_prof_begin::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_prof_end: // stmt_prof_end - value.move< ast::stmt_prof_end::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_return: // stmt_return - value.move< ast::stmt_return::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_switch: // stmt_switch - value.move< ast::stmt_switch::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_wait: // stmt_wait - value.move< ast::stmt_wait::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.move< ast::stmt_waittill::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.move< ast::stmt_waittillframeend::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.move< ast::stmt_waittillmatch::ptr > (YY_MOVE (s.value)); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.move< ast::stmt_while::ptr > (YY_MOVE (s.value)); + value.move< program::ptr > (YY_MOVE (s.value)); break; case symbol_kind::S_PATH: // "path" case symbol_kind::S_IDENTIFIER: // "identifier" case symbol_kind::S_STRING: // "string literal" case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_HASH: // "hash" + case symbol_kind::S_HASHSTR: // "hash string" case symbol_kind::S_FLOAT: // "float" case symbol_kind::S_INTEGER: // "integer" value.move< std::string > (YY_MOVE (s.value)); break; + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_stmt_or_dev: // stmt_or_dev + value.move< stmt::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_comp: // stmt_comp + value.move< stmt_comp::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_dev: // stmt_dev + value.move< stmt_dev::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_dowhile: // stmt_dowhile + value.move< stmt_dowhile::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_expr: // stmt_expr + case symbol_kind::S_stmt_call: // stmt_call + case symbol_kind::S_stmt_const: // stmt_const + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_expr::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_list: // stmt_list + case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list + value.move< stmt_list::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin + value.move< stmt_prof_begin::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_prof_end: // stmt_prof_end + value.move< stmt_prof_end::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while::ptr > (YY_MOVE (s.value)); + break; + default: break; } @@ -6407,10 +6268,10 @@ switch (yykind) #line 13 "parser.ypp" -} } } // xsk::arc::t6 -#line 6412 "parser.hpp" +} } // xsk::arc +#line 6273 "parser.hpp" -#endif // !YY_T6_PARSER_HPP_INCLUDED +#endif // !YY_ARC_PARSER_HPP_INCLUDED diff --git a/include/xsk/arc/preprocessor.hpp b/include/xsk/arc/preprocessor.hpp new file mode 100644 index 00000000..f743f5a4 --- /dev/null +++ b/include/xsk/arc/preprocessor.hpp @@ -0,0 +1,91 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#pragma once + +#include "xsk/arc/common/types.hpp" +#include "xsk/arc/lexer.hpp" + +namespace xsk::arc +{ + +class preprocessor +{ + context* ctx_; + std::stack lexer_; + std::stack indents_; + std::vector includes_; + std::unordered_map directives_; + std::unordered_map defines_; + std::set reject_; + std::deque tokens_; + std::vector expr_; + std::string date_; + std::string time_; + usize curr_expr_; + u32 expand_; + u32 skip_; + +public: + preprocessor(context* ctx, std::string const& name, char const* data, usize size); + auto process() -> token; + auto push_header(std::string const& file) -> void; + auto pop_header() -> void; + auto ban_header(location const& loc) -> void; + +private: + auto skip_line() -> void; + auto next_token() -> token; + auto read_token() -> token; + auto read_directive(token& tok) -> void; + auto read_directive_if(token& tok) -> void; + auto read_directive_ifdef(token& tok) -> void; + auto read_directive_ifndef(token& tok) -> void; + auto read_directive_elif(token& tok) -> void; + auto read_directive_elifdef(token& tok) -> void; + auto read_directive_elifndef(token& tok) -> void; + auto read_directive_else(token& tok) -> void; + auto read_directive_endif(token& tok) -> void; + auto read_directive_define(token& tok) -> void; + auto read_directive_undef(token& tok) -> void; + auto read_directive_pragma(token& tok) -> void; + auto read_directive_warning(token& tok) -> void; + auto read_directive_error(token& tok) -> void; + auto read_directive_line(token& tok) -> void; + auto read_directive_include(token& hash, token& name) -> void; + auto read_directive_inline(token& hash, token& name) -> void; + auto read_directive_usingtree(token& hash, token& name) -> void; + auto read_hashtoken(token& hash) -> void; + auto read_hashtoken_animtree(token& hash, token& name) -> void; + auto expand(token& tok, define& def) -> void; + auto expand_params(token& tok, define& def) -> std::vector>; + auto expect(token& tok, token::kind expected, spacing space = spacing::none) -> void; + auto evaluate() -> bool; + auto eval_next() -> token&; + auto eval_peek() -> token&; + auto eval_prev() -> token&; + auto eval_atend() -> bool; + auto eval_check(token::kind type) -> bool; + auto eval_match(token::kind type) -> bool; + auto eval_consume(token::kind type, std::string_view msg); + auto eval_expr() -> i32; + auto eval_expr_or() -> i32; + auto eval_expr_and() -> i32; + auto eval_expr_bwor() -> i32; + auto eval_expr_bwexor() -> i32; + auto eval_expr_bwand() -> i32; + auto eval_expr_eq() -> i32; + auto eval_expr_lge() -> i32; + auto eval_expr_shift() -> i32; + auto eval_expr_add() -> i32; + auto eval_expr_factor() -> i32; + auto eval_expr_unary() -> i32; + auto eval_expr_primary() -> i32; + auto get_local_time(std::tm& ltime) -> void; + auto get_date_define(std::tm* time_p) -> void; + auto get_time_define(std::tm* time_p) -> void; +}; + +} // namespace xsk::arc diff --git a/include/xsk/arc/source.hpp b/include/xsk/arc/source.hpp index 3d3bfbbe..204e3eda 100644 --- a/include/xsk/arc/source.hpp +++ b/include/xsk/arc/source.hpp @@ -5,7 +5,7 @@ #pragma once -#include "common/types.hpp" +#include "xsk/arc/common/types.hpp" namespace xsk::arc { @@ -18,6 +18,12 @@ class source public: source(context* ctx); + auto parse_assembly(buffer const& data) -> assembly::ptr; + auto parse_assembly(std::vector const& data) -> assembly::ptr; + auto parse_assembly(u8 const* data, usize size) -> assembly::ptr; + auto parse_program(std::string const& name, buffer const& data) -> program::ptr; + auto parse_program(std::string const& name, std::vector const& data) -> program::ptr; + auto parse_program(std::string const& name, u8 const* data, usize size) -> program::ptr; auto dump(assembly const& data) -> std::vector; auto dump(program const& data) -> std::vector; @@ -33,21 +39,20 @@ private: auto dump_decl_namespace(decl_namespace const& dec) -> void; auto dump_decl_usingtree(decl_usingtree const& dec) -> void; auto dump_decl_function(decl_function const& dec) -> void; + auto dump_decl_empty(decl_empty const& dec) -> void; auto dump_stmt(stmt const& stm) -> void; + auto dump_stmt_empty(stmt_empty const& stm) -> void; auto dump_stmt_list(stmt_list const& stm) -> void; auto dump_stmt_comp(stmt_comp const& stm) -> void; auto dump_stmt_dev(stmt_dev const& stm) -> void; auto dump_stmt_expr(stmt_expr const& stm) -> void; - auto dump_stmt_call(stmt_call const& stm) -> void; - auto dump_stmt_const(stmt_const const& stm) -> void; - auto dump_stmt_assign(stmt_assign const& stm) -> void; auto dump_stmt_endon(stmt_endon const& stm) -> void; auto dump_stmt_notify(stmt_notify const& stm) -> void; - auto dump_stmt_realwait(stmt_realwait const& stm) -> void; auto dump_stmt_wait(stmt_wait const& stm) -> void; auto dump_stmt_waittill(stmt_waittill const& stm) -> void; auto dump_stmt_waittillmatch(stmt_waittillmatch const& stm) -> void; auto dump_stmt_waittillframeend(stmt_waittillframeend const& stm) -> void; + auto dump_stmt_waitrealtime(stmt_waitrealtime const& stm) -> void; auto dump_stmt_if(stmt_if const& stm) -> void; auto dump_stmt_ifelse(stmt_ifelse const& stm) -> void; auto dump_stmt_while(stmt_while const& stm) -> void; @@ -63,41 +68,21 @@ private: auto dump_stmt_breakpoint(stmt_breakpoint const& stm) -> void; auto dump_stmt_prof_begin(stmt_prof_begin const& stm) -> void; auto dump_stmt_prof_end(stmt_prof_end const& stm) -> void; + auto dump_stmt_jmp(stmt_jmp const& stm) -> void; + auto dump_stmt_jmp_back(stmt_jmp_back const& stm) -> void; + auto dump_stmt_jmp_cond(stmt_jmp_cond const& stm) -> void; + auto dump_stmt_jmp_true(stmt_jmp_true const& stm) -> void; + auto dump_stmt_jmp_false(stmt_jmp_false const& stm) -> void; + auto dump_stmt_jmp_switch(stmt_jmp_switch const& stm) -> void; + auto dump_stmt_jmp_endswitch(stmt_jmp_endswitch const& stm) -> void; + auto dump_stmt_jmp_dev(stmt_jmp_dev const& stm) -> void; auto dump_expr(expr const& exp) -> void; auto dump_expr_increment(expr_increment const& exp) -> void; auto dump_expr_decrement(expr_decrement const& exp) -> void; - auto dump_expr_assign_equal(expr_assign_equal const& exp) -> void; - auto dump_expr_assign_add(expr_assign_add const& exp) -> void; - auto dump_expr_assign_sub(expr_assign_sub const& exp) -> void; - auto dump_expr_assign_mul(expr_assign_mul const& exp) -> void; - auto dump_expr_assign_div(expr_assign_div const& exp) -> void; - auto dump_expr_assign_mod(expr_assign_mod const& exp) -> void; - auto dump_expr_assign_shift_left(expr_assign_shift_left const& exp) -> void; - auto dump_expr_assign_shift_right(expr_assign_shift_right const& exp) -> void; - auto dump_expr_assign_bitwise_or(expr_assign_bitwise_or const& exp) -> void; - auto dump_expr_assign_bitwise_and(expr_assign_bitwise_and const& exp) -> void; - auto dump_expr_assign_bitwise_exor(expr_assign_bitwise_exor const& exp) -> void; + auto dump_expr_assign(expr_assign const& exp) -> void; + auto dump_expr_const(expr_const const& exp) -> void; auto dump_expr_ternary(expr_ternary const& exp) -> void; - auto dump_expr_or(expr_or const& exp) -> void; - auto dump_expr_and(expr_and const& exp) -> void; - auto dump_expr_super_equal(expr_super_equal const& exp) -> void; - auto dump_expr_super_not_equal(expr_super_not_equal const& exp) -> void; - auto dump_expr_equality(expr_equality const& exp) -> void; - auto dump_expr_inequality(expr_inequality const& exp) -> void; - auto dump_expr_less_equal(expr_less_equal const& exp) -> void; - auto dump_expr_greater_equal(expr_greater_equal const& exp) -> void; - auto dump_expr_less(expr_less const& exp) -> void; - auto dump_expr_greater(expr_greater const& exp) -> void; - auto dump_expr_add(expr_add const& exp) -> void; - auto dump_expr_sub(expr_sub const& exp) -> void; - auto dump_expr_mul(expr_mul const& exp) -> void; - auto dump_expr_div(expr_div const& exp) -> void; - auto dump_expr_mod(expr_mod const& exp) -> void; - auto dump_expr_shift_left(expr_shift_left const& exp) -> void; - auto dump_expr_shift_right(expr_shift_right const& exp) -> void; - auto dump_expr_bitwise_or(expr_bitwise_or const& exp) -> void; - auto dump_expr_bitwise_and(expr_bitwise_and const& exp) -> void; - auto dump_expr_bitwise_exor(expr_bitwise_exor const& exp) -> void; + auto dump_expr_binary(expr_binary const& exp) -> void; auto dump_expr_not(expr_not const& exp) -> void; auto dump_expr_negate(expr_negate const& exp) -> void; auto dump_expr_complement(expr_complement const& exp) -> void; @@ -134,6 +119,7 @@ private: auto dump_expr_field(expr_field const& exp) -> void; auto dump_expr_size(expr_size const& exp) -> void; auto dump_expr_paren(expr_paren const& exp) -> void; + auto dump_expr_ellipsis(expr_ellipsis const& exp) -> void; auto dump_expr_empty_array(expr_empty_array const& exp) -> void; auto dump_expr_undefined(expr_undefined const& exp) -> void; auto dump_expr_game(expr_game const& exp) -> void; @@ -154,17 +140,6 @@ private: auto dump_expr_integer(expr_integer const& exp) -> void; auto dump_expr_false(expr_false const& exp) -> void; auto dump_expr_true(expr_true const& exp) -> void; - auto dump_asm_loc(asm_loc const& exp) -> void; - auto dump_asm_jmp(asm_jmp const& exp) -> void; - auto dump_asm_jmp_back(asm_jmp_back const& exp) -> void; - auto dump_asm_jmp_cond(asm_jmp_cond const& exp) -> void; - auto dump_asm_jmp_true(asm_jmp_true const& exp) -> void; - auto dump_asm_jmp_false(asm_jmp_false const& exp) -> void; - auto dump_asm_switch(asm_switch const& exp) -> void; - auto dump_asm_endswitch(asm_endswitch const& exp) -> void; - auto dump_asm_prescriptcall(asm_prescriptcall const& exp) -> void; - auto dump_asm_voidcodepos(asm_voidcodepos const& exp) -> void; - auto dump_asm_dev(asm_dev const& exp) -> void; }; } // namespace xsk::arc diff --git a/include/xsk/gsc/assembler.hpp b/include/xsk/gsc/assembler.hpp index 527e0330..98fa1613 100644 --- a/include/xsk/gsc/assembler.hpp +++ b/include/xsk/gsc/assembler.hpp @@ -6,7 +6,7 @@ #pragma once #include "xsk/utils/writer.hpp" -#include "common/types.hpp" +#include "xsk/gsc/common/types.hpp" namespace xsk::gsc { diff --git a/include/xsk/gsc/common/assembly.hpp b/include/xsk/gsc/common/assembly.hpp index 34f6ba41..e4dd6df1 100644 --- a/include/xsk/gsc/common/assembly.hpp +++ b/include/xsk/gsc/common/assembly.hpp @@ -228,6 +228,11 @@ struct instruction u32 size; opcode opcode; std::vector data; + + static auto make() -> instruction::ptr + { + return std::unique_ptr(new instruction); + } }; struct function @@ -240,6 +245,11 @@ struct function std::string name; std::vector instructions; std::unordered_map labels; + + static auto make() -> function::ptr + { + return std::unique_ptr(new function); + } }; struct assembly @@ -247,21 +257,11 @@ struct assembly using ptr = std::unique_ptr; std::vector functions; + + static auto make() -> assembly::ptr + { + return std::unique_ptr(new assembly); + } }; -inline auto make_instruction() -> std::unique_ptr -{ - return std::unique_ptr(new instruction); -} - -inline auto make_function() -> std::unique_ptr -{ - return std::unique_ptr(new function); -} - -inline auto make_assembly() -> std::unique_ptr -{ - return std::unique_ptr(new assembly); -} - } // namespace xsk::gsc diff --git a/include/xsk/gsc/common/types.hpp b/include/xsk/gsc/common/types.hpp index 90cf69fd..32fe5376 100644 --- a/include/xsk/gsc/common/types.hpp +++ b/include/xsk/gsc/common/types.hpp @@ -5,18 +5,18 @@ #pragma once -#include "asset.hpp" -#include "scope.hpp" -#include "buffer.hpp" -#include "assembly.hpp" -#include "location.hpp" -#include "exception.hpp" -#include "lookahead.hpp" -#include "directive.hpp" -#include "space.hpp" -#include "token.hpp" -#include "define.hpp" -#include "ast.hpp" +#include "xsk/gsc/common/asset.hpp" +#include "xsk/gsc/common/scope.hpp" +#include "xsk/gsc/common/buffer.hpp" +#include "xsk/gsc/common/assembly.hpp" +#include "xsk/gsc/common/location.hpp" +#include "xsk/gsc/common/exception.hpp" +#include "xsk/gsc/common/lookahead.hpp" +#include "xsk/gsc/common/directive.hpp" +#include "xsk/gsc/common/space.hpp" +#include "xsk/gsc/common/token.hpp" +#include "xsk/gsc/common/define.hpp" +#include "xsk/gsc/common/ast.hpp" namespace xsk::gsc { diff --git a/include/xsk/gsc/compiler.hpp b/include/xsk/gsc/compiler.hpp index 7f4ad252..19eb0726 100644 --- a/include/xsk/gsc/compiler.hpp +++ b/include/xsk/gsc/compiler.hpp @@ -5,7 +5,7 @@ #pragma once -#include "common/types.hpp" +#include "xsk/gsc/common/types.hpp" namespace xsk::gsc { @@ -15,8 +15,8 @@ class compiler context* ctx_; assembly::ptr assembly_; function::ptr function_; - std::vector stackframe_; std::vector localfuncs_; + std::vector stackframe_; std::unordered_map constants_; std::unordered_map scopes_; std::vector break_blks_; diff --git a/include/xsk/gsc/context.hpp b/include/xsk/gsc/context.hpp index 954ccbf3..e1c525ba 100644 --- a/include/xsk/gsc/context.hpp +++ b/include/xsk/gsc/context.hpp @@ -5,12 +5,12 @@ #pragma once -#include "common/types.hpp" -#include "source.hpp" -#include "assembler.hpp" -#include "disassembler.hpp" -#include "compiler.hpp" -#include "decompiler.hpp" +#include "xsk/gsc/common/types.hpp" +#include "xsk/gsc/source.hpp" +#include "xsk/gsc/assembler.hpp" +#include "xsk/gsc/disassembler.hpp" +#include "xsk/gsc/compiler.hpp" +#include "xsk/gsc/decompiler.hpp" namespace xsk::gsc { diff --git a/include/xsk/gsc/decompiler.hpp b/include/xsk/gsc/decompiler.hpp index 92afd976..a19db7e2 100644 --- a/include/xsk/gsc/decompiler.hpp +++ b/include/xsk/gsc/decompiler.hpp @@ -5,7 +5,7 @@ #pragma once -#include "common/types.hpp" +#include "xsk/gsc/common/types.hpp" namespace xsk::gsc { diff --git a/include/xsk/gsc/disassembler.hpp b/include/xsk/gsc/disassembler.hpp index dd8b939c..e0336a59 100644 --- a/include/xsk/gsc/disassembler.hpp +++ b/include/xsk/gsc/disassembler.hpp @@ -6,7 +6,7 @@ #pragma once #include "xsk/utils/reader.hpp" -#include "common/types.hpp" +#include "xsk/gsc/common/types.hpp" namespace xsk::gsc { diff --git a/include/xsk/gsc/lexer.hpp b/include/xsk/gsc/lexer.hpp index 8c877fd1..2012d58c 100644 --- a/include/xsk/gsc/lexer.hpp +++ b/include/xsk/gsc/lexer.hpp @@ -5,7 +5,7 @@ #pragma once -#include "common/types.hpp" +#include "xsk/gsc/common/types.hpp" namespace xsk::gsc { diff --git a/include/xsk/gsc/preprocessor.hpp b/include/xsk/gsc/preprocessor.hpp index 1a4fa8e2..527d3821 100644 --- a/include/xsk/gsc/preprocessor.hpp +++ b/include/xsk/gsc/preprocessor.hpp @@ -5,8 +5,8 @@ #pragma once -#include "common/types.hpp" -#include "lexer.hpp" +#include "xsk/gsc/common/types.hpp" +#include "xsk/gsc/lexer.hpp" namespace xsk::gsc { diff --git a/include/xsk/gsc/source.hpp b/include/xsk/gsc/source.hpp index c749ffe4..500e20e1 100644 --- a/include/xsk/gsc/source.hpp +++ b/include/xsk/gsc/source.hpp @@ -5,7 +5,7 @@ #pragma once -#include "common/types.hpp" +#include "xsk/gsc/common/types.hpp" namespace xsk::gsc { diff --git a/include/xsk/stdinc.hpp b/include/xsk/stdinc.hpp index 797a1376..a021f8d7 100644 --- a/include/xsk/stdinc.hpp +++ b/include/xsk/stdinc.hpp @@ -62,4 +62,4 @@ using i64 = std::int64_t; using f32 = float; using f64 = double; -}; +} // namespace xsk diff --git a/include/xsk/t6/assembler.hpp b/include/xsk/t6/assembler.hpp deleted file mode 100644 index d7ed3c3c..00000000 --- a/include/xsk/t6/assembler.hpp +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#pragma once - -namespace xsk::arc::t6 -{ - -class assembler : public arc::assembler -{ - std::string filename_; - utils::writer::ptr script_; - assembly::ptr assembly_; - std::unordered_map labels_; - std::unordered_map stringlist_; - std::vector exports_; - std::vector imports_; - std::vector animtrees_; - std::vector stringtables_; - header header_; - -public: - auto output() -> std::vector; - void assemble(const std::string& file, std::vector& data); - void assemble(const std::string& file, assembly::ptr& data); - -private: - void assemble_function(const function::ptr& func); - void assemble_instruction(const instruction::ptr& inst); - void assemble_localvars(const instruction::ptr& inst); - void assemble_jump(const instruction::ptr& inst); - void assemble_switch(const instruction::ptr& inst); - void assemble_end_switch(const instruction::ptr& inst); - void process_string(const std::string& data); - void process_function(const function::ptr& func); - void process_instruction(const instruction::ptr& inst); - void align_instruction(const instruction::ptr& inst); - auto resolve_label(const std::string& name) -> std::int32_t; - auto string_offset(const std::string& data) -> std::uint16_t; - void add_string_reference(const std::string& str, string_type type, std::uint32_t ref); - void add_import_reference(const std::vector& data, std::uint32_t ref); - void add_anim_reference(const std::vector& data, std::uint32_t ref); -}; - -} // namespace xsk::arc::t6 diff --git a/include/xsk/t6/common/arc.hpp b/include/xsk/t6/common/arc.hpp deleted file mode 100644 index 8d0a3d59..00000000 --- a/include/xsk/t6/common/arc.hpp +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#pragma once - -#include "location.hpp" -#include "types.hpp" -#include "block.hpp" -#include "nodetree.hpp" - -#include "interfaces/exception.hpp" -#include "interfaces/assembler.hpp" -#include "interfaces/disassembler.hpp" -#include "interfaces/compiler.hpp" -#include "interfaces/decompiler.hpp" -#include "interfaces/context.hpp" diff --git a/include/xsk/t6/common/block.hpp b/include/xsk/t6/common/block.hpp deleted file mode 100644 index 2143f7eb..00000000 --- a/include/xsk/t6/common/block.hpp +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#pragma once - -namespace xsk::arc -{ - -struct block -{ - using ptr = std::unique_ptr; - - std::string loc_end; - std::string loc_break; - std::string loc_continue; - abort_t abort; - bool is_dev; - - block() : abort(abort_t::abort_none), is_dev(false) {} - block(const std::string& lbreak, const std::string& lcont) : loc_break(lbreak), loc_continue(lcont), abort(abort_t::abort_none), is_dev(false) {} -}; - -} // namespace xsk::arc diff --git a/include/xsk/t6/common/interfaces/assembler.hpp b/include/xsk/t6/common/interfaces/assembler.hpp deleted file mode 100644 index a16f7b93..00000000 --- a/include/xsk/t6/common/interfaces/assembler.hpp +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#pragma once - -namespace xsk::arc -{ - -class assembler -{ -public: - using ptr = std::unique_ptr; - - virtual ~assembler() = default; - virtual auto output() -> std::vector = 0; - virtual void assemble(const std::string& file, std::vector& data) = 0; - virtual void assemble(const std::string& file, assembly::ptr& data) = 0; -}; - -} // namespace xsk::arc diff --git a/include/xsk/t6/common/interfaces/compiler.hpp b/include/xsk/t6/common/interfaces/compiler.hpp deleted file mode 100644 index 8360bcc4..00000000 --- a/include/xsk/t6/common/interfaces/compiler.hpp +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#pragma once - -namespace xsk::arc -{ - -class compiler -{ -public: - using ptr = std::unique_ptr; - - virtual ~compiler() = default; - virtual auto output() -> assembly::ptr = 0; - virtual auto output_raw() -> std::vector = 0; - virtual void compile(const std::string& file, std::vector& data) = 0; -}; - -} // namespace xsk::arc diff --git a/include/xsk/t6/common/interfaces/context.hpp b/include/xsk/t6/common/interfaces/context.hpp deleted file mode 100644 index 3981ca13..00000000 --- a/include/xsk/t6/common/interfaces/context.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#pragma once - -namespace xsk::arc -{ - -class context -{ -public: - using ptr = std::unique_ptr; - - virtual ~context() = default; - virtual void init(build mode, read_cb_type callback) = 0; - virtual void cleanup() = 0; - - virtual auto assembler() -> assembler& = 0; - virtual auto disassembler() -> disassembler& = 0; - virtual auto compiler() -> compiler& = 0; - virtual auto decompiler() -> decompiler& = 0; -}; - -} // namespace xsk::arc diff --git a/include/xsk/t6/common/interfaces/decompiler.hpp b/include/xsk/t6/common/interfaces/decompiler.hpp deleted file mode 100644 index 777884b0..00000000 --- a/include/xsk/t6/common/interfaces/decompiler.hpp +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#pragma once - -namespace xsk::arc -{ - -class decompiler -{ -public: - using ptr = std::unique_ptr; - - virtual ~decompiler() = default; - virtual auto output() -> std::vector = 0; - virtual void decompile(const std::string& file, const assembly::ptr& data) = 0; -}; - -} // namespace xsk::arc diff --git a/include/xsk/t6/common/interfaces/disassembler.hpp b/include/xsk/t6/common/interfaces/disassembler.hpp deleted file mode 100644 index d8b8ccc1..00000000 --- a/include/xsk/t6/common/interfaces/disassembler.hpp +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#pragma once - -namespace xsk::arc -{ - -class disassembler -{ -public: - using ptr = std::unique_ptr; - - virtual ~disassembler() = default; - virtual auto output() -> assembly::ptr = 0; - virtual auto output_raw() -> std::vector = 0; - virtual void disassemble(const std::string& file, std::vector& data) = 0; -}; - -} // namespace xsk::arc diff --git a/include/xsk/t6/common/interfaces/exception.hpp b/include/xsk/t6/common/interfaces/exception.hpp deleted file mode 100644 index 4329d3b9..00000000 --- a/include/xsk/t6/common/interfaces/exception.hpp +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#pragma once - -namespace xsk::arc -{ - -class error : public std::runtime_error -{ -public: - error(const std::string& what) - : std::runtime_error("[ERROR]: "s + what) {} -}; - -class asm_error : public std::runtime_error -{ -public: - asm_error(const std::string& what) - : std::runtime_error("[ERROR]:assembler: "s + what) {} -}; - -class disasm_error : public std::runtime_error -{ -public: - disasm_error(const std::string& what) - : std::runtime_error("[ERROR]:disassembler: "s + what) {} -}; - -class comp_error : public std::runtime_error -{ -public: - comp_error(const location& loc, const std::string& what) - : std::runtime_error("[ERROR]:compiler:" + loc.print() + ": " + what) {} -}; - -class decomp_error : public std::runtime_error -{ -public: - decomp_error(const std::string& what) - : std::runtime_error("[ERROR]:decompiler: "s + what) {} -}; - -} // namespace xsk::arc diff --git a/include/xsk/t6/common/location.hpp b/include/xsk/t6/common/location.hpp deleted file mode 100644 index d16ba4ea..00000000 --- a/include/xsk/t6/common/location.hpp +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#pragma once - -namespace xsk::arc -{ - -/// A point in a source file. -class position -{ -public: - /// Type for file name. - typedef const std::string filename_type; - /// Type for line and column numbers. - typedef int counter_type; - - /// Construct a position. - explicit position(filename_type *f = nullptr, counter_type l = 1, counter_type c = 1) - : filename(f), line(l), column(c) {} - - /// Initialization. - void initialize(filename_type *fn = nullptr, counter_type l = 1, counter_type c = 1) - { - filename = fn; - line = l; - column = c; - } - - /** \name Line and Column related manipulators - ** \{ */ - /// (line related) Advance to the COUNT next lines. - void lines(counter_type count = 1) - { - if (count) - { - column = 1; - line = add_(line, count, 1); - } - } - - /// (column related) Advance to the COUNT next columns. - void columns(counter_type count = 1) - { - column = add_(column, count, 1); - } - /** \} */ - - /// File name to which this position refers. - filename_type *filename; - /// Current line number. - counter_type line; - /// Current column number. - counter_type column; - -private: - /// Compute max (min, lhs+rhs). - static counter_type add_(counter_type lhs, counter_type rhs, counter_type min) - { - return lhs + rhs < min ? min : lhs + rhs; - } -}; - -/// Add \a width columns, in place. -inline position& operator+=(position &res, position::counter_type width) -{ - res.columns(width); - return res; -} - -/// Add \a width columns. -inline position operator+(position res, position::counter_type width) -{ - return res += width; -} - -/// Subtract \a width columns, in place. -inline position& operator-=(position &res, position::counter_type width) -{ - return res += -width; -} - -/// Subtract \a width columns. -inline position operator-(position res, position::counter_type width) -{ - return res -= width; -} - -/** \brief Intercept output stream redirection. - ** \param ostr the destination output stream -** \param pos a reference to the position to redirect -*/ -template -std::basic_ostream& operator<<(std::basic_ostream &ostr, const position &pos) -{ - if (pos.filename) - ostr << *pos.filename << ':'; - return ostr << pos.line << '.' << pos.column; -} - -/// Two points in a source file. -class location -{ -public: - /// Type for file name. - typedef position::filename_type filename_type; - /// Type for line and column numbers. - typedef position::counter_type counter_type; - - /// Construct a location from \a b to \a e. - location(const position &b, const position &e) - : begin(b), end(e) {} - - /// Construct a 0-width location in \a p. - explicit location(const position &p = position()) - : begin(p), end(p) {} - - /// Construct a 0-width location in \a f, \a l, \a c. - explicit location(filename_type *f, counter_type l = 1, counter_type c = 1) - : begin(f, l, c), end(f, l, c) {} - - /// Initialization. - void initialize(filename_type *f = nullptr, counter_type l = 1, counter_type c = 1) - { - begin.initialize(f, l, c); - end = begin; - } - - /** \name Line and Column related manipulators - ** \{ */ -public: - /// Reset initial location to final location. - void step() - { - begin = end; - } - - /// Extend the current location to the COUNT next columns. - void columns(counter_type count = 1) - { - end += count; - } - - /// Extend the current location to the COUNT next lines. - void lines(counter_type count = 1) - { - end.lines(count); - } - /** \} */ - -public: - auto print() const -> std::string - { - return *begin.filename + ":" + std::to_string(begin.line) + ":" + std::to_string(begin.column); - } - - auto label() const -> std::string - { - return fmt::format("loc_{:X}", begin.line); - } - -public: - /// Beginning of the located region. - position begin; - /// End of the located region. - position end; -}; - -/// Join two locations, in place. -inline location& operator+=(location &res, const location &end) -{ - res.end = end.end; - return res; -} - -/// Join two locations. -inline location operator+(location res, const location &end) -{ - return res += end; -} - -/// Add \a width columns to the end position, in place. -inline location& operator+=(location &res, location::counter_type width) -{ - res.columns(width); - return res; -} - -/// Add \a width columns to the end position. -inline location operator+(location res, location::counter_type width) -{ - return res += width; -} - -/// Subtract \a width columns to the end position, in place. -inline location& operator-=(location &res, location::counter_type width) -{ - return res += -width; -} - -/// Subtract \a width columns to the end position. -inline location operator-(location res, location::counter_type width) -{ - return res -= width; -} - -/** \brief Intercept output stream redirection. - ** \param ostr the destination output stream -** \param loc a reference to the location to redirect -** -** Avoid duplicate information. -*/ -template -std::basic_ostream& operator<<(std::basic_ostream &ostr, const location &loc) -{ - location::counter_type end_col = 0 < loc.end.column ? loc.end.column - 1 : 0; - ostr << loc.begin; - if (loc.end.filename && (!loc.begin.filename || *loc.begin.filename != *loc.end.filename)) - ostr << '-' << loc.end.filename << ':' << loc.end.line << '.' << end_col; - else if (loc.begin.line < loc.end.line) - ostr << '-' << loc.end.line << '.' << end_col; - else if (loc.begin.column < end_col) - ostr << '-' << end_col; - return ostr; -} - -} // namespace xsk::arc diff --git a/include/xsk/t6/common/nodetree.hpp b/include/xsk/t6/common/nodetree.hpp deleted file mode 100644 index 50b56e2f..00000000 --- a/include/xsk/t6/common/nodetree.hpp +++ /dev/null @@ -1,1952 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#pragma once - -namespace xsk::arc::ast -{ - -enum class kind -{ - null, - expr_true, - expr_false, - expr_integer, - expr_float, - expr_vector, - expr_hash, - expr_string, - expr_istring, - expr_path, - expr_identifier, - expr_animtree, - expr_animation, - expr_level, - expr_anim, - expr_self, - expr_game, - expr_undefined, - expr_empty_array, - expr_paren, - expr_size, - expr_field, - expr_array, - expr_reference, - expr_getnextarraykey, - expr_getfirstarraykey, - expr_getdvarcoloralpha, - expr_getdvarcolorblue, - expr_getdvarcolorgreen, - expr_getdvarcolorred, - expr_getdvarvector, - expr_getdvarfloat, - expr_getdvarint, - expr_getdvar, - expr_gettime, - expr_abs, - expr_vectortoangles, - expr_angleclamp180, - expr_anglestoforward, - expr_anglestoright, - expr_anglestoup, - expr_vectorscale, - expr_isdefined, - expr_arguments, - expr_parameters, - expr_pointer, - expr_function, - expr_method, - expr_call, - expr_complement, - expr_negate, - expr_not, - expr_add, - expr_sub, - expr_mul, - expr_div, - expr_mod, - expr_shift_left, - expr_shift_right, - expr_bitwise_or, - expr_bitwise_and, - expr_bitwise_exor, - expr_equality, - expr_inequality, - expr_less_equal, - expr_greater_equal, - expr_less, - expr_greater, - expr_or, - expr_and, - expr_ternary, - expr_increment, - expr_decrement, - expr_assign_equal, - expr_assign_add, - expr_assign_sub, - expr_assign_mul, - expr_assign_div, - expr_assign_mod, - expr_assign_shift_left, - expr_assign_shift_right, - expr_assign_bitwise_or, - expr_assign_bitwise_and, - expr_assign_bitwise_exor, - stmt_list, - stmt_dev, - stmt_expr, - stmt_call, - stmt_const, - stmt_assign, - stmt_endon, - stmt_notify, - stmt_realwait, - stmt_wait, - stmt_waittill, - stmt_waittillmatch, - stmt_waittillframeend, - stmt_if, - stmt_ifelse, - stmt_while, - stmt_dowhile, - stmt_for, - stmt_foreach, - stmt_switch, - stmt_case, - stmt_default, - stmt_break, - stmt_continue, - stmt_return, - stmt_breakpoint, - stmt_prof_begin, - stmt_prof_end, - decl_thread, - decl_usingtree, - decl_dev_begin, - decl_dev_end, - include, - program, -// DECOMPILER - asm_loc, - asm_jump, - asm_jump_back, - asm_jump_cond, - asm_jump_true_expr, - asm_jump_false_expr, - asm_switch, - asm_endswitch, - asm_prescriptcall, - asm_voidcodepos, - asm_dev, -}; - -struct node; -struct expr_true; -struct expr_false; -struct expr_integer; -struct expr_float; -struct expr_vector; -struct expr_hash; -struct expr_string; -struct expr_istring; -struct expr_path; -struct expr_identifier; -struct expr_animtree; -struct expr_animation; -struct expr_level; -struct expr_anim; -struct expr_self; -struct expr_game; -struct expr_undefined; -struct expr_empty_array; -struct expr_paren; -struct expr_size; -struct expr_field; -struct expr_array; -struct expr_reference; -struct expr_getnextarraykey; -struct expr_getfirstarraykey; -struct expr_getdvarcoloralpha; -struct expr_getdvarcolorblue; -struct expr_getdvarcolorgreen; -struct expr_getdvarcolorred; -struct expr_getdvarvector; -struct expr_getdvarfloat; -struct expr_getdvarint; -struct expr_getdvar; -struct expr_gettime; -struct expr_abs; -struct expr_vectortoangles; -struct expr_angleclamp180; -struct expr_anglestoforward; -struct expr_anglestoright; -struct expr_anglestoup; -struct expr_vectorscale; -struct expr_isdefined; -struct expr_arguments; -struct expr_parameters; -struct expr_pointer; -struct expr_function; -struct expr_method; -struct expr_call; -struct expr_complement; -struct expr_negate; -struct expr_not; -struct expr_binary; -struct expr_add; -struct expr_sub; -struct expr_mul; -struct expr_div; -struct expr_mod; -struct expr_shift_left; -struct expr_shift_right; -struct expr_bitwise_or; -struct expr_bitwise_and; -struct expr_bitwise_exor; -struct expr_equality; -struct expr_inequality; -struct expr_less_equal; -struct expr_greater_equal; -struct expr_less; -struct expr_greater; -struct expr_or; -struct expr_and; -struct expr_ternary; -struct expr_increment; -struct expr_decrement; -struct expr_assign; -struct expr_assign_equal; -struct expr_assign_add; -struct expr_assign_sub; -struct expr_assign_mul; -struct expr_assign_div; -struct expr_assign_mod; -struct expr_assign_shift_left; -struct expr_assign_shift_right; -struct expr_assign_bitwise_or; -struct expr_assign_bitwise_and; -struct expr_assign_bitwise_exor; -struct stmt_list; -struct stmt_dev; -struct stmt_expr; -struct stmt_call; -struct stmt_const; -struct stmt_assign; -struct stmt_endon; -struct stmt_notify; -struct stmt_realwait; -struct stmt_wait; -struct stmt_waittill; -struct stmt_waittillmatch; -struct stmt_waittillframeend; -struct stmt_if; -struct stmt_ifelse; -struct stmt_while; -struct stmt_dowhile; -struct stmt_for; -struct stmt_foreach; -struct stmt_switch; -struct stmt_case; -struct stmt_default; -struct stmt_break; -struct stmt_continue; -struct stmt_return; -struct stmt_breakpoint; -struct stmt_prof_begin; -struct stmt_prof_end; -struct decl_thread; -struct decl_usingtree; -struct decl_dev_begin; -struct decl_dev_end; -struct include; -struct program; -struct asm_loc; -struct asm_jump; -struct asm_jump_back; -struct asm_jump_cond; -struct asm_jump_false_expr; -struct asm_jump_true_expr; -struct asm_switch; -struct asm_endswitch; -struct asm_prescriptcall; -struct asm_voidcodepos; -struct asm_dev; - -union call -{ - enum class mode { normal, thread }; - - std::unique_ptr as_node; - std::unique_ptr as_pointer; - std::unique_ptr as_function; - - call(); - call(std::unique_ptr value); - call(call&& value); - call(const call&) = delete; - call& operator=(const call&) = delete; - ~call(); - friend bool operator==(const call& lhs, kind rhs); - auto loc() const -> location; - auto kind() const -> ast::kind; - auto print() const -> std::string; -}; - -union expr -{ - std::unique_ptr as_node; - std::unique_ptr as_true; - std::unique_ptr as_false; - std::unique_ptr as_integer; - std::unique_ptr as_float; - std::unique_ptr as_vector; - std::unique_ptr as_hash; - std::unique_ptr as_string; - std::unique_ptr as_istring; - std::unique_ptr as_path; - std::unique_ptr as_identifier; - std::unique_ptr as_animtree; - std::unique_ptr as_animation; - std::unique_ptr as_level; - std::unique_ptr as_anim; - std::unique_ptr as_self; - std::unique_ptr as_game; - std::unique_ptr as_undefined; - std::unique_ptr as_empty_array; - std::unique_ptr as_paren; - std::unique_ptr as_size; - std::unique_ptr as_field; - std::unique_ptr as_array; - std::unique_ptr as_reference; - std::unique_ptr as_getnextarraykey; - std::unique_ptr as_getfirstarraykey; - std::unique_ptr as_getdvarcoloralpha; - std::unique_ptr as_getdvarcolorblue; - std::unique_ptr as_getdvarcolorgreen; - std::unique_ptr as_getdvarcolorred; - std::unique_ptr as_getdvarvector; - std::unique_ptr as_getdvarfloat; - std::unique_ptr as_getdvarint; - std::unique_ptr as_getdvar; - std::unique_ptr as_gettime; - std::unique_ptr as_abs; - std::unique_ptr as_vectortoangles; - std::unique_ptr as_angleclamp180; - std::unique_ptr as_anglestoforward; - std::unique_ptr as_anglestoright; - std::unique_ptr as_anglestoup; - std::unique_ptr as_vectorscale; - std::unique_ptr as_isdefined; - std::unique_ptr as_arguments; - std::unique_ptr as_parameters; - std::unique_ptr as_pointer; - std::unique_ptr as_function; - std::unique_ptr as_method; - std::unique_ptr as_call; - std::unique_ptr as_complement; - std::unique_ptr as_negate; - std::unique_ptr as_not; - std::unique_ptr as_binary; - std::unique_ptr as_add; - std::unique_ptr as_sub; - std::unique_ptr as_mul; - std::unique_ptr as_div; - std::unique_ptr as_mod; - std::unique_ptr as_shift_left; - std::unique_ptr as_shift_right; - std::unique_ptr as_bitwise_or; - std::unique_ptr as_bitwise_and; - std::unique_ptr as_bitwise_exor; - std::unique_ptr as_equality; - std::unique_ptr as_inequality; - std::unique_ptr as_less_equal; - std::unique_ptr as_greater_equal; - std::unique_ptr as_less; - std::unique_ptr as_greater; - std::unique_ptr as_or; - std::unique_ptr as_and; - std::unique_ptr as_ternary; - std::unique_ptr as_increment; - std::unique_ptr as_decrement; - std::unique_ptr as_assign; - std::unique_ptr as_assign_equal; - std::unique_ptr as_assign_add; - std::unique_ptr as_assign_sub; - std::unique_ptr as_assign_mul; - std::unique_ptr as_assign_div; - std::unique_ptr as_assign_mod; - std::unique_ptr as_assign_shift_left; - std::unique_ptr as_assign_shift_right; - std::unique_ptr as_assign_bw_or; - std::unique_ptr as_assign_bw_and; - std::unique_ptr as_assign_bw_exor; - - expr(); - expr(std::unique_ptr value); - expr(expr&& value); - expr& operator=(expr&& value); - expr(const expr&) = delete; - expr& operator=(const expr&) = delete; - ~expr(); - friend bool operator!=(const expr& lhs, kind rhs); - friend bool operator==(const expr& lhs, kind rhs); - friend bool operator==(const expr& lhs, const expr& rhs); - auto loc() const -> location; - auto kind() const -> ast::kind; - auto print() const -> std::string; -}; - -union stmt -{ - std::unique_ptr as_node; - std::unique_ptr as_list; - std::unique_ptr as_dev; - std::unique_ptr as_expr; - std::unique_ptr as_call; - std::unique_ptr as_const; - std::unique_ptr as_assign; - std::unique_ptr as_endon; - std::unique_ptr as_notify; - std::unique_ptr as_realwait; - std::unique_ptr as_wait; - std::unique_ptr as_waittill; - std::unique_ptr as_waittillmatch; - std::unique_ptr as_waittillframeend; - std::unique_ptr as_if; - std::unique_ptr as_ifelse; - std::unique_ptr as_while; - std::unique_ptr as_dowhile; - std::unique_ptr as_for; - std::unique_ptr as_foreach; - std::unique_ptr as_switch; - std::unique_ptr as_case; - std::unique_ptr as_default; - std::unique_ptr as_break; - std::unique_ptr as_continue; - std::unique_ptr as_return; - std::unique_ptr as_breakpoint; - std::unique_ptr as_prof_begin; - std::unique_ptr as_prof_end; - std::unique_ptr as_loc; - std::unique_ptr as_jump; - std::unique_ptr as_jump_back; - std::unique_ptr as_cond; - std::unique_ptr as_jump_true_expr; - std::unique_ptr as_jump_false_expr; - std::unique_ptr as_asm_switch; - std::unique_ptr as_asm_endswitch; - std::unique_ptr as_asm_prescriptcall; - std::unique_ptr as_asm_voidcodepos; - std::unique_ptr as_asm_dev; - - stmt(); - stmt(std::unique_ptr value); - stmt(stmt&& value); - stmt& operator=(stmt&& value); - stmt(const stmt&) = delete; - stmt& operator=(const stmt&) = delete; - ~stmt(); - friend bool operator==(const stmt& lhs, kind rhs); - auto loc() const -> location; - auto kind() const -> ast::kind; - auto print() const -> std::string; -}; - -union decl -{ - std::unique_ptr as_node; - std::unique_ptr as_dev_begin; - std::unique_ptr as_dev_end; - std::unique_ptr as_usingtree; - std::unique_ptr as_thread; - - decl(); - decl(std::unique_ptr value); - decl(decl&& value); - decl& operator=(decl&& value); - decl(const decl&) = delete; - decl& operator=(const decl&) = delete; - ~decl(); - friend bool operator==(const decl& lhs, kind rhs); - auto loc() const -> location; - auto kind() const -> ast::kind; - auto print() const -> std::string; -}; - -struct node -{ - using ptr = std::unique_ptr; - -private: - kind kind_; - location loc_; - -public: - node() : kind_(kind::null) {} - node(const location& loc) : kind_(kind::null), loc_(loc) {} - node(kind type) : kind_(type) {} - node(kind type, const location& loc) : kind_(type), loc_(loc) {} - - virtual ~node() = default; - virtual auto print() const -> std::string { return ""; }; - friend bool operator==(const node& n, kind k); - friend bool operator==(const node& lhs, const node& rhs); - - auto kind() -> kind { return kind_; } - auto loc() -> location& { return loc_; } - - auto is_special_stmt() -> bool; - auto is_special_stmt_dev() -> bool; - auto is_special_stmt_noif() -> bool; - auto is_special_stmt_dev_noif() -> bool; - auto is_binary() -> bool; - auto precedence() -> std::uint8_t; - -protected: - static std::uint32_t indent_; - static void reset_indentation(); - static std::string indented(std::uint32_t indent); -}; - -struct expr_true : public node -{ - using ptr = std::unique_ptr; - - expr_true(); - expr_true(const location& loc); - auto print() const -> std::string override; - friend bool operator==(const expr_true&, const expr_true&); -}; - -struct expr_false : public node -{ - using ptr = std::unique_ptr; - - expr_false(); - expr_false(const location& loc); - auto print() const -> std::string override; - friend bool operator==(const expr_false&, const expr_false&); -}; - -struct expr_integer : public node -{ - using ptr = std::unique_ptr; - - std::string value; - - expr_integer(const std::string& value); - expr_integer(const location& loc, const std::string& value); - auto print() const -> std::string override; - friend bool operator==(const expr_integer& lhs, const expr_integer& rhs); -}; - -struct expr_float : public node -{ - using ptr = std::unique_ptr; - - std::string value; - - expr_float(const std::string& value); - expr_float(const location& loc, const std::string& value); - auto print() const -> std::string override; - friend bool operator==(const expr_float& lhs, const expr_float& rhs); -}; - -struct expr_vector : public node -{ - using ptr = std::unique_ptr; - - expr x; - expr y; - expr z; - - expr_vector(expr x, expr y, expr z); - expr_vector(const location& loc, expr x, expr y, expr z); - auto print() const -> std::string override; - friend bool operator==(const expr_vector& lhs, const expr_vector& rhs); -}; - -struct expr_hash : public node -{ - using ptr = std::unique_ptr; - - std::string value; - - expr_hash(const std::string& value); - expr_hash(const location& loc, const std::string& value); - auto print() const -> std::string override; - friend bool operator==(const expr_hash& lhs, const expr_hash& rhs); -}; - -struct expr_string : public node -{ - using ptr = std::unique_ptr; - - std::string value; - - expr_string(const std::string& value); - expr_string(const location& loc, const std::string& value); - auto print() const -> std::string override; - friend bool operator==(const expr_string& lhs, const expr_string& rhs); -}; - -struct expr_istring : public node -{ - using ptr = std::unique_ptr; - - std::string value; - - expr_istring(const std::string& value); - expr_istring(const location& loc, const std::string& value); - auto print() const -> std::string override; - friend bool operator==(const expr_istring& lhs, const expr_istring& rhs); -}; - -struct expr_path : public node -{ - using ptr = std::unique_ptr; - - std::string value; - - expr_path(); - expr_path(const std::string& value); - expr_path(const location& loc); - expr_path(const location& loc, const std::string& value); - auto print() const -> std::string override; - friend bool operator==(const expr_path& lhs, const expr_path& rhs); -}; - -struct expr_identifier : public node -{ - using ptr = std::unique_ptr; - - std::string value; - - expr_identifier(const std::string& value); - expr_identifier(const location& loc, const std::string& value); - auto print() const -> std::string override; - friend bool operator==(const expr_identifier& lhs, const expr_identifier& rhs); -}; - -struct expr_animtree : public node -{ - using ptr = std::unique_ptr; - - expr_animtree(); - expr_animtree(const location& loc); - auto print() const -> std::string override; - friend bool operator==(const expr_animtree& lhs, const expr_animtree& rhs); -}; - -struct expr_animation : public node -{ - using ptr = std::unique_ptr; - - std::string value; - - expr_animation(const std::string& value); - expr_animation(const location& loc, const std::string& value); - auto print() const -> std::string override; - friend bool operator==(const expr_animation& lhs, const expr_animation& rhs); -}; - -struct expr_level : public node -{ - using ptr = std::unique_ptr; - - expr_level(); - expr_level(const location& loc); - auto print() const -> std::string override; - friend bool operator==(const expr_level& lhs, const expr_level& rhs); -}; - -struct expr_anim : public node -{ - using ptr = std::unique_ptr; - - expr_anim(); - expr_anim(const location& loc); - auto print() const -> std::string override; - friend bool operator==(const expr_anim& lhs, const expr_anim& rhs); -}; - -struct expr_self : public node -{ - using ptr = std::unique_ptr; - - expr_self(); - expr_self(const location& loc); - auto print() const -> std::string override; - friend bool operator==(const expr_self& lhs, const expr_self& rhs); -}; - -struct expr_game : public node -{ - using ptr = std::unique_ptr; - - expr_game(); - expr_game(const location& loc); - auto print() const -> std::string override; - friend bool operator==(const expr_game& lhs, const expr_game& rhs); -}; - -struct expr_undefined : public node -{ - using ptr = std::unique_ptr; - - expr_undefined(); - expr_undefined(const location& loc); - auto print() const -> std::string override; - friend bool operator==(const expr_undefined& lhs, const expr_undefined& rhs); -}; - -struct expr_empty_array : public node -{ - using ptr = std::unique_ptr; - - expr_empty_array(); - expr_empty_array(const location& loc); - auto print() const -> std::string override; - friend bool operator==(const expr_empty_array& lhs, const expr_empty_array& rhs); -}; - -struct expr_paren : public node -{ - using ptr = std::unique_ptr; - - expr child; - - expr_paren(expr expr); - expr_paren(const location& loc, expr expr); - auto print() const -> std::string override; - friend bool operator==(const expr_paren& lhs, const expr_paren& rhs); -}; - -struct expr_size : public node -{ - using ptr = std::unique_ptr; - - expr obj; - - expr_size(expr obj); - expr_size(const location& loc, expr obj); - auto print() const -> std::string override; - friend bool operator==(const expr_size& lhs, const expr_size& rhs); -}; - -struct expr_field : public node -{ - using ptr = std::unique_ptr; - - expr obj; - expr_identifier::ptr field; - - expr_field(expr obj, expr_identifier::ptr field); - expr_field(const location& loc, expr obj, expr_identifier::ptr field); - auto print() const -> std::string override; - friend bool operator==(const expr_field& lhs, const expr_field& rhs); -}; - -struct expr_array : public node -{ - using ptr = std::unique_ptr; - - expr obj; - expr key; - - expr_array(expr obj, expr key); - expr_array(const location& loc, expr obj, expr key); - auto print() const -> std::string override; - friend bool operator==(const expr_array& lhs, const expr_array& rhs); -}; - -struct expr_reference : public node -{ - using ptr = std::unique_ptr; - - expr_path::ptr path; - expr_identifier::ptr name; - - expr_reference(expr_path::ptr path, expr_identifier::ptr name); - expr_reference(const location& loc, expr_path::ptr path, expr_identifier::ptr name); - auto print() const -> std::string override; -}; - -struct expr_getnextarraykey : public node -{ - using ptr = std::unique_ptr; - - expr arg1; - expr arg2; - - expr_getnextarraykey(expr arg1, expr arg2); - expr_getnextarraykey(const location& loc, expr arg1, expr arg2); - auto print() const -> std::string override; -}; - -struct expr_getfirstarraykey : public node -{ - using ptr = std::unique_ptr; - - expr arg; - - expr_getfirstarraykey(expr arg); - expr_getfirstarraykey(const location& loc, expr arg); - auto print() const -> std::string override; -}; - -struct expr_getdvarcoloralpha : public node -{ - using ptr = std::unique_ptr; - - expr arg; - - expr_getdvarcoloralpha(expr arg); - expr_getdvarcoloralpha(const location& loc, expr arg); - auto print() const -> std::string override; -}; - -struct expr_getdvarcolorblue : public node -{ - using ptr = std::unique_ptr; - - expr arg; - - expr_getdvarcolorblue(expr arg); - expr_getdvarcolorblue(const location& loc, expr arg); - auto print() const -> std::string override; -}; - -struct expr_getdvarcolorgreen : public node -{ - using ptr = std::unique_ptr; - - expr arg; - - expr_getdvarcolorgreen(expr arg); - expr_getdvarcolorgreen(const location& loc, expr arg); - auto print() const -> std::string override; -}; - -struct expr_getdvarcolorred : public node -{ - using ptr = std::unique_ptr; - - expr arg; - - expr_getdvarcolorred(expr arg); - expr_getdvarcolorred(const location& loc, expr arg); - auto print() const -> std::string override; -}; - -struct expr_getdvarvector : public node -{ - using ptr = std::unique_ptr; - - expr arg; - - expr_getdvarvector(expr arg); - expr_getdvarvector(const location& loc, expr arg); - auto print() const -> std::string override; -}; - -struct expr_getdvarfloat : public node -{ - using ptr = std::unique_ptr; - - expr arg; - - expr_getdvarfloat(expr arg); - expr_getdvarfloat(const location& loc, expr arg); - auto print() const -> std::string override; -}; - -struct expr_getdvarint : public node -{ - using ptr = std::unique_ptr; - - expr arg; - - expr_getdvarint(expr arg); - expr_getdvarint(const location& loc, expr arg); - auto print() const -> std::string override; -}; - - -struct expr_getdvar : public node -{ - using ptr = std::unique_ptr; - - expr arg; - - expr_getdvar(expr arg); - expr_getdvar(const location& loc, expr arg); - auto print() const -> std::string override; -}; - -struct expr_gettime : public node -{ - using ptr = std::unique_ptr; - - expr_gettime(); - expr_gettime(const location& loc); - auto print() const -> std::string override; -}; - -struct expr_abs : public node -{ - using ptr = std::unique_ptr; - - expr arg; - - expr_abs(expr arg); - expr_abs(const location& loc, expr arg); - auto print() const -> std::string override; -}; - -struct expr_vectortoangles : public node -{ - using ptr = std::unique_ptr; - - expr arg; - - expr_vectortoangles(expr arg); - expr_vectortoangles(const location& loc, expr arg); - auto print() const -> std::string override; -}; - -struct expr_angleclamp180 : public node -{ - using ptr = std::unique_ptr; - - expr arg; - - expr_angleclamp180(expr arg); - expr_angleclamp180(const location& loc, expr arg); - auto print() const -> std::string override; -}; - -struct expr_anglestoforward : public node -{ - using ptr = std::unique_ptr; - - expr arg; - - expr_anglestoforward(expr arg); - expr_anglestoforward(const location& loc, expr arg); - auto print() const -> std::string override; -}; - -struct expr_anglestoright : public node -{ - using ptr = std::unique_ptr; - - expr arg; - - expr_anglestoright(expr arg); - expr_anglestoright(const location& loc, expr arg); - auto print() const -> std::string override; -}; - -struct expr_anglestoup : public node -{ - using ptr = std::unique_ptr; - - expr arg; - - expr_anglestoup(expr arg); - expr_anglestoup(const location& loc, expr arg); - auto print() const -> std::string override; -}; - -struct expr_vectorscale : public node -{ - using ptr = std::unique_ptr; - - expr arg1; - expr arg2; - - expr_vectorscale(expr arg1, expr arg2); - expr_vectorscale(const location& loc, expr arg1, expr arg2); - auto print() const -> std::string override; -}; - -struct expr_isdefined : public node -{ - using ptr = std::unique_ptr; - - expr arg; - - expr_isdefined(expr arg); - expr_isdefined(const location& loc, expr arg); - auto print() const -> std::string override; -}; - -struct expr_arguments : public node -{ - using ptr = std::unique_ptr; - - std::vector list; - - expr_arguments(); - expr_arguments(const location& loc); - auto print() const -> std::string override; -}; - -struct expr_parameters : public node -{ - using ptr = std::unique_ptr; - - std::vector list; - - expr_parameters(); - expr_parameters(const location& loc); - auto print() const -> std::string override; -}; - -struct expr_pointer : public node -{ - using ptr = std::unique_ptr; - - expr func; - expr_arguments::ptr args; - call::mode mode; - - expr_pointer(expr func, expr_arguments::ptr args, call::mode mode); - expr_pointer(const location& loc, expr func, expr_arguments::ptr args, call::mode mode); - auto print() const -> std::string override; -}; - -struct expr_function : public node -{ - using ptr = std::unique_ptr; - - expr_path::ptr path; - expr_identifier::ptr name; - expr_arguments::ptr args; - call::mode mode; - - expr_function(expr_path::ptr path, expr_identifier::ptr name, expr_arguments::ptr args, call::mode mode); - expr_function(const location& loc, expr_path::ptr path, expr_identifier::ptr name, expr_arguments::ptr args, call::mode mode); - auto print() const -> std::string override; -}; - -struct expr_method : public node -{ - using ptr = std::unique_ptr; - - expr obj; - ast::call call; - - expr_method(expr obj, ast::call call); - expr_method(const location& loc, expr obj, ast::call call); - auto print() const -> std::string override; -}; - -struct expr_call : public node -{ - using ptr = std::unique_ptr; - - ast::call call; - - expr_call(ast::call call); - expr_call(const location& loc, ast::call call); - auto print() const -> std::string override; -}; - -struct expr_complement : public node -{ - using ptr = std::unique_ptr; - - expr rvalue; - - expr_complement(expr rvalue); - expr_complement(const location& loc, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_negate : public node -{ - using ptr = std::unique_ptr; - - expr rvalue; - - expr_negate(expr rvalue); - expr_negate(const location& loc, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_not : public node -{ - using ptr = std::unique_ptr; - - expr rvalue; - - expr_not(expr rvalue); - expr_not(const location& loc, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_binary : public node -{ - using ptr = std::unique_ptr; - - expr lvalue; - expr rvalue; - - expr_binary(ast::kind kind, expr lvalue, expr rvalue); - expr_binary(ast::kind kind, const location& loc, expr lvalue, expr rvalue); - virtual auto print() const -> std::string = 0; -}; - -struct expr_add : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_add(expr lvalue, expr rvalue); - expr_add(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_sub : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_sub(expr lvalue, expr rvalue); - expr_sub(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_mul : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_mul(expr lvalue, expr rvalue); - expr_mul(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_div : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_div(expr lvalue, expr rvalue); - expr_div(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_mod : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_mod(expr lvalue, expr rvalue); - expr_mod(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_shift_left : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_shift_left(expr lvalue, expr rvalue); - expr_shift_left(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_shift_right : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_shift_right(expr lvalue, expr rvalue); - expr_shift_right(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_bitwise_or : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_bitwise_or(expr lvalue, expr rvalue); - expr_bitwise_or(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_bitwise_and : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_bitwise_and(expr lvalue, expr rvalue); - expr_bitwise_and(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_bitwise_exor : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_bitwise_exor(expr lvalue, expr rvalue); - expr_bitwise_exor(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_equality : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_equality(expr lvalue, expr rvalue); - expr_equality(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_inequality : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_inequality(expr lvalue, expr rvalue); - expr_inequality(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_less_equal : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_less_equal(expr lvalue, expr rvalue); - expr_less_equal(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_greater_equal : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_greater_equal(expr lvalue, expr rvalue); - expr_greater_equal(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_less : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_less(expr lvalue, expr rvalue); - expr_less(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_greater : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_greater(expr lvalue, expr rvalue); - expr_greater(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_or : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_or(expr lvalue, expr rvalue); - expr_or(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_and : public expr_binary -{ - using ptr = std::unique_ptr; - - expr_and(expr lvalue, expr rvalue); - expr_and(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_ternary : public node -{ - using ptr = std::unique_ptr; - - expr test; - expr true_expr; - expr false_expr; - - expr_ternary(expr test, expr true_expr, expr false_expr); - expr_ternary(const location& loc, expr test, expr true_expr, expr false_expr); - auto print() const -> std::string override; -}; - -struct expr_increment : node -{ - using ptr = std::unique_ptr; - - expr lvalue; - bool prefix; - - expr_increment(expr lvalue, bool prefix); - expr_increment(const location& loc, expr lvalue, bool prefix); - auto print() const -> std::string override; -}; - -struct expr_decrement : node -{ - using ptr = std::unique_ptr; - - expr lvalue; - bool prefix; - - expr_decrement(expr lvalue, bool prefix); - expr_decrement(const location& loc, expr lvalue, bool prefix); - auto print() const -> std::string override; -}; - -struct expr_assign : public node -{ - using ptr = std::unique_ptr; - - expr lvalue; - expr rvalue; - - expr_assign(ast::kind kind, expr lvalue, expr rvalue); - expr_assign(ast::kind kind, const location& loc, expr lvalue, expr rvalue); - virtual auto print() const -> std::string = 0; -}; - -struct expr_assign_equal : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_equal(expr lvalue, expr rvalue); - expr_assign_equal(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_assign_add : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_add(expr lvalue, expr rvalue); - expr_assign_add(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_assign_sub : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_sub(expr lvalue, expr rvalue); - expr_assign_sub(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_assign_mul : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_mul(expr lvalue, expr rvalue); - expr_assign_mul(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_assign_div : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_div(expr lvalue, expr rvalue); - expr_assign_div(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_assign_mod : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_mod(expr lvalue, expr rvalue); - expr_assign_mod(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_assign_shift_left : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_shift_left(expr lvalue, expr rvalue); - expr_assign_shift_left(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_assign_shift_right : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_shift_right(expr lvalue, expr rvalue); - expr_assign_shift_right(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_assign_bitwise_or : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_bitwise_or(expr lvalue, expr rvalue); - expr_assign_bitwise_or(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_assign_bitwise_and : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_bitwise_and(expr lvalue, expr rvalue); - expr_assign_bitwise_and(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct expr_assign_bitwise_exor : public expr_assign -{ - using ptr = std::unique_ptr; - - expr_assign_bitwise_exor(expr lvalue, expr rvalue); - expr_assign_bitwise_exor(const location& loc, expr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct stmt_list : public node -{ - using ptr = std::unique_ptr; - - std::vector list; - bool is_case = false; - bool is_expr = false; - - stmt_list(); - stmt_list(const location& loc); - auto print() const -> std::string override; -}; - -struct stmt_dev : public node -{ - using ptr = std::unique_ptr; - - stmt_list::ptr list; - - stmt_dev(stmt_list::ptr list); - stmt_dev(const location& loc, stmt_list::ptr list); - auto print() const -> std::string override; -}; - -struct stmt_expr : public node -{ - using ptr = std::unique_ptr; - - ast::expr expr; - - stmt_expr(ast::expr expr); - stmt_expr(const location& loc, ast::expr expr); - auto print() const -> std::string override; -}; - -struct stmt_call : public node -{ - using ptr = std::unique_ptr; - - ast::expr expr; - - stmt_call(ast::expr expr); - stmt_call(const location& loc, ast::expr expr); - auto print() const -> std::string override; -}; - -struct stmt_const : public node -{ - using ptr = std::unique_ptr; - - expr_identifier::ptr lvalue; - expr rvalue; - - stmt_const(expr_identifier::ptr lvalue, expr rvalue); - stmt_const(const location& loc, expr_identifier::ptr lvalue, expr rvalue); - auto print() const -> std::string override; -}; - -struct stmt_assign : public node -{ - using ptr = std::unique_ptr; - - ast::expr expr; - - stmt_assign(ast::expr expr); - stmt_assign(const location& loc, ast::expr expr); - auto print() const -> std::string override; -}; - -struct stmt_endon : public node -{ - using ptr = std::unique_ptr; - - expr obj; - expr event; - - stmt_endon(expr obj, expr event); - stmt_endon(const location& loc, expr obj, expr event); - auto print() const -> std::string override; -}; - -struct stmt_notify : public node -{ - using ptr = std::unique_ptr; - - expr obj; - expr event; - expr_arguments::ptr args; - - stmt_notify(expr obj, expr event, expr_arguments::ptr args); - stmt_notify(const location& loc, expr obj, expr event, expr_arguments::ptr args); - auto print() const -> std::string override; -}; - -struct stmt_realwait : public node -{ - using ptr = std::unique_ptr; - - expr time; - - stmt_realwait(expr time); - stmt_realwait(const location& loc, expr time); - auto print() const -> std::string override; -}; - -struct stmt_wait : public node -{ - using ptr = std::unique_ptr; - - expr time; - - stmt_wait(expr time); - stmt_wait(const location& loc, expr time); - auto print() const -> std::string override; -}; - -struct stmt_waittill : public node -{ - using ptr = std::unique_ptr; - - expr obj; - expr event; - expr_arguments::ptr args; - - stmt_waittill(expr obj, expr event, expr_arguments::ptr params); - stmt_waittill(const location& loc, expr obj, expr event, expr_arguments::ptr args); - auto print() const -> std::string override; -}; - -struct stmt_waittillmatch : public node -{ - using ptr = std::unique_ptr; - - expr obj; - expr event; - expr_arguments::ptr args; - - stmt_waittillmatch(expr obj, expr event, expr_arguments::ptr args); - stmt_waittillmatch(const location& loc, expr obj, expr expr, expr_arguments::ptr args); - auto print() const -> std::string override; -}; - -struct stmt_waittillframeend : public node -{ - using ptr = std::unique_ptr; - - stmt_waittillframeend(); - stmt_waittillframeend(const location& loc); - - auto print() const -> std::string override; -}; - -struct stmt_if : public node -{ - using ptr = std::unique_ptr; - - expr test; - ast::stmt stmt; - block::ptr blk; - - stmt_if(expr test, ast::stmt stmt); - stmt_if(const location& loc, expr test, ast::stmt stmt); - auto print() const -> std::string override; -}; - -struct stmt_ifelse : public node -{ - using ptr = std::unique_ptr; - - expr test; - stmt stmt_if; - stmt stmt_else; - block::ptr blk_if; - block::ptr blk_else; - - stmt_ifelse(expr test, stmt stmt_if, stmt stmt_else); - stmt_ifelse(const location& loc, expr test, stmt stmt_if, stmt stmt_else); - auto print() const -> std::string override; -}; - -struct stmt_while : public node -{ - using ptr = std::unique_ptr; - - expr test; - ast::stmt stmt; - block::ptr blk; - - stmt_while(expr test, ast::stmt stmt); - stmt_while(const location& loc, expr test, ast::stmt stmt); - auto print() const -> std::string override; -}; - -struct stmt_dowhile : public node -{ - using ptr = std::unique_ptr; - - expr test; - ast::stmt stmt; - block::ptr blk; - - stmt_dowhile(expr test, ast::stmt stmt); - stmt_dowhile(const location& loc, expr test, ast::stmt stmt); - auto print() const -> std::string override; -}; - -struct stmt_for : public node -{ - using ptr = std::unique_ptr; - - ast::stmt init; - ast::expr test; - ast::stmt iter; - ast::stmt stmt; - block::ptr blk; - block::ptr blk_iter; - std::vector vars; - - stmt_for(ast::stmt init, expr test, ast::stmt iter, ast::stmt stmt); - stmt_for(const location& loc, ast::stmt init, expr test, ast::stmt iter, ast::stmt stmt); - auto print() const -> std::string override; -}; - -struct stmt_foreach : public node -{ - using ptr = std::unique_ptr; - - ast::expr array_expr; - ast::expr value_expr; - ast::expr key_expr; - ast::expr array; - ast::stmt pre_expr; - ast::expr cond_expr; - ast::stmt post_expr; - ast::stmt stmt0; - ast::stmt stmt; - block::ptr ctx; - block::ptr ctx_post; - bool use_key; - std::vector vars; - - stmt_foreach(const location& loc, ast::stmt stmt, bool use_key); - stmt_foreach(ast::expr element, ast::expr container, ast::stmt stmt); - stmt_foreach(ast::expr key, ast::expr element, ast::expr container, ast::stmt stmt); - stmt_foreach(const location& loc, ast::expr element, ast::expr container, ast::stmt stmt); - stmt_foreach(const location& loc, ast::expr key, ast::expr element, ast::expr container, ast::stmt stmt); - auto print() const -> std::string override; -}; - -struct stmt_switch : public node -{ - using ptr = std::unique_ptr; - - expr test; - stmt_list::ptr stmt; - block::ptr ctx; - - stmt_switch(expr test, stmt_list::ptr stmt); - stmt_switch(const location& loc, expr test, stmt_list::ptr stmt); - auto print() const -> std::string override; -}; - -struct stmt_case : public node -{ - using ptr = std::unique_ptr; - - expr label; - stmt_list::ptr stmt; - block::ptr blk; - - stmt_case(expr label); - stmt_case(const location& loc, expr label); - stmt_case(const location& loc, expr label, stmt_list::ptr stmt); - auto print() const -> std::string override; -}; - -struct stmt_default : public node -{ - using ptr = std::unique_ptr; - - stmt_list::ptr stmt; - block::ptr blk; - - stmt_default(); - stmt_default(const location& loc); - stmt_default(const location& loc, stmt_list::ptr stmt); - auto print() const -> std::string override; -}; - -struct stmt_break : public node -{ - using ptr = std::unique_ptr; - - stmt_break(); - stmt_break(const location& loc); - auto print() const -> std::string override; -}; - -struct stmt_continue : public node -{ - using ptr = std::unique_ptr; - - stmt_continue(); - stmt_continue(const location& loc); - auto print() const -> std::string override; -}; - -struct stmt_return : public node -{ - using ptr = std::unique_ptr; - - ast::expr expr; - - stmt_return(ast::expr expr); - stmt_return(const location& loc, ast::expr expr); - - auto print() const -> std::string override; -}; - -struct stmt_breakpoint : public node -{ - using ptr = std::unique_ptr; - - stmt_breakpoint(); - stmt_breakpoint(const location& loc); - auto print() const -> std::string override; -}; - -struct stmt_prof_begin : public node -{ - using ptr = std::unique_ptr; - - expr_arguments::ptr args; - - stmt_prof_begin(expr_arguments::ptr args); - stmt_prof_begin(const location& loc, expr_arguments::ptr args); - auto print() const -> std::string override; -}; - -struct stmt_prof_end : public node -{ - using ptr = std::unique_ptr; - - expr_arguments::ptr args; - - stmt_prof_end(expr_arguments::ptr args); - stmt_prof_end(const location& loc, expr_arguments::ptr args); - auto print() const -> std::string override; -}; - -struct decl_thread : public node -{ - using ptr = std::unique_ptr; - - expr_identifier::ptr name; - expr_parameters::ptr params; - stmt_list::ptr stmt; - export_flags flags; - - decl_thread(expr_identifier::ptr name, expr_parameters::ptr params, stmt_list::ptr stmt, export_flags flags); - decl_thread(const location& loc, expr_identifier::ptr name, expr_parameters::ptr params, stmt_list::ptr stmt, export_flags flags); - auto print() const -> std::string override; -}; - -struct decl_usingtree : public node -{ - using ptr = std::unique_ptr; - - expr_string::ptr name; - - decl_usingtree(expr_string::ptr name); - decl_usingtree(const location& loc, expr_string::ptr name); - auto print() const -> std::string override; -}; - -struct decl_dev_begin : public node -{ - using ptr = std::unique_ptr; - - decl_dev_begin(); - decl_dev_begin(const location& loc); - auto print() const -> std::string override; -}; - -struct decl_dev_end : public node -{ - using ptr = std::unique_ptr; - - decl_dev_end(); - decl_dev_end(const location& loc); - auto print() const -> std::string override; -}; - -struct include : public node -{ - using ptr = std::unique_ptr; - - expr_path::ptr path; - - include(expr_path::ptr path); - include(const location& loc, expr_path::ptr path); - auto print() const -> std::string override; -}; - -struct program : public node -{ - using ptr = std::unique_ptr; - - std::vector includes; - std::vector declarations; - - program(); - program(const location& loc); - auto print() const -> std::string override; -}; - -struct asm_loc : public node -{ - using ptr = std::unique_ptr; - - std::string value; - - asm_loc(const std::string& value); - asm_loc(const location& loc, const std::string& value); - auto print() const -> std::string override; -}; - -struct asm_jump : public node -{ - using ptr = std::unique_ptr; - - std::string value; - - asm_jump(const std::string& value); - asm_jump(const location& loc, const std::string& value); - auto print() const -> std::string override; -}; - -struct asm_jump_back : public node -{ - using ptr = std::unique_ptr; - - std::string value; - - asm_jump_back(const std::string& value); - asm_jump_back(const location& loc, const std::string& value); - auto print() const -> std::string override; -}; - -struct asm_jump_cond : public node -{ - using ptr = std::unique_ptr; - - ast::expr expr; - std::string value; - - asm_jump_cond(ast::expr expr, const std::string& value); - asm_jump_cond(const location& loc, ast::expr expr, const std::string& value); - auto print() const -> std::string override; -}; - -struct asm_jump_true_expr : public node -{ - using ptr = std::unique_ptr; - - ast::expr expr; - std::string value; - - asm_jump_true_expr(ast::expr expr, const std::string& value); - asm_jump_true_expr(const location& loc, ast::expr expr, const std::string& value); - auto print() const -> std::string override; -}; - -struct asm_jump_false_expr : public node -{ - using ptr = std::unique_ptr; - - ast::expr expr; - std::string value; - - asm_jump_false_expr(ast::expr expr, const std::string& value); - asm_jump_false_expr(const location& loc, ast::expr expr, const std::string& value); - auto print() const -> std::string override; -}; - -struct asm_switch : public node -{ - using ptr = std::unique_ptr; - - ast::expr expr; - std::string value; - - asm_switch(ast::expr expr, const std::string& value); - asm_switch(const location& loc, ast::expr expr, const std::string& value); - auto print() const -> std::string override; -}; - -struct asm_endswitch : public node -{ - using ptr = std::unique_ptr; - - std::vector data; - std::string count; - - asm_endswitch(std::vector data, const std::string& count); - asm_endswitch(const location& loc, std::vector data, const std::string& count); - auto print() const -> std::string override; -}; - -struct asm_prescriptcall : public node -{ - using ptr = std::unique_ptr; - - asm_prescriptcall(); - asm_prescriptcall(const location& loc); - auto print() const -> std::string override; -}; - -struct asm_voidcodepos : public node -{ - using ptr = std::unique_ptr; - - asm_voidcodepos(); - asm_voidcodepos(const location& loc); - auto print() const -> std::string override; -}; - -struct asm_dev : public node -{ - using ptr = std::unique_ptr; - - std::string value; - - asm_dev(const std::string& value); - asm_dev(const location& loc, const std::string& value); - auto print() const -> std::string override; -}; - -} // namespace xsk::arc::ast diff --git a/include/xsk/t6/common/types.hpp b/include/xsk/t6/common/types.hpp deleted file mode 100644 index d17a9ef2..00000000 --- a/include/xsk/t6/common/types.hpp +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#pragma once - -namespace xsk::arc -{ - -using read_cb_type = std::function(const std::string&)>; - -enum class build -{ - prod, - dev, -}; - -enum class abort_t -{ - abort_none = 0, - abort_continue = 1, - abort_break = 2, - abort_return = 3, -}; - -struct include_t -{ - std::string name; - std::vector funcs; - - include_t(const std::string& name, const std::vector& funcs) : name(name), funcs(funcs) {} -}; - -struct animtree_t -{ - std::string name; - bool loaded; -}; - -struct instruction -{ - using ptr = std::unique_ptr; - - std::uint32_t index; - std::uint32_t size; - std::uint8_t opcode; - std::vector data; - - instruction() : index(0), size(0), opcode(0xFF) {} -}; - -struct function -{ - using ptr = std::unique_ptr; - - std::uint32_t index; - std::uint32_t size; - std::uint8_t params; - std::uint8_t flags; - std::string name; - std::vector instructions; - std::unordered_map labels; - - function() : index(0), size(0), params(0), flags(0) {} -}; - -struct animation_ref -{ - using ptr = std::shared_ptr; - - std::string name; - std::uint32_t ref; -}; - -struct animtree_ref -{ - using ptr = std::shared_ptr; - - std::string name; - std::vector refs; - std::vector anims; -}; - -enum class string_type : std::uint8_t -{ - literal = 0, - canonical = 1, -}; - -struct string_ref -{ - using ptr = std::shared_ptr; - - std::string name; - std::uint8_t type; - std::vector refs; -}; - -enum class export_flags : std::uint8_t -{ - export_none = 0x00, - export_public = 0x01, - export_autoexec = 0x02, - export_private = 0x04, - export_codecall = 0x08, - export_private2 = 0x10, - export_varargs = 0x20, -}; - -struct export_ref -{ - using ptr = std::shared_ptr; - - std::uint32_t checksum; - std::uint32_t offset; - std::string name; - std::string space; - std::uint8_t params; - std::uint8_t flags; - std::uint32_t size; -}; - -enum class import_flags : std::uint8_t -{ - none = 0, - func_reference = 1, - func_call = 2, - func_call_thread = 3, - meth_call = 4, - meth_call_thread = 5, - developer = 0x10, - unk = 0x20, // T7, T8, T9 -}; - -struct import_ref -{ - using ptr = std::shared_ptr; - - std::string space; - std::string name; - std::uint8_t params; - std::uint8_t flags; - std::vector refs; -}; - -struct header -{ - std::uint64_t magic; - std::uint32_t source_crc; - std::uint32_t include_offset; - std::uint32_t animtree_offset; - std::uint32_t cseg_offset; - std::uint32_t stringtablefixup_offset; - std::uint32_t exports_offset; - std::uint32_t imports_offset; - std::uint32_t fixup_offset; - std::uint32_t profile_offset; - std::uint32_t cseg_size; - std::uint16_t name; - std::uint16_t stringtablefixup_count; - std::uint16_t exports_count; - std::uint16_t imports_count; - std::uint16_t fixup_count; - std::uint16_t profile_count; - std::uint8_t include_count; - std::uint8_t animtree_count; - std::uint8_t flags; - // char[1] pad; -}; - -struct assembly -{ - using ptr = std::unique_ptr; - - std::vector functions; - std::vector includes; - std::vector animtrees; -}; - -} // namespace xsk::arc diff --git a/include/xsk/t6/compiler.hpp b/include/xsk/t6/compiler.hpp deleted file mode 100644 index 0a34f6c3..00000000 --- a/include/xsk/t6/compiler.hpp +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#pragma once - -namespace xsk::arc::t6 -{ - -enum class opcode : std::uint8_t; - -class compiler : public arc::compiler -{ - std::string filename_; - assembly::ptr assembly_; - function::ptr function_; - std::uint32_t index_; - std::uint32_t label_idx_; - std::uint8_t stack_idx_; - std::vector local_stack_; - std::vector local_functions_; - std::vector includes_; - std::vector animtrees_; - std::unordered_map constants_; - std::vector blocks_; - bool can_break_; - bool can_continue_; - bool developer_thread_; - build mode_; - utils::writer::ptr output_; - -public: - auto output() -> assembly::ptr; - auto output_raw() -> std::vector; - void compile(const std::string& file, std::vector& data); - void mode(build mode); - -private: - auto parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr; - auto parse_file(const std::string& file) -> ast::program::ptr; - void compile_program(const ast::program::ptr& program); - void emit_include(const ast::include::ptr& include); - void emit_declaration(const ast::decl& decl); - void emit_decl_usingtree(const ast::decl_usingtree::ptr& animtree); - void emit_decl_thread(const ast::decl_thread::ptr& thread); - void emit_stmt(const ast::stmt& stmt); - void emit_stmt_list(const ast::stmt_list::ptr& stmt); - void emit_stmt_dev(const ast::stmt_dev::ptr& stmt); - void emit_stmt_expr(const ast::stmt_expr::ptr& stmt); - void emit_stmt_call(const ast::stmt_call::ptr& stmt); - void emit_stmt_const(const ast::stmt_const::ptr& stmt); - void emit_stmt_assign(const ast::stmt_assign::ptr& stmt); - void emit_stmt_endon(const ast::stmt_endon::ptr& stmt); - void emit_stmt_notify(const ast::stmt_notify::ptr& stmt); - void emit_stmt_wait(const ast::stmt_wait::ptr& stmt); - void emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt); - void emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt); - void emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr& stmt); - void emit_stmt_if(const ast::stmt_if::ptr& stmt); - void emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt); - void emit_stmt_while(const ast::stmt_while::ptr& stmt); - void emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt); - void emit_stmt_for(const ast::stmt_for::ptr& stmt); - void emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt); - void emit_stmt_switch(const ast::stmt_switch::ptr& stmt); - void emit_stmt_case(const ast::stmt_case::ptr& stmt); - void emit_stmt_default(const ast::stmt_default::ptr& stmt); - void emit_stmt_break(const ast::stmt_break::ptr& stmt); - void emit_stmt_continue(const ast::stmt_continue::ptr& stmt); - void emit_stmt_return(const ast::stmt_return::ptr& stmt); - void emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt); - void emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt); - void emit_expr(const ast::expr& expr); - void emit_expr_assign(const ast::expr_assign::ptr& expr); - void emit_expr_clear(const ast::expr& expr); - void emit_expr_increment(const ast::expr_increment::ptr& expr, bool is_stmt); - void emit_expr_decrement(const ast::expr_decrement::ptr& expr, bool is_stmt); - void emit_expr_ternary(const ast::expr_ternary::ptr& expr); - void emit_expr_binary(const ast::expr_binary::ptr& expr); - void emit_expr_and(const ast::expr_and::ptr& expr); - void emit_expr_or(const ast::expr_or::ptr& expr); - void emit_expr_complement(const ast::expr_complement::ptr& expr); - void emit_expr_negate(const ast::expr_negate::ptr& expr); - void emit_expr_not(const ast::expr_not::ptr& expr); - void emit_expr_call(const ast::expr_call::ptr& expr, bool is_stmt); - void emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, bool is_stmt); - void emit_expr_call_function(const ast::expr_function::ptr& expr, bool is_stmt); - void emit_expr_method(const ast::expr_method::ptr& expr, bool is_stmt); - void emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, bool is_stmt); - void emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, bool is_stmt); - void emit_expr_parameters(const ast::expr_parameters::ptr& expr); - void emit_expr_arguments(const ast::expr_arguments::ptr& expr); - void emit_expr_isdefined(const ast::expr_isdefined::ptr& expr); - void emit_expr_vectorscale(const ast::expr_vectorscale::ptr& expr); - void emit_expr_anglestoup(const ast::expr_anglestoup::ptr& expr); - void emit_expr_anglestoright(const ast::expr_anglestoright::ptr& expr); - void emit_expr_anglestoforward(const ast::expr_anglestoforward::ptr& expr); - void emit_expr_angleclamp180(const ast::expr_angleclamp180::ptr& expr); - void emit_expr_vectortoangles(const ast::expr_vectortoangles::ptr& expr); - void emit_expr_abs(const ast::expr_abs::ptr& expr); - void emit_expr_gettime(const ast::expr_gettime::ptr& expr); - void emit_expr_getdvar(const ast::expr_getdvar::ptr& expr); - void emit_expr_getdvarint(const ast::expr_getdvarint::ptr& expr); - void emit_expr_getdvarfloat(const ast::expr_getdvarfloat::ptr& expr); - void emit_expr_getdvarvector(const ast::expr_getdvarvector::ptr& expr); - void emit_expr_getdvarcolorred(const ast::expr_getdvarcolorred::ptr& expr); - void emit_expr_getdvarcolorgreen(const ast::expr_getdvarcolorgreen::ptr& expr); - void emit_expr_getdvarcolorblue(const ast::expr_getdvarcolorblue::ptr& expr); - void emit_expr_getdvarcoloralpha(const ast::expr_getdvarcoloralpha::ptr& expr); - void emit_expr_getfirstarraykey(const ast::expr_getfirstarraykey::ptr& expr); - void emit_expr_getnextarraykey(const ast::expr_getnextarraykey::ptr& expr); - void emit_expr_reference(const ast::expr_reference::ptr& expr); - void emit_expr_size(const ast::expr_size::ptr& expr); - void emit_expr_variable_ref(const ast::expr& expr, bool set); - void emit_expr_array_ref(const ast::expr_array::ptr& expr, bool set); - void emit_expr_field_ref(const ast::expr_field::ptr& expr, bool set); - void emit_expr_local_ref(const ast::expr_identifier::ptr& expr, bool set); - void emit_expr_variable(const ast::expr& expr); - void emit_expr_array(const ast::expr_array::ptr& expr); - void emit_expr_field(const ast::expr_field::ptr& expr); - void emit_expr_local(const ast::expr_identifier::ptr& expr); - void emit_expr_object(const ast::expr& expr); - void emit_expr_vector(const ast::expr_vector::ptr& expr); - void emit_expr_animation(const ast::expr_animation::ptr& expr); - void emit_expr_animtree(const ast::expr_animtree::ptr& expr); - void emit_expr_istring(const ast::expr_istring::ptr& expr); - void emit_expr_string(const ast::expr_string::ptr& expr); - void emit_expr_hash(const ast::expr_hash::ptr& expr); - void emit_expr_float(const ast::expr_float::ptr& expr); - void emit_expr_integer(const ast::expr_integer::ptr& expr); - void emit_expr_false(const ast::expr_false::ptr& expr); - void emit_expr_true(const ast::expr_true::ptr& expr); - void emit_opcode(opcode op); - void emit_opcode(opcode op, const std::string& data); - void emit_opcode(opcode op, const std::vector& data); - void process_thread(const ast::decl_thread::ptr& decl); - void process_stmt(const ast::stmt& stmt); - void process_stmt_list(const ast::stmt_list::ptr& stmt); - void process_stmt_dev(const ast::stmt_dev::ptr& stmt); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt); - void process_stmt_if(const ast::stmt_if::ptr& stmt); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt); - void process_stmt_while(const ast::stmt_while::ptr& stmt); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt); - void process_stmt_for(const ast::stmt_for::ptr& stmt); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt); - void process_expr(const ast::expr& expr); - void process_expr_parameters(const ast::expr_parameters::ptr& expr); - void variable_register(const std::string& name); - auto variable_access(const ast::expr_identifier::ptr& name) -> std::string; - auto is_constant_condition(const ast::expr& expr) -> bool; - auto create_label() -> std::string; - auto insert_label() -> std::string; - void insert_label(const std::string& label); - auto map_known_includes(const std::string& include) -> bool; - void print_function(const function::ptr& func); - void print_instruction(const instruction::ptr& inst); -}; - -} // namespace xsk::arc::t6 diff --git a/include/xsk/t6/context.hpp b/include/xsk/t6/context.hpp deleted file mode 100644 index 1e2671ab..00000000 --- a/include/xsk/t6/context.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#pragma once - -namespace xsk::arc::t6 -{ - -class context : public arc::context -{ - t6::assembler assembler_; - t6::disassembler disassembler_; - t6::compiler compiler_; - t6::decompiler decompiler_; - -public: - void init(build mode, read_cb_type callback); - void cleanup(); - - auto assembler() -> arc::assembler& { return assembler_; } - auto disassembler() -> arc::disassembler& { return disassembler_; } - auto compiler() -> arc::compiler& { return compiler_; } - auto decompiler() -> arc::decompiler& { return decompiler_; } -}; - -} // namespace xsk::arc::t6 diff --git a/include/xsk/t6/decompiler.hpp b/include/xsk/t6/decompiler.hpp deleted file mode 100644 index 8624fe17..00000000 --- a/include/xsk/t6/decompiler.hpp +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#pragma once - -namespace xsk::arc::t6 -{ - -class decompiler : public arc::decompiler -{ - std::string filename_; - ast::program::ptr program_; - ast::decl_thread::ptr func_; - std::unordered_map labels_; - std::vector expr_labels_; - std::vector tern_labels_; - std::stack stack_; - std::vector locals_; - std::vector blocks_; - bool in_waittill_; - bool retbool_; - int retnum_; - -public: - auto output() -> std::vector; - void decompile(const std::string& file, const assembly::ptr& data); - -private: - void decompile_function(const function::ptr& func); - void decompile_instruction(const instruction::ptr& inst, bool last); - void decompile_expressions(const instruction::ptr& inst); - void decompile_statements(const ast::stmt_list::ptr& stmt); - void decompile_infinites(const ast::stmt_list::ptr& stmt); - void decompile_loops(const ast::stmt_list::ptr& stmt); - void decompile_switches(const ast::stmt_list::ptr& stmt); - void decompile_ifelses(const ast::stmt_list::ptr& stmt); - void decompile_aborts(const ast::stmt_list::ptr& stmt); - void decompile_devblocks(const ast::stmt_list::ptr& stmt); - void decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end); - void decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t begin); - auto find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool; - auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t; - auto last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool; - auto lvalues_match(const ast::stmt_assign::ptr& stmt1, const ast::stmt_assign::ptr& stmt2) -> bool; - auto resolve_label(const std::string& name) -> std::uint32_t; - void process_thread(const ast::decl_thread::ptr& thread); - void process_stmt(const ast::stmt& stmt); - void process_stmt_list(const ast::stmt_list::ptr& stmt); - void process_stmt_dev(const ast::stmt_dev::ptr& stmt); - void process_stmt_expr(const ast::stmt_expr::ptr& stmt); - void process_stmt_call(const ast::stmt_call::ptr& stmt); - void process_stmt_assign(const ast::stmt_assign::ptr& stmt); - void process_stmt_endon(const ast::stmt_endon::ptr& stmt); - void process_stmt_notify(const ast::stmt_notify::ptr& stmt); - void process_stmt_wait(const ast::stmt_wait::ptr& stmt); - void process_stmt_waittill(const ast::stmt_waittill::ptr& stmt); - void process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt); - void process_stmt_if(const ast::stmt_if::ptr& stmt); - void process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt); - void process_stmt_while(const ast::stmt_while::ptr& stmt); - void process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt); - void process_stmt_for(const ast::stmt_for::ptr& stmt); - void process_stmt_foreach(const ast::stmt_foreach::ptr& stmt); - void process_stmt_switch(const ast::stmt_switch::ptr& stmt); - void process_stmt_cases(const ast::stmt_list::ptr& stmt); - void process_stmt_return(const ast::stmt_return::ptr& stmt); - void process_expr(const ast::expr& expr); - void process_expr_assign(ast::expr_assign::ptr& expr); - void process_expr_increment(const ast::expr_increment::ptr& expr); - void process_expr_decrement(const ast::expr_decrement::ptr& expr); - void process_expr_ternary(const ast::expr_ternary::ptr& expr); - void process_expr_binary(const ast::expr_binary::ptr& expr); - void process_expr_and(const ast::expr_and::ptr& expr); - void process_expr_or(const ast::expr_or::ptr& expr); - void process_expr_complement(const ast::expr_complement::ptr& expr); - void process_expr_not(const ast::expr_not::ptr& expr); - void process_expr_call(const ast::expr_call::ptr& expr); - void process_expr_method(const ast::expr_method::ptr& expr); - void process_expr_call_pointer(const ast::expr_pointer::ptr& expr); - void process_expr_call_function(const ast::expr_function::ptr& expr); - void process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj); - void process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj); - void process_expr_arguments(const ast::expr_arguments::ptr& expr); - void process_expr_size(const ast::expr_size::ptr& expr); - void process_array_variable(const ast::expr_array::ptr& expr); - void process_field_variable(const ast::expr_field::ptr& expr); - void process_expr_vector(const ast::expr_vector::ptr& expr); - void process_expr_parameters(const ast::expr_parameters::ptr& expr); -}; - -} // namespace xsk::arc::t6 diff --git a/include/xsk/t6/disassembler.hpp b/include/xsk/t6/disassembler.hpp deleted file mode 100644 index a1d41078..00000000 --- a/include/xsk/t6/disassembler.hpp +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#pragma once - -namespace xsk::arc::t6 -{ - -class disassembler : public arc::disassembler -{ - std::string filename_; - utils::reader::ptr script_; - utils::writer::ptr output_; - assembly::ptr assembly_; - std::vector exports_; - std::vector imports_; - std::vector strings_; - std::vector animtrees_; - std::map stringlist_; - std::map import_refs_; - std::map string_refs_; - std::map anim_refs_; - std::unordered_map labels_; - header header_; - -public: - auto output() -> assembly::ptr; - auto output_raw() -> std::vector; - void disassemble(const std::string& file, std::vector& data); - -private: - void disassemble_function(const function::ptr& func); - void disassemble_instruction(const instruction::ptr& inst); - void disassemble_string(const instruction::ptr& inst); - void disassemble_animtree(const instruction::ptr& inst); - void disassemble_animation(const instruction::ptr& inst); - void disassemble_localvars(const instruction::ptr& inst); - void disassemble_import(const instruction::ptr& inst); - void disassemble_jump(const instruction::ptr& inst); - void disassemble_switch(const instruction::ptr& inst); - void disassemble_end_switch(const instruction::ptr& inst); - void print_function(const function::ptr& func); - void print_instruction(const instruction::ptr& inst); -}; - -} // namespace xsk::arc::t6 diff --git a/include/xsk/t6/lexer.hpp b/include/xsk/t6/lexer.hpp deleted file mode 100644 index 9e91634b..00000000 --- a/include/xsk/t6/lexer.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#pragma once - -namespace xsk::arc::t6 -{ - -constexpr size_t max_buf_size = 0x2000; - -struct buffer -{ - char* data; - size_t length; - - buffer(); - ~buffer(); - bool push(char c); -}; - -struct reader -{ - enum state_type : std::uint8_t { end, ok }; - - const char* buffer_pos; - std::uint32_t bytes_remaining; - char last_byte; - char current_byte; - state_type state; - - reader(); - - reader(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - } - - reader& operator=(const reader& obj) - { - std::memcpy(this, &obj, sizeof(reader)); - return *this; - } - - void init(const char* data, size_t size); - void advance(); -}; - -class lexer -{ - enum class state : std::uint8_t { start, string, localize, preprocessor }; - - reader reader_; - buffer buffer_; - location loc_; - std::stack locs_; - std::stack readers_; - std::uint32_t header_top_; - state state_; - build mode_; - bool indev_; - bool clean_; - -public: - lexer(build mode, const std::string& name, const char* data, size_t size); - auto lex() -> parser::symbol_type; - void push_header(const std::string& file); - void pop_header(); - void ban_header(const location& loc); - -private: - void advance(); - void preprocessor_wrap(); - void preprocessor_run(parser::token::token_kind_type token); -}; - -} // namespace xsk::arc::t6 diff --git a/include/xsk/t6/resolver.hpp b/include/xsk/t6/resolver.hpp deleted file mode 100644 index 70d8e9e9..00000000 --- a/include/xsk/t6/resolver.hpp +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#pragma once - -namespace xsk::arc::t6 -{ - -class resolver -{ -public: - static void init(read_cb_type callback); - static void cleanup(); - static auto opcode_id(const std::string& name) -> std::uint8_t; - static auto opcode_name(std::uint8_t id) -> std::string; - static auto dvar_name(std::uint32_t id) -> std::string; - - static auto make_token(std::string_view str) -> std::string; - static auto file_data(const std::string& name) -> std::tuple; - static auto fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path; -}; - -} // namespace xsk::arc::t6 diff --git a/include/xsk/t6/t6.hpp b/include/xsk/t6/t6.hpp deleted file mode 100644 index 76bfa128..00000000 --- a/include/xsk/t6/t6.hpp +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#pragma once - -#include "xsk/stdinc.hpp" -#include "xsk/utils/string.hpp" -#include "xsk/utils/reader.hpp" -#include "xsk/utils/writer.hpp" -#include "common/arc.hpp" -#include "assembler.hpp" -#include "disassembler.hpp" -#include "compiler.hpp" -#include "decompiler.hpp" -#include "resolver.hpp" -#include "context.hpp" - -namespace xsk::arc::t6 -{ - -constexpr std::uint64_t magic = 0x06000A0D43534780; - -enum class opcode : std::uint8_t -{ - OP_End = 0x0, - OP_Return = 0x1, - OP_GetUndefined = 0x2, - OP_GetZero = 0x3, - OP_GetByte = 0x4, - OP_GetNegByte = 0x5, - OP_GetUnsignedShort = 0x6, - OP_GetNegUnsignedShort = 0x7, - OP_GetInteger = 0x8, - OP_GetFloat = 0x9, - OP_GetString = 0xA, - OP_GetIString = 0xB, - OP_GetVector = 0xC, - OP_GetLevelObject = 0xD, - OP_GetAnimObject = 0xE, - OP_GetSelf = 0xF, - OP_GetLevel = 0x10, - OP_GetGame = 0x11, - OP_GetAnim = 0x12, - OP_GetAnimation = 0x13, - OP_GetGameRef = 0x14, - OP_GetFunction = 0x15, - OP_CreateLocalVariable = 0x16, - OP_SafeCreateLocalVariables = 0x17, - OP_RemoveLocalVariables = 0x18, - OP_EvalLocalVariableCached = 0x19, - OP_EvalArray = 0x1A, - OP_EvalLocalArrayRefCached = 0x1B, - OP_EvalArrayRef = 0x1C, - OP_ClearArray = 0x1D, - OP_EmptyArray = 0x1E, - OP_GetSelfObject = 0x1F, - OP_EvalFieldVariable = 0x20, - OP_EvalFieldVariableRef = 0x21, - OP_ClearFieldVariable = 0x22, - OP_SafeSetVariableFieldCached = 0x23, - OP_SafeSetWaittillVariableFieldCached = 0x24, - OP_ClearParams = 0x25, - OP_CheckClearParams = 0x26, - OP_EvalLocalVariableRefCached = 0x27, - OP_SetVariableField = 0x28, - OP_CallBuiltin = 0x29, - OP_CallBuiltinMethod = 0x2A, - OP_Wait = 0x2B, - OP_WaitTillFrameEnd = 0x2C, - OP_PreScriptCall = 0x2D, - OP_ScriptFunctionCall = 0x2E, - OP_ScriptFunctionCallPointer = 0x2F, - OP_ScriptMethodCall = 0x30, - OP_ScriptMethodCallPointer = 0x31, - OP_ScriptThreadCall = 0x32, - OP_ScriptThreadCallPointer = 0x33, - OP_ScriptMethodThreadCall = 0x34, - OP_ScriptMethodThreadCallPointer = 0x35, - OP_DecTop = 0x36, - OP_CastFieldObject = 0x37, - OP_CastBool = 0x38, - OP_BoolNot = 0x39, - OP_BoolComplement = 0x3A, - OP_JumpOnFalse = 0x3B, - OP_JumpOnTrue = 0x3C, - OP_JumpOnFalseExpr = 0x3D, - OP_JumpOnTrueExpr = 0x3E, - OP_Jump = 0x3F, - OP_JumpBack = 0x40, - OP_Inc = 0x41, - OP_Dec = 0x42, - OP_Bit_Or = 0x43, - OP_Bit_Xor = 0x44, - OP_Bit_And = 0x45, - OP_Equal = 0x46, - OP_NotEqual = 0x47, - OP_LessThan = 0x48, - OP_GreaterThan = 0x49, - OP_LessThanOrEqualTo = 0x4A, - OP_GreaterThanOrEqualTo = 0x4B, - OP_ShiftLeft = 0x4C, - OP_ShiftRight = 0x4D, - OP_Plus = 0x4E, - OP_Minus = 0x4F, - OP_Multiply = 0x50, - OP_Divide = 0x51, - OP_Modulus = 0x52, - OP_SizeOf = 0x53, - OP_WaitTillMatch = 0x54, - OP_WaitTill = 0x55, - OP_Notify = 0x56, - OP_EndOn = 0x57, - OP_VoidCodePos = 0x58, - OP_Switch = 0x59, - OP_EndSwitch = 0x5A, - OP_Vector = 0x5B, - OP_GetHash = 0x5C, - OP_RealWait = 0x5D, - OP_VectorConstant = 0x5E, - OP_IsDefined = 0x5F, - OP_VectorScale = 0x60, - OP_AnglesToUp = 0x61, - OP_AnglesToRight = 0x62, - OP_AnglesToForward = 0x63, - OP_AngleClamp180 = 0x64, - OP_VectorToAngles = 0x65, - OP_Abs = 0x66, - OP_GetTime = 0x67, - OP_GetDvar = 0x68, - OP_GetDvarInt = 0x69, - OP_GetDvarFloat = 0x6A, - OP_GetDvarVector = 0x6B, - OP_GetDvarColorRed = 0x6C, - OP_GetDvarColorGreen = 0x6D, - OP_GetDvarColorBlue = 0x6E, - OP_GetDvarColorAlpha = 0x6F, - OP_FirstArrayKey = 0x70, - OP_NextArrayKey = 0x71, - OP_ProfileStart = 0x72, - OP_ProfileStop = 0x73, - OP_SafeDecTop = 0x74, - OP_Nop = 0x75, - OP_Abort = 0x76, - OP_Object = 0x77, - OP_ThreadObject = 0x78, - OP_EvalLocalVariable = 0x79, - OP_EvalLocalVariableRef = 0x7A, - OP_DevblockBegin = 0x7B, - OP_DevblockEnd = 0x7C, - OP_Count = 0x7D, -}; - -auto opcode_size(std::uint8_t id) -> std::uint32_t; - -} // namespace xsk::arc::t6 diff --git a/premake5.lua b/premake5.lua index 6ab96c99..a7a82c3a 100644 --- a/premake5.lua +++ b/premake5.lua @@ -83,9 +83,8 @@ project "xsk-tool" targetname "gsc-tool" dependson "xsk-utils" - -- dependson "xsk-arc" + dependson "xsk-arc" dependson "xsk-gsc" - dependson "xsk-t6" files { "./src/tool/**.h", @@ -95,9 +94,8 @@ project "xsk-tool" links { "xsk-utils", - -- "xsk-arc", + "xsk-arc", "xsk-gsc", - "xsk-t6", } includedirs { @@ -124,21 +122,21 @@ project "xsk-utils" fmt:include() zlib:include() --- project "xsk-arc" --- kind "StaticLib" --- language "C++" +project "xsk-arc" + kind "StaticLib" + language "C++" --- files { --- "./src/arc/**.h", --- "./src/arc/**.hpp", --- "./src/arc/**.cpp" --- } + files { + "./src/arc/**.h", + "./src/arc/**.hpp", + "./src/arc/**.cpp" + } --- includedirs { --- "./include", --- } + includedirs { + "./include", + } --- fmt:include() + fmt:include() project "xsk-gsc" kind "StaticLib" @@ -156,22 +154,6 @@ project "xsk-gsc" fmt:include() -project "xsk-t6" - kind "StaticLib" - language "C++" - - files { - "./src/t6/**.h", - "./src/t6/**.hpp", - "./src/t6/**.cpp" - } - - includedirs { - "./include", - } - - fmt:include() - group "Dependencies" - fmt:project() zlib:project() + fmt:project() diff --git a/src/arc/assembler.cpp b/src/arc/assembler.cpp new file mode 100644 index 00000000..4a803dbd --- /dev/null +++ b/src/arc/assembler.cpp @@ -0,0 +1,925 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "xsk/stdinc.hpp" +#include "xsk/arc/assembler.hpp" +#include "xsk/arc/context.hpp" + +namespace xsk::arc +{ + +assembler::assembler(context const* ctx) : ctx_{ ctx }, script_{ ctx->endian() == endian::big } +{ +} + +auto assembler::assemble(assembly const& data) -> buffer +{ + assembly_ = &data; + script_.clear(); + strpool_.clear(); + exports_.clear(); + imports_.clear(); + strings_.clear(); + anims_.clear(); + auto head = header{}; + + script_.pos((ctx_->props() & props::headerxx) ? 0 : (ctx_->props() & props::header72) ? 72 : 64); + process_string(""); + + for (auto const& func : assembly_->functions) + { + process_function(*func); + } + + for (auto const& incl : assembly_->includes) + { + process_string(incl); + } + + head.include_offset = script_.pos(); + head.include_count = static_cast(assembly_->includes.size()); + + for (auto const& entry : assembly_->includes) + { + script_.write(resolve_string(entry)); + } + + head.cseg_offset = script_.pos(); + + for (auto const& func : assembly_->functions) + { + script_.align((ctx_->props() & props::size64) ? 8 : 4); + script_.seek((ctx_->props() & props::size64) ? 8 : 4); + assemble_function(*func); + } + + head.cseg_size = script_.pos() - head.cseg_offset; + head.source_crc = 0; + + head.exports_offset = script_.pos(); + head.exports_count = static_cast(exports_.size()); + + for (auto const& entry : exports_) + { + script_.write(entry.checksum); + script_.write(entry.offset); + + if (ctx_->props() & props::hashids) + { + script_.write(ctx_->hash_id(entry.name)); + script_.write(ctx_->hash_id(entry.space)); + } + else + { + script_.write(resolve_string(entry.name)); + } + + script_.write(entry.params); + script_.write(entry.flags); + + if (ctx_->props() & props::hashids) + script_.seek(2); + } + + head.imports_offset = script_.pos(); + head.imports_count = static_cast(imports_.size()); + + for (auto const& entry : imports_) + { + if (ctx_->props() & props::hashids) + { + script_.write(ctx_->hash_id(entry.name)); + script_.write(ctx_->hash_id(entry.space)); + } + else + { + script_.write(resolve_string(entry.name)); + script_.write(resolve_string(entry.space)); + } + + script_.write(static_cast(entry.refs.size())); + script_.write(entry.params); + script_.write(entry.flags); + + for (auto const& ref : entry.refs) + { + script_.write(ref); + } + } + + head.animtree_offset = script_.pos(); + head.animtree_count = static_cast(anims_.size()); + + for (auto const& entry : anims_) + { + if (ctx_->props() & props::size64) + { + script_.write(resolve_string(entry.name)); + script_.write(static_cast(entry.refs.size())); + script_.write(static_cast(entry.anims.size())); + } + else + { + script_.write(resolve_string(entry.name)); + script_.write(static_cast(entry.refs.size())); + script_.write(static_cast(entry.anims.size())); + script_.seek(2); + } + + for (auto const& ref : entry.refs) + { + script_.write(ref); + } + + for (auto const& anim : entry.anims) + { + if (ctx_->props() & props::size64) + { + script_.write(resolve_string(anim.name)); + script_.write(anim.ref); + } + else + { + script_.write(resolve_string(anim.name)); + script_.write(anim.ref); + } + } + } + + head.stringtablefixup_offset = script_.pos(); + head.stringtablefixup_count = static_cast(strings_.size()); + + for (auto const& entry : strings_) + { + if (ctx_->props() & props::size64) + script_.write(resolve_string(entry.name)); + else + script_.write(resolve_string(entry.name)); + + script_.write(static_cast(entry.refs.size())); + script_.write(entry.type); + + if (ctx_->props() & props::size64) + script_.seek(2); + + for (auto const& ref : entry.refs) + { + script_.write(ref); + } + } + + if (ctx_->props() & props::devstr) + { + head.stringtablefixup_offset = script_.pos(); + head.stringtablefixup_count = 0; + } + + head.fixup_offset = script_.pos(); + head.fixup_count = 0; + + head.profile_offset = script_.pos(); + head.profile_count = 0; + + head.flags = 0; + head.name = resolve_string(""); + + auto endpos = script_.pos(); + + script_.pos(0); + script_.write(ctx_->magic()); + script_.write(head.source_crc); + script_.write(head.include_offset); + script_.write(head.animtree_offset); + script_.write(head.cseg_offset); + script_.write(head.stringtablefixup_offset); + + if (ctx_->props() & props::devstr) + script_.write(head.devblock_stringtablefixup_offset); + + script_.write(head.exports_offset); + script_.write(head.imports_offset); + script_.write(head.fixup_offset); + script_.write(head.profile_offset); + script_.write(head.cseg_size); + + if (ctx_->props() & props::size64) + script_.write(head.name); + else + script_.write(head.name); + + script_.write(head.stringtablefixup_count); + script_.write(head.exports_count); + script_.write(head.imports_count); + script_.write(head.fixup_count); + script_.write(head.profile_count); + + if (ctx_->props() & props::devstr) + script_.write(head.devblock_stringtablefixup_count); + + script_.write(head.include_count); + script_.write(head.animtree_count); + script_.write(head.flags); + script_.pos(endpos); + + return buffer{ script_.data(), script_.pos() }; +} + +auto assembler::assemble_function(function& func) -> void +{ + func.index = script_.pos(); + func.size = 0; + func_ = &func; + + for (auto& inst : func.instructions) + { + auto old_idx = inst->index; + inst->index = func.index + func.size; + + align_instruction(*inst); + + func.size += inst->size; + + auto const itr = func.labels.find(old_idx); + + if (itr != func.labels.end()) + { + func.labels.erase(old_idx); + func.labels.insert({ inst->index, itr->second }); + } + } + + script_.pos(func.index); + + for (auto const& inst : func.instructions) + { + assemble_instruction(*inst); + } + + export_ref entry; + entry.checksum = 0; + entry.offset = func.index; + entry.name = func.name; + entry.params = func.params; + entry.flags = func.flags; + exports_.push_back(entry); +} + +auto assembler::assemble_instruction(instruction const& inst) -> void +{ + script_.write(static_cast(ctx_->opcode_id(inst.opcode))); + + switch (inst.opcode) + { + case opcode::OP_End: + case opcode::OP_Return: + case opcode::OP_GetUndefined: + case opcode::OP_GetZero: + case opcode::OP_GetLevelObject: + case opcode::OP_GetAnimObject: + case opcode::OP_GetSelf: + case opcode::OP_GetLevel: + case opcode::OP_GetGame: + case opcode::OP_GetAnim: + case opcode::OP_GetGameRef: + case opcode::OP_CreateLocalVariable: + case opcode::OP_EvalArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_ClearArray: + case opcode::OP_EmptyArray: + case opcode::OP_GetSelfObject: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_ClearParams: + case opcode::OP_CheckClearParams: + case opcode::OP_SetVariableField: + case opcode::OP_Wait: + case opcode::OP_WaitTillFrameEnd: + case opcode::OP_PreScriptCall: + case opcode::OP_DecTop: + case opcode::OP_CastFieldObject: + case opcode::OP_CastBool: + case opcode::OP_BoolNot: + case opcode::OP_BoolComplement: + case opcode::OP_Inc: + case opcode::OP_Dec: + case opcode::OP_Bit_Or: + case opcode::OP_Bit_Xor: + case opcode::OP_Bit_And: + case opcode::OP_Equal: + case opcode::OP_NotEqual: + case opcode::OP_LessThan: + case opcode::OP_GreaterThan: + case opcode::OP_LessThanOrEqualTo: + case opcode::OP_GreaterThanOrEqualTo: + case opcode::OP_ShiftLeft: + case opcode::OP_ShiftRight: + case opcode::OP_Plus: + case opcode::OP_Minus: + case opcode::OP_Multiply: + case opcode::OP_Divide: + case opcode::OP_Modulus: + case opcode::OP_SizeOf: + case opcode::OP_WaitTill: + case opcode::OP_Notify: + case opcode::OP_EndOn: + case opcode::OP_VoidCodePos: + case opcode::OP_Vector: + case opcode::OP_RealWait: + case opcode::OP_IsDefined: + case opcode::OP_VectorScale: + case opcode::OP_AnglesToUp: + case opcode::OP_AnglesToRight: + case opcode::OP_AnglesToForward: + case opcode::OP_AngleClamp180: + case opcode::OP_VectorToAngles: + case opcode::OP_Abs: + case opcode::OP_GetTime: + case opcode::OP_GetDvar: + case opcode::OP_GetDvarInt: + case opcode::OP_GetDvarFloat: + case opcode::OP_GetDvarVector: + case opcode::OP_GetDvarColorRed: + case opcode::OP_GetDvarColorGreen: + case opcode::OP_GetDvarColorBlue: + case opcode::OP_GetDvarColorAlpha: + case opcode::OP_FirstArrayKey: + case opcode::OP_NextArrayKey: + case opcode::OP_ProfileStart: + case opcode::OP_ProfileStop: + case opcode::OP_SafeDecTop: + case opcode::OP_Nop: + case opcode::OP_Abort: + case opcode::OP_Object: + case opcode::OP_ThreadObject: + case opcode::OP_EvalLocalVariable: + case opcode::OP_EvalLocalVariableRef: + break; + case opcode::OP_GetByte: + case opcode::OP_GetNegByte: + script_.write(static_cast(std::stoi(inst.data[0]))); + break; + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetNegUnsignedShort: + script_.align(2); + script_.write(static_cast(std::stoi(inst.data[0]))); + break; + case opcode::OP_GetInteger: + script_.align(4); + script_.write((inst.data.size() == 2) ? -1 : std::stoi(inst.data[0])); + break; + case opcode::OP_GetFloat: + script_.align(4); + script_.write(std::stof(inst.data[0])); + break; + case opcode::OP_GetVector: + script_.align(4); + script_.write(std::stof(inst.data[0])); + script_.write(std::stof(inst.data[1])); + script_.write(std::stof(inst.data[2])); + break; + case opcode::OP_GetString: + case opcode::OP_GetIString: + script_.align(2); + script_.write(0); + break; + case opcode::OP_GetAnimation: + script_.align(4); + script_.write(0); + break; + case opcode::OP_WaitTillMatch: + script_.write(static_cast(std::stoi(inst.data[0]))); + break; + case opcode::OP_VectorConstant: + script_.write(static_cast(std::stoi(inst.data[0]))); + break; + case opcode::OP_GetHash: + script_.align(4); + script_.write(static_cast(std::stoul(inst.data[0], 0, 16))); + break; + case opcode::OP_SafeCreateLocalVariables: + assemble_localvars(inst); + break; + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_EvalLocalVariableRefCached: + script_.write(static_cast(std::stoi(inst.data[0]))); + break; + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_ClearFieldVariable: + script_.align(2); + script_.write(0); + break; + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_ScriptMethodThreadCallPointer: + script_.write(static_cast(std::stoi(inst.data[0]))); + break; + case opcode::OP_GetFunction: + script_.align(4); + script_.write(0); + break; + case opcode::OP_CallBuiltin: + case opcode::OP_CallBuiltinMethod: + case opcode::OP_ScriptFunctionCall: + case opcode::OP_ScriptMethodCall: + case opcode::OP_ScriptThreadCall: + case opcode::OP_ScriptMethodThreadCall: + script_.write(0); + script_.align(4); + script_.write(0); + break; + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_Jump: + case opcode::OP_JumpBack: + case opcode::OP_DevblockBegin: + assemble_jump(inst); + break; + case opcode::OP_Switch: + assemble_switch(inst); + break; + case opcode::OP_EndSwitch: + assemble_end_switch(inst); + break; + default: + throw asm_error(fmt::format("unhandled opcode {} at index {:04X}", ctx_->opcode_name(inst.opcode), inst.index)); + } +} + +auto assembler::assemble_localvars(instruction const& inst) -> void +{ + script_.write(static_cast(inst.data.size())); + + for (auto i = 0u; i < inst.data.size(); i++) + { + script_.align(2); + script_.write(0); + } +} + +auto assembler::assemble_jump(instruction const& inst) -> void +{ + auto const addr = static_cast(resolve_label(inst.data[0]) - inst.index - inst.size); + + script_.align(2); + script_.write(addr); +} + +auto assembler::assemble_switch(instruction const& inst) -> void +{ + const i32 addr = ((resolve_label(inst.data[0]) + 4) & 0xFFFFFFFC) - inst.index - inst.size; + + script_.align(4); + script_.write(addr); +} + +auto assembler::assemble_end_switch(instruction const& inst) -> void +{ + const auto count = std::stoul(inst.data[0]); + const auto numerical = inst.data.back() == "i"; + + script_.align(4); + script_.write(count); + + for (auto i = 0u; i < count; i++) + { + if (inst.data[1 + (3 * i)] == "case") + { + if (numerical /*&& utils::string::is_number(inst->data[1 + (3 * i) + 1])*/) + { + script_.write((std::stoi(inst.data[1 + (3 * i) + 1]) & 0xFFFFFF) + 0x800000); + } + else + { + script_.write(i + 1); + } + + const i32 addr = resolve_label(inst.data[1 + (3 * i) + 2]) - script_.pos() - 4; + + script_.write(addr); + } + else if (inst.data[1 + (3 * i)] == "default") + { + script_.write(0); + + const i32 addr = resolve_label(inst.data[1 + (3 * i) + 1]) - script_.pos() - 4; + + script_.write(addr); + } + else + { + throw asm_error("invalid switch case '" + inst.data[1 + (3 * i)] + "'!"); + } + } +} + +auto assembler::process_string(std::string const& data) -> void +{ + if (!strpool_.contains(data)) + { + auto pos = static_cast(script_.pos()); + script_.write_cstr(data); + strpool_.insert({ data, pos }); + } +} + +auto assembler::process_function(function const& func) -> void +{ + process_string(func.name); + + for (auto const& inst : func.instructions) + { + process_instruction(*inst); + } +} + +auto assembler::process_instruction(instruction const& inst) -> void +{ + switch (inst.opcode) + { + case opcode::OP_GetInteger: + if (inst.data.size() == 2) + process_string(inst.data[0]); + break; + case opcode::OP_GetString: + case opcode::OP_GetIString: + process_string(inst.data[0]); + break; + case opcode::OP_GetAnimation: + process_string(inst.data[0]); + process_string(inst.data[1]); + break; + case opcode::OP_SafeCreateLocalVariables: + { + for (auto const& entry : inst.data) + { + process_string(entry); + } + + break; + } + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_ClearFieldVariable: + process_string(inst.data[0]); + break; + case opcode::OP_GetFunction: + process_string(inst.data[0]); + process_string(inst.data[1]); + break; + case opcode::OP_CallBuiltin: + case opcode::OP_CallBuiltinMethod: + case opcode::OP_ScriptFunctionCall: + case opcode::OP_ScriptMethodCall: + case opcode::OP_ScriptThreadCall: + case opcode::OP_ScriptMethodThreadCall: + process_string(inst.data[0]); + process_string(inst.data[1]); + break; + case opcode::OP_EndSwitch: + { + const auto count = std::stoul(inst.data[0]); + const auto numerical = inst.data.back() == "i"; + + for (auto i = 0u; i < count; i++) + { + if (inst.data[1 + (3 * i)] == "case") + { + if (!numerical /*|| !utils::string::is_number(inst->data[1 + (3 * i) + 1])*/) + { + process_string(inst.data[1 + (3 * i) + 1]); + } + } + } + + break; + } + default: + break; + } +} + +auto assembler::align_instruction(instruction& inst) -> void +{ + inst.size = ctx_->opcode_size(inst.opcode); + script_.seek(1); + + switch (inst.opcode) + { + case opcode::OP_End: + case opcode::OP_Return: + case opcode::OP_GetUndefined: + case opcode::OP_GetZero: + case opcode::OP_GetLevelObject: + case opcode::OP_GetAnimObject: + case opcode::OP_GetSelf: + case opcode::OP_GetLevel: + case opcode::OP_GetGame: + case opcode::OP_GetAnim: + case opcode::OP_GetGameRef: + case opcode::OP_CreateLocalVariable: + case opcode::OP_EvalArray: + case opcode::OP_EvalArrayRef: + case opcode::OP_ClearArray: + case opcode::OP_EmptyArray: + case opcode::OP_GetSelfObject: + case opcode::OP_SafeSetVariableFieldCached: + case opcode::OP_ClearParams: + case opcode::OP_CheckClearParams: + case opcode::OP_SetVariableField: + case opcode::OP_Wait: + case opcode::OP_WaitTillFrameEnd: + case opcode::OP_PreScriptCall: + case opcode::OP_DecTop: + case opcode::OP_CastFieldObject: + case opcode::OP_CastBool: + case opcode::OP_BoolNot: + case opcode::OP_BoolComplement: + case opcode::OP_Inc: + case opcode::OP_Dec: + case opcode::OP_Bit_Or: + case opcode::OP_Bit_Xor: + case opcode::OP_Bit_And: + case opcode::OP_Equal: + case opcode::OP_NotEqual: + case opcode::OP_LessThan: + case opcode::OP_GreaterThan: + case opcode::OP_LessThanOrEqualTo: + case opcode::OP_GreaterThanOrEqualTo: + case opcode::OP_ShiftLeft: + case opcode::OP_ShiftRight: + case opcode::OP_Plus: + case opcode::OP_Minus: + case opcode::OP_Multiply: + case opcode::OP_Divide: + case opcode::OP_Modulus: + case opcode::OP_SizeOf: + case opcode::OP_WaitTill: + case opcode::OP_Notify: + case opcode::OP_EndOn: + case opcode::OP_VoidCodePos: + case opcode::OP_Vector: + case opcode::OP_RealWait: + case opcode::OP_IsDefined: + case opcode::OP_VectorScale: + case opcode::OP_AnglesToUp: + case opcode::OP_AnglesToRight: + case opcode::OP_AnglesToForward: + case opcode::OP_AngleClamp180: + case opcode::OP_VectorToAngles: + case opcode::OP_Abs: + case opcode::OP_GetTime: + case opcode::OP_GetDvar: + case opcode::OP_GetDvarInt: + case opcode::OP_GetDvarFloat: + case opcode::OP_GetDvarVector: + case opcode::OP_GetDvarColorRed: + case opcode::OP_GetDvarColorGreen: + case opcode::OP_GetDvarColorBlue: + case opcode::OP_GetDvarColorAlpha: + case opcode::OP_FirstArrayKey: + case opcode::OP_NextArrayKey: + case opcode::OP_ProfileStart: + case opcode::OP_ProfileStop: + case opcode::OP_SafeDecTop: + case opcode::OP_Nop: + case opcode::OP_Abort: + case opcode::OP_Object: + case opcode::OP_ThreadObject: + case opcode::OP_EvalLocalVariable: + case opcode::OP_EvalLocalVariableRef: + break; + case opcode::OP_GetByte: + case opcode::OP_GetNegByte: + script_.seek(1); + break; + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetNegUnsignedShort: + inst.size += script_.align(2); + script_.seek(2); + break; + case opcode::OP_GetInteger: + inst.size += script_.align(4); + if (inst.data.size() == 2) + add_animref(inst.data, script_.pos()); + script_.seek(4); + break; + case opcode::OP_GetFloat: + inst.size += script_.align(4); + script_.seek(4); + break; + case opcode::OP_GetVector: + inst.size += script_.align(4); + script_.seek(12); + break; + case opcode::OP_GetString: + case opcode::OP_GetIString: + inst.size += script_.align(2); + add_stringref(inst.data[0], string_type::literal, script_.pos()); + script_.seek(2); + break; + case opcode::OP_GetAnimation: + inst.size += script_.align(4); + add_animref(inst.data, script_.pos()); + script_.seek(4); + break; + case opcode::OP_WaitTillMatch: + script_.seek(1); + break; + case opcode::OP_VectorConstant: + script_.seek(1); + break; + case opcode::OP_GetHash: + inst.size += script_.align(4); + script_.seek(4); + break; + case opcode::OP_SafeCreateLocalVariables: + { + script_.seek(1); + + for (auto i = 0u; i < inst.data.size(); i++) + { + inst.size += script_.align(2) + 2; + add_stringref(inst.data[i], string_type::canonical, script_.pos()); + script_.seek(2); + } + + break; + } + case opcode::OP_RemoveLocalVariables: + case opcode::OP_EvalLocalVariableCached: + case opcode::OP_EvalLocalArrayRefCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_EvalLocalVariableRefCached: + script_.seek(1); + break; + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_ClearFieldVariable: + inst.size += script_.align(2); + add_stringref(inst.data[0], string_type::canonical, script_.pos()); + script_.seek(2); + break; + case opcode::OP_ScriptFunctionCallPointer: + case opcode::OP_ScriptMethodCallPointer: + case opcode::OP_ScriptThreadCallPointer: + case opcode::OP_ScriptMethodThreadCallPointer: + script_.seek(1); + break; + case opcode::OP_GetFunction: + inst.size += script_.align(4); + script_.seek(4); + add_importref(inst.data, inst.index); + break; + case opcode::OP_CallBuiltin: + case opcode::OP_CallBuiltinMethod: + case opcode::OP_ScriptFunctionCall: + case opcode::OP_ScriptMethodCall: + case opcode::OP_ScriptThreadCall: + case opcode::OP_ScriptMethodThreadCall: + script_.seek(1); + inst.size += script_.align(4); + script_.seek(4); + add_importref(inst.data, inst.index); + break; + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_Jump: + case opcode::OP_JumpBack: + case opcode::OP_DevblockBegin: + inst.size += script_.align(2); + script_.seek(2); + break; + case opcode::OP_Switch: + inst.size += script_.align(4); + script_.seek(4); + break; + case opcode::OP_EndSwitch: + { + inst.size += script_.align(4); + script_.seek(4); + + const auto count = std::stoul(inst.data[0]); + const auto numerical = inst.data.back() == "i"; + + for (auto i = 0u; i < count; i++) + { + if (inst.data[1 + (3 * i)] == "case") + { + if (!numerical /*|| !utils::string::is_number(inst.data[1 + (3 * i) + 1])*/) + { + add_stringref(inst.data[1 + (3 * i) + 1], string_type::literal, script_.pos() + 2); + } + } + + inst.size += 8; + script_.seek(8); + } + + break; + } + default: + throw asm_error(fmt::format("unhandled opcode {} at index {:04X}", ctx_->opcode_name(inst.opcode), inst.index)); + } +} + +auto assembler::resolve_label(std::string const& name) -> i32 +{ + for (auto const& entry : func_->labels) + { + if (entry.second == name) + { + return entry.first; + } + } + + throw asm_error("couldn't resolve label address of '" + name + "'!"); +} + +auto assembler::resolve_string(std::string const& name) -> u16 +{ + auto const itr = strpool_.find(name); + + if (itr != strpool_.end()) + { + return itr->second; + } + + throw asm_error("couldn't resolve string assembly address of '" + name + "'!"); +} + +void assembler::add_stringref(std::string const& str, string_type type, u32 ref) +{ + for (auto& entry : strings_) + { + if (entry.name == str && entry.type == static_cast(type)) + { + entry.refs.push_back(ref); + return; + } + } + + strings_.push_back({ str, u8(type), { ref } }); +} + +void assembler::add_importref(std::vector const& data, u32 ref) +{ + for (auto& entry : imports_) + { + if (entry.space == data[0] && entry.name == data[1] && entry.params == std::stoi(data[2]) && entry.flags == std::stoi(data[3])) + { + entry.refs.push_back(ref); + return; + } + } + + import_ref new_entry; + new_entry.space = data[0]; + new_entry.name = data[1]; + new_entry.params = static_cast(std::stoi(data[2])); + new_entry.flags = static_cast(std::stoi(data[3])); + new_entry.refs.push_back(ref); + imports_.push_back(std::move(new_entry)); +} + +void assembler::add_animref(std::vector const& data, u32 ref) +{ + for (auto& entry : anims_) + { + if (entry.name == data[0]) + { + if (data[1] == "-1") + { + entry.refs.push_back(ref); + } + else + { + entry.anims.push_back({ data[1], ref }); + } + return; + } + } + + animtree_ref new_entry; + new_entry.name = data[0]; + if (data[1] == "-1") + { + new_entry.refs.push_back(ref); + } + else + { + new_entry.anims.push_back({ data[1], ref }); + } + anims_.push_back(std::move(new_entry)); +} + +} // namespace xsk::arc diff --git a/src/arc/common/ast.cpp b/src/arc/common/ast.cpp index 1d95aa7f..c113476b 100644 --- a/src/arc/common/ast.cpp +++ b/src/arc/common/ast.cpp @@ -86,46 +86,37 @@ auto node::is_boolean() -> bool reinterpret_cast(this)->value == "0"; case type::expr_true: case type::expr_false: - case type::expr_or: - case type::expr_and: - case type::expr_super_equal: - case type::expr_super_not_equal: - case type::expr_equality: - case type::expr_inequality: - case type::expr_less: - case type::expr_greater: - case type::expr_less_equal: - case type::expr_greater_equal: return true; + case type::expr_binary: + switch (reinterpret_cast(this)->oper) + { + case expr_binary::op::bool_or: + case expr_binary::op::bool_and: + case expr_binary::op::seq: + case expr_binary::op::sne: + case expr_binary::op::eq: + case expr_binary::op::ne: + case expr_binary::op::le: + case expr_binary::op::ge: + case expr_binary::op::lt: + case expr_binary::op::gt: + return true; + default: + return false; + } + return false; default: return false; } } -auto node::is_binary() -> bool +auto node::is_assign() -> bool { switch (kind_) { - case type::expr_or: - case type::expr_and: - case type::expr_bitwise_or: - case type::expr_bitwise_exor: - case type::expr_bitwise_and: - case type::expr_super_equal: - case type::expr_super_not_equal: - case type::expr_equality: - case type::expr_inequality: - case type::expr_less: - case type::expr_greater: - case type::expr_less_equal: - case type::expr_greater_equal: - case type::expr_shift_left: - case type::expr_shift_right: - case type::expr_add: - case type::expr_sub: - case type::expr_mul: - case type::expr_div: - case type::expr_mod: + case type::expr_assign: + case type::expr_increment: + case type::expr_decrement: return true; default: return false; @@ -134,540 +125,760 @@ auto node::is_binary() -> bool auto node::precedence() -> u8 { - switch (kind_) + return 0; +} + +auto expr_binary::precedence() -> u8 +{ + switch (oper) { - case type::expr_or: return 1; - case type::expr_and: return 2; - case type::expr_bitwise_or: return 3; - case type::expr_bitwise_exor: return 4; - case type::expr_bitwise_and: return 5; - case type::expr_super_equal: return 6; - case type::expr_super_not_equal: return 6; - case type::expr_equality: return 6; - case type::expr_inequality: return 6; - case type::expr_less: return 7; - case type::expr_greater: return 7; - case type::expr_less_equal: return 7; - case type::expr_greater_equal: return 7; - case type::expr_shift_left: return 8; - case type::expr_shift_right: return 8; - case type::expr_add: return 9; - case type::expr_sub: return 9; - case type::expr_mul: return 10; - case type::expr_div: return 10; - case type::expr_mod: return 10; + case op::bool_or: return 1; + case op::bool_and: return 2; + case op::bwor: return 3; + case op::bwexor: return 4; + case op::bwand: return 5; + case op::seq: return 6; + case op::sne: return 6; + case op::eq: return 6; + case op::ne: return 6; + case op::lt: return 7; + case op::gt: return 7; + case op::le: return 7; + case op::ge: return 7; + case op::shl: return 8; + case op::shr: return 8; + case op::add: return 9; + case op::sub: return 9; + case op::mul: return 10; + case op::div: return 10; + case op::mod: return 10; default: return 0; } } -expr_true::expr_true(location const& loc) : node{ type::expr_true, loc } -{ -} -expr_false::expr_false(location const& loc) : node{ type::expr_false, loc } +template +auto node::as(node::ptr) -> std::unique_ptr { + static_assert(std::is_same_v, "invalid cast"); } -expr_integer::expr_integer(location const& loc, std::string const& value) : node{ type::expr_integer, loc }, value{ std::move(value) } +template<> +auto node::as(node::ptr from) -> std::unique_ptr { + return std::unique_ptr(static_cast(from.release())); } -expr_float::expr_float(location const& loc, std::string const& value) : node{ type::expr_float, loc }, value{ std::move(value) } +template<> +auto node::as(node::ptr from) -> std::unique_ptr { + return std::unique_ptr(static_cast(from.release())); } -expr_vector::expr_vector(location const& loc, expr x, expr y, expr z) : node{ type::expr_vector, loc }, x{ std::move(x) }, y{ std::move(y) }, z{ std::move(z) } -{ -} +expr::expr(type t) : node{ t } {} +expr::expr(type t, location const& loc) : node{ t, loc } {} -expr_hash::expr_hash(location const& loc, const std::string& value) : node{ type::expr_hash, loc }, value{ value } -{ -} -expr_string::expr_string(location const& loc, const std::string& value) : node{ type::expr_string, loc }, value{ value } +template +auto expr::is() const -> bool { + static_assert(std::is_same_v, "invalid test"); } -expr_istring::expr_istring(location const& loc, const std::string& value) : node{ type::expr_istring, loc }, value{ std::move(value) } +template +auto expr::as() const -> T const& { + static_assert(std::is_same_v, "invalid cast"); } -expr_path::expr_path(location const& loc) : node{ type::expr_path, loc } +template +auto expr::as() -> T& { + static_assert(std::is_same_v, "invalid cast"); } -expr_path::expr_path(location const& loc, std::string const& value) : node{ type::expr_path, loc }, value{ value } -{ -} +call::call(node::type t) : expr{ t } {} +call::call(node::type t, location const& loc) : expr{ t, loc } {} -expr_identifier::expr_identifier(location const& loc, std::string const& value) : node{ type::expr_identifier, loc }, value{ value } +template +auto call::is() const -> bool { + static_assert(std::is_same_v, "invalid test"); } -expr_animtree::expr_animtree(location const& loc) : node{ type::expr_animtree, loc } +template +auto call::as() const -> T const& { + static_assert(std::is_same_v, "invalid cast"); } -expr_animation::expr_animation(location const& loc, std::string const& value) : node{ type::expr_animation, loc }, value{ value } +template +auto call::as() -> T& { + static_assert(std::is_same_v, "invalid cast"); } -expr_classes::expr_classes(location const& loc) : node{ type::expr_classes, loc } +stmt::stmt(type t) : node{ t } {} +stmt::stmt(type t, location const& loc) : node{ t, loc } {} + +template +auto stmt::is() const -> bool { + static_assert(std::is_same_v, "invalid test"); } -expr_world::expr_world(location const& loc) : node{ type::expr_world, loc } +template +auto stmt::as() const -> T const& { + static_assert(std::is_same_v, "invalid cast"); } -expr_level::expr_level(location const& loc) : node{ type::expr_level, loc } +template +auto stmt::as() -> T& { + static_assert(std::is_same_v, "invalid cast"); } -expr_anim::expr_anim(location const& loc) : node{ type::expr_anim, loc } +decl::decl(type t) : node{ t } {} +decl::decl(type t, location const& loc) : node{ t, loc } {} + +template +auto decl::is() const -> bool { + static_assert(std::is_same_v, "invalid test"); } -expr_self::expr_self(location const& loc) : node{ type::expr_self, loc } +template +auto decl::as() const -> T const& { + static_assert(std::is_same_v, "invalid cast"); } -expr_game::expr_game(location const& loc) : node{ type::expr_game, loc } +template +auto decl::as() -> T& { + static_assert(std::is_same_v, "invalid cast"); } -expr_undefined::expr_undefined(location const& loc) : node{ type::expr_undefined, loc } +#define XSK_ARC_EXPR_IS(expr_type) \ +template<> \ +auto expr::is() const -> bool \ +{ \ + return kind() == type::expr_type; \ +} \ + \ +template<> \ +auto expr::as() -> arc::expr_type & \ +{ \ + return static_cast(*this); \ +} \ + \ +template<> \ +auto expr::as() const -> arc::expr_type const& \ +{ \ + return static_cast(*this); \ +} \ + +#define XSK_ARC_CALL_IS(expr_type) \ +template<> \ +auto call::is() const -> bool \ +{ \ + return kind() == node::type::expr_type; \ +} \ + \ +template<> \ +auto call::as() -> arc::expr_type & \ +{ \ + return static_cast(*this); \ +} \ + \ +template<> \ +auto call::as() const -> arc::expr_type const& \ +{ \ + return static_cast(*this); \ +} \ + +#define XSK_ARC_STMT_IS(expr_type) \ +template<> \ +auto stmt::is() const -> bool \ +{ \ + return kind() == type::expr_type; \ +} \ + \ +template<> \ +auto stmt::as() -> arc::expr_type & \ +{ \ + return static_cast(*this); \ +} \ + \ +template<> \ +auto stmt::as() const -> arc::expr_type const& \ +{ \ + return static_cast(*this); \ +} \ + +#define XSK_ARC_DECL_IS(expr_type) \ +template<> \ +auto decl::is() const -> bool \ +{ \ + return kind() == type::expr_type; \ +} \ + \ +template<> \ +auto decl::as() -> arc::expr_type & \ +{ \ + return static_cast(*this); \ +} \ + \ +template<> \ +auto decl::as() const -> arc::expr_type const& \ +{ \ + return static_cast(*this); \ +} \ + +XSK_ARC_EXPR_IS(expr_empty) +XSK_ARC_EXPR_IS(expr_true) +XSK_ARC_EXPR_IS(expr_false) +XSK_ARC_EXPR_IS(expr_integer) +XSK_ARC_EXPR_IS(expr_float) +XSK_ARC_EXPR_IS(expr_vector) +XSK_ARC_EXPR_IS(expr_hash) +XSK_ARC_EXPR_IS(expr_string) +XSK_ARC_EXPR_IS(expr_istring) +XSK_ARC_EXPR_IS(expr_path) +XSK_ARC_EXPR_IS(expr_identifier) +XSK_ARC_EXPR_IS(expr_animtree) +XSK_ARC_EXPR_IS(expr_animation) +XSK_ARC_EXPR_IS(expr_classes) +XSK_ARC_EXPR_IS(expr_world) +XSK_ARC_EXPR_IS(expr_level) +XSK_ARC_EXPR_IS(expr_anim) +XSK_ARC_EXPR_IS(expr_self) +XSK_ARC_EXPR_IS(expr_game) +XSK_ARC_EXPR_IS(expr_undefined) +XSK_ARC_EXPR_IS(expr_empty_array) +XSK_ARC_EXPR_IS(expr_ellipsis) +XSK_ARC_EXPR_IS(expr_paren) +XSK_ARC_EXPR_IS(expr_size) +XSK_ARC_EXPR_IS(expr_field) +XSK_ARC_EXPR_IS(expr_array) +XSK_ARC_EXPR_IS(expr_reference) +XSK_ARC_EXPR_IS(expr_getnextarraykey) +XSK_ARC_EXPR_IS(expr_getfirstarraykey) +XSK_ARC_EXPR_IS(expr_getdvarcoloralpha) +XSK_ARC_EXPR_IS(expr_getdvarcolorblue) +XSK_ARC_EXPR_IS(expr_getdvarcolorgreen) +XSK_ARC_EXPR_IS(expr_getdvarcolorred) +XSK_ARC_EXPR_IS(expr_getdvarvector) +XSK_ARC_EXPR_IS(expr_getdvarfloat) +XSK_ARC_EXPR_IS(expr_getdvarint) +XSK_ARC_EXPR_IS(expr_getdvar) +XSK_ARC_EXPR_IS(expr_gettime) +XSK_ARC_EXPR_IS(expr_abs) +XSK_ARC_EXPR_IS(expr_vectortoangles) +XSK_ARC_EXPR_IS(expr_angleclamp180) +XSK_ARC_EXPR_IS(expr_anglestoforward) +XSK_ARC_EXPR_IS(expr_anglestoright) +XSK_ARC_EXPR_IS(expr_anglestoup) +XSK_ARC_EXPR_IS(expr_vectorscale) +XSK_ARC_EXPR_IS(expr_isdefined) +XSK_ARC_EXPR_IS(expr_arguments) +XSK_ARC_EXPR_IS(expr_parameters) +XSK_ARC_EXPR_IS(expr_member) +XSK_ARC_EXPR_IS(expr_pointer) +XSK_ARC_EXPR_IS(expr_function) +XSK_ARC_EXPR_IS(expr_method) +XSK_ARC_EXPR_IS(expr_call) +XSK_ARC_EXPR_IS(expr_new) +XSK_ARC_EXPR_IS(expr_complement) +XSK_ARC_EXPR_IS(expr_negate) +XSK_ARC_EXPR_IS(expr_not) +XSK_ARC_EXPR_IS(expr_binary) +XSK_ARC_EXPR_IS(expr_ternary) +XSK_ARC_EXPR_IS(expr_const) +XSK_ARC_EXPR_IS(expr_assign) +XSK_ARC_EXPR_IS(expr_increment) +XSK_ARC_EXPR_IS(expr_decrement) + +XSK_ARC_CALL_IS(expr_member) +XSK_ARC_CALL_IS(expr_pointer) +XSK_ARC_CALL_IS(expr_function) + +XSK_ARC_STMT_IS(stmt_empty) +XSK_ARC_STMT_IS(stmt_list) +XSK_ARC_STMT_IS(stmt_comp) +XSK_ARC_STMT_IS(stmt_dev) +XSK_ARC_STMT_IS(stmt_expr) +XSK_ARC_STMT_IS(stmt_endon) +XSK_ARC_STMT_IS(stmt_notify) +XSK_ARC_STMT_IS(stmt_wait) +XSK_ARC_STMT_IS(stmt_waittill) +XSK_ARC_STMT_IS(stmt_waittillmatch) +XSK_ARC_STMT_IS(stmt_waittillframeend) +XSK_ARC_STMT_IS(stmt_waitrealtime) +XSK_ARC_STMT_IS(stmt_if) +XSK_ARC_STMT_IS(stmt_ifelse) +XSK_ARC_STMT_IS(stmt_while) +XSK_ARC_STMT_IS(stmt_dowhile) +XSK_ARC_STMT_IS(stmt_for) +XSK_ARC_STMT_IS(stmt_foreach) +XSK_ARC_STMT_IS(stmt_switch) +XSK_ARC_STMT_IS(stmt_case) +XSK_ARC_STMT_IS(stmt_default) +XSK_ARC_STMT_IS(stmt_break) +XSK_ARC_STMT_IS(stmt_continue) +XSK_ARC_STMT_IS(stmt_return) +XSK_ARC_STMT_IS(stmt_breakpoint) +XSK_ARC_STMT_IS(stmt_prof_begin) +XSK_ARC_STMT_IS(stmt_prof_end) +XSK_ARC_STMT_IS(stmt_jmp) +XSK_ARC_STMT_IS(stmt_jmp_back) +XSK_ARC_STMT_IS(stmt_jmp_cond) +XSK_ARC_STMT_IS(stmt_jmp_true) +XSK_ARC_STMT_IS(stmt_jmp_false) +XSK_ARC_STMT_IS(stmt_jmp_switch) +XSK_ARC_STMT_IS(stmt_jmp_endswitch) +XSK_ARC_STMT_IS(stmt_jmp_dev) + +XSK_ARC_DECL_IS(decl_empty) +XSK_ARC_DECL_IS(decl_function) +XSK_ARC_DECL_IS(decl_usingtree) +XSK_ARC_DECL_IS(decl_namespace) +XSK_ARC_DECL_IS(decl_dev_begin) +XSK_ARC_DECL_IS(decl_dev_end) + +node_prescriptcall::node_prescriptcall(location const& loc) : node{ type::node_prescriptcall, loc } { } -expr_empty_array::expr_empty_array(location const& loc) : node{ type::expr_empty_array, loc } +node_voidcodepos::node_voidcodepos(location const& loc) : node{ type::node_voidcodepos, loc } { } -expr_paren::expr_paren(location const& loc, expr value) : node{ type::expr_paren, loc }, value{ std::move(value) } +expr_empty::expr_empty(location const& loc) : expr{ type::expr_empty, loc } { } -expr_size::expr_size(location const& loc, expr obj) : node{ type::expr_size, loc }, obj{ std::move(obj) } +expr_true::expr_true(location const& loc) : expr{ type::expr_true, loc } { } -expr_field::expr_field(location const& loc, expr obj, expr_identifier::ptr field) : node{ type::expr_field, loc }, obj{ std::move(obj) }, field{ std::move(field) } +expr_false::expr_false(location const& loc) : expr{ type::expr_false, loc } { } -expr_array::expr_array(location const& loc, expr obj, expr key) : node{ type::expr_array, loc }, obj{ std::move(obj) }, key{ std::move(key) } +expr_integer::expr_integer(location const& loc, std::string const& value) : expr{ type::expr_integer, loc }, value{ std::move(value) } { } -expr_reference::expr_reference(location const& loc, expr_path::ptr path, expr_identifier::ptr name) : node{ type::expr_reference, loc }, path{ std::move(path) }, name{ std::move(name) } +expr_float::expr_float(location const& loc, std::string const& value) : expr{ type::expr_float, loc }, value{ std::move(value) } { } -expr_getnextarraykey::expr_getnextarraykey(location const& loc, expr arg1, expr arg2) : node{ type::expr_getnextarraykey, loc }, arg1{ std::move(arg1) }, arg2{ std::move(arg2) } +expr_vector::expr_vector(location const& loc, expr::ptr x, expr::ptr y, expr::ptr z) : expr{ type::expr_vector, loc }, x{ std::move(x) }, y{ std::move(y) }, z{ std::move(z) } { } -expr_getfirstarraykey::expr_getfirstarraykey(location const& loc, expr arg) : node{ type::expr_getfirstarraykey, loc }, arg{ std::move(arg) } +expr_hash::expr_hash(location const& loc, std::string const& value) : expr{ type::expr_hash, loc }, value{ value } { } -expr_getdvarcoloralpha::expr_getdvarcoloralpha(location const& loc, expr arg) : node{ type::expr_getdvarcoloralpha, loc }, arg{ std::move(arg) } +expr_string::expr_string(location const& loc, const std::string& value) : expr{ type::expr_string, loc }, value{ value } { } -expr_getdvarcolorblue::expr_getdvarcolorblue(location const& loc, expr arg) : node{ type::expr_getdvarcolorblue, loc }, arg{ std::move(arg) } +expr_istring::expr_istring(location const& loc, const std::string& value) : expr{ type::expr_istring, loc }, value{ std::move(value) } { } -expr_getdvarcolorgreen::expr_getdvarcolorgreen(location const& loc, expr arg) : node{ type::expr_getdvarcolorgreen, loc }, arg{ std::move(arg) } +expr_path::expr_path(location const& loc) : expr{ type::expr_path, loc } { } -expr_getdvarcolorred::expr_getdvarcolorred(location const& loc, expr arg) : node{ type::expr_getdvarcolorred, loc }, arg{ std::move(arg) } +expr_path::expr_path(location const& loc, std::string const& value) : expr{ type::expr_path, loc }, value{ value } { } -expr_getdvarvector::expr_getdvarvector(location const& loc, expr arg) : node{ type::expr_getdvarvector, loc }, arg{ std::move(arg) } +expr_identifier::expr_identifier(location const& loc, std::string const& value) : expr{ type::expr_identifier, loc }, value{ value } { } -expr_getdvarfloat::expr_getdvarfloat(location const& loc, expr arg) : node{ type::expr_getdvarfloat, loc }, arg{ std::move(arg) } +expr_animtree::expr_animtree(location const& loc) : expr{ type::expr_animtree, loc } { } -expr_getdvarint::expr_getdvarint(location const& loc, expr arg) : node{ type::expr_getdvarint, loc }, arg{ std::move(arg) } +expr_animation::expr_animation(location const& loc, std::string const& value) : expr{ type::expr_animation, loc }, value{ value } { } -expr_getdvar::expr_getdvar(location const& loc, expr arg) : node{ type::expr_getdvar, loc }, arg{ std::move(arg) } +expr_classes::expr_classes(location const& loc) : expr{ type::expr_classes, loc } { } -expr_gettime::expr_gettime(location const& loc) : node{ type::expr_gettime, loc } +expr_world::expr_world(location const& loc) : expr{ type::expr_world, loc } { } -expr_abs::expr_abs(location const& loc, expr arg) : node{ type::expr_abs, loc }, arg{ std::move(arg) } +expr_level::expr_level(location const& loc) : expr{ type::expr_level, loc } { } -expr_vectortoangles::expr_vectortoangles(location const& loc, expr arg) : node{ type::expr_vectortoangles, loc }, arg{ std::move(arg) } +expr_anim::expr_anim(location const& loc) : expr{ type::expr_anim, loc } { } -expr_angleclamp180::expr_angleclamp180(location const& loc, expr arg) : node{ type::expr_angleclamp180, loc }, arg{ std::move(arg) } +expr_self::expr_self(location const& loc) : expr{ type::expr_self, loc } { } -expr_anglestoforward::expr_anglestoforward(location const& loc, expr arg) : node{ type::expr_anglestoforward, loc }, arg{ std::move(arg) } +expr_game::expr_game(location const& loc) : expr{ type::expr_game, loc } { } -expr_anglestoright::expr_anglestoright(location const& loc, expr arg) : node{ type::expr_anglestoright, loc }, arg{ std::move(arg) } +expr_undefined::expr_undefined(location const& loc) : expr{ type::expr_undefined, loc } { } -expr_anglestoup::expr_anglestoup(location const& loc, expr arg) : node{ type::expr_anglestoup, loc }, arg{ std::move(arg) } +expr_empty_array::expr_empty_array(location const& loc) : expr{ type::expr_empty_array, loc } { } -expr_vectorscale::expr_vectorscale(location const& loc, expr arg1, expr arg2) : node{ type::expr_vectorscale, loc }, arg1{ std::move(arg1) }, arg2{ std::move(arg2) } +expr_ellipsis::expr_ellipsis(location const& loc) : expr{ type::expr_ellipsis, loc } { } -expr_isdefined::expr_isdefined(location const& loc, expr value) : node{ type::expr_isdefined, loc }, value{ std::move(value) } +expr_paren::expr_paren(location const& loc, expr::ptr value) : expr{ type::expr_paren, loc }, value{ std::move(value) } { } -expr_arguments::expr_arguments(location const& loc) : node{ type::expr_arguments, loc } +expr_size::expr_size(location const& loc, expr::ptr obj) : expr{ type::expr_size, loc }, obj{ std::move(obj) } { } -expr_parameters::expr_parameters(location const& loc) : node{ type::expr_parameters, loc } +expr_field::expr_field(location const& loc, expr::ptr obj, expr_identifier::ptr field) : expr{ type::expr_field, loc }, obj{ std::move(obj) }, field{ std::move(field) } { } -expr_member::expr_member(location const& loc, expr obj, expr_identifier::ptr name, expr_arguments::ptr args, call::mode mode) : node{ type::expr_member, loc }, obj{ std::move(obj) }, name{ std::move(name) }, args{ std::move(args) }, mode{ mode } +expr_array::expr_array(location const& loc, expr::ptr obj, expr::ptr key) : expr{ type::expr_array, loc }, obj{ std::move(obj) }, key{ std::move(key) } { } -expr_pointer::expr_pointer(location const& loc, expr func, expr_arguments::ptr args, call::mode mode) : node{ type::expr_pointer, loc }, func{ std::move(func) }, args{ std::move(args) }, mode{ mode } +expr_reference::expr_reference(location const& loc, expr_path::ptr path, expr_identifier::ptr name) : expr{ type::expr_reference, loc }, path{ std::move(path) }, name{ std::move(name) } { } -expr_function::expr_function(location const& loc, expr_path::ptr path, expr_identifier::ptr name, expr_arguments::ptr args, call::mode mode) : node{ type::expr_function, loc }, path{ std::move(path) }, name{ std::move(name) }, args{ std::move(args) }, mode{ mode } +expr_getnextarraykey::expr_getnextarraykey(location const& loc, expr::ptr arg1, expr::ptr arg2) : expr{ type::expr_getnextarraykey, loc }, arg1{ std::move(arg1) }, arg2{ std::move(arg2) } { } -expr_method::expr_method(location const& loc, expr obj, call value) : node{ type::expr_method, loc }, obj{ std::move(obj) }, value{ std::move(value) } +expr_getfirstarraykey::expr_getfirstarraykey(location const& loc, expr::ptr arg) : expr{ type::expr_getfirstarraykey, loc }, arg{ std::move(arg) } { } -expr_call::expr_call(location const& loc, call value) : node{ type::expr_call, loc }, value{ std::move(value) } +expr_getdvarcoloralpha::expr_getdvarcoloralpha(location const& loc, expr::ptr arg) : expr{ type::expr_getdvarcoloralpha, loc }, arg{ std::move(arg) } { } -expr_new::expr_new(location const& loc, expr_identifier::ptr name) : node{ type::expr_new, loc }, name{ std::move(name) } +expr_getdvarcolorblue::expr_getdvarcolorblue(location const& loc, expr::ptr arg) : expr{ type::expr_getdvarcolorblue, loc }, arg{ std::move(arg) } { } -expr_complement::expr_complement(location const& loc, expr rvalue) : node{ type::expr_complement, loc }, rvalue{ std::move(rvalue) } +expr_getdvarcolorgreen::expr_getdvarcolorgreen(location const& loc, expr::ptr arg) : expr{ type::expr_getdvarcolorgreen, loc }, arg{ std::move(arg) } { } -expr_negate::expr_negate(location const& loc, expr rvalue) : node{ type::expr_negate, loc }, rvalue{ std::move(rvalue) } +expr_getdvarcolorred::expr_getdvarcolorred(location const& loc, expr::ptr arg) : expr{ type::expr_getdvarcolorred, loc }, arg{ std::move(arg) } { } -expr_not::expr_not(location const& loc, expr rvalue) : node{ type::expr_not, loc }, rvalue{ std::move(rvalue) } +expr_getdvarvector::expr_getdvarvector(location const& loc, expr::ptr arg) : expr{ type::expr_getdvarvector, loc }, arg{ std::move(arg) } { } -expr_binary::expr_binary(type t, location const& loc, expr lvalue, expr rvalue) : node{ t, loc }, lvalue{ std::move(lvalue) }, rvalue{ std::move(rvalue) } +expr_getdvarfloat::expr_getdvarfloat(location const& loc, expr::ptr arg) : expr{ type::expr_getdvarfloat, loc }, arg{ std::move(arg) } { } -expr_add::expr_add(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_add, loc, std::move(lvalue), std::move(rvalue) } +expr_getdvarint::expr_getdvarint(location const& loc, expr::ptr arg) : expr{ type::expr_getdvarint, loc }, arg{ std::move(arg) } { } -expr_sub::expr_sub(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_sub, loc, std::move(lvalue), std::move(rvalue) } +expr_getdvar::expr_getdvar(location const& loc, expr::ptr arg) : expr{ type::expr_getdvar, loc }, arg{ std::move(arg) } { } -expr_mul::expr_mul(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_mul, loc, std::move(lvalue), std::move(rvalue) } +expr_gettime::expr_gettime(location const& loc) : expr{ type::expr_gettime, loc } { } -expr_div::expr_div(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_div, loc, std::move(lvalue), std::move(rvalue) } +expr_abs::expr_abs(location const& loc, expr::ptr arg) : expr{ type::expr_abs, loc }, arg{ std::move(arg) } { } -expr_mod::expr_mod(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_mod, loc, std::move(lvalue), std::move(rvalue) } +expr_vectortoangles::expr_vectortoangles(location const& loc, expr::ptr arg) : expr{ type::expr_vectortoangles, loc }, arg{ std::move(arg) } { } -expr_shift_left::expr_shift_left(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_shift_left, loc, std::move(lvalue), std::move(rvalue) } +expr_angleclamp180::expr_angleclamp180(location const& loc, expr::ptr arg) : expr{ type::expr_angleclamp180, loc }, arg{ std::move(arg) } { } -expr_shift_right::expr_shift_right(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_shift_right, loc, std::move(lvalue), std::move(rvalue) } +expr_anglestoforward::expr_anglestoforward(location const& loc, expr::ptr arg) : expr{ type::expr_anglestoforward, loc }, arg{ std::move(arg) } { } -expr_bitwise_or::expr_bitwise_or(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_bitwise_or, loc, std::move(lvalue), std::move(rvalue) } +expr_anglestoright::expr_anglestoright(location const& loc, expr::ptr arg) : expr{ type::expr_anglestoright, loc }, arg{ std::move(arg) } { } -expr_bitwise_and::expr_bitwise_and(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_bitwise_and, loc, std::move(lvalue), std::move(rvalue) } +expr_anglestoup::expr_anglestoup(location const& loc, expr::ptr arg) : expr{ type::expr_anglestoup, loc }, arg{ std::move(arg) } { } -expr_bitwise_exor::expr_bitwise_exor(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_bitwise_exor, loc, std::move(lvalue), std::move(rvalue) } +expr_vectorscale::expr_vectorscale(location const& loc, expr::ptr arg1, expr::ptr arg2) : expr{ type::expr_vectorscale, loc }, arg1{ std::move(arg1) }, arg2{ std::move(arg2) } { } -expr_super_equal::expr_super_equal(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_super_equal, loc, std::move(lvalue), std::move(rvalue) } +expr_isdefined::expr_isdefined(location const& loc, expr::ptr value) : expr{ type::expr_isdefined, loc }, value{ std::move(value) } { } -expr_super_not_equal::expr_super_not_equal(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_super_not_equal, loc, std::move(lvalue), std::move(rvalue) } +expr_arguments::expr_arguments(location const& loc) : expr{ type::expr_arguments, loc } { } -expr_equality::expr_equality(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_equality, loc, std::move(lvalue), std::move(rvalue) } +expr_parameters::expr_parameters(location const& loc) : expr{ type::expr_parameters, loc } { } -expr_inequality::expr_inequality(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_inequality, loc, std::move(lvalue), std::move(rvalue) } +expr_member::expr_member(location const& loc, expr::ptr obj, expr_identifier::ptr name, expr_arguments::ptr args, call::mode mode) : call{ type::expr_member, loc }, obj{ std::move(obj) }, name{ std::move(name) }, args{ std::move(args) }, mode{ mode } { } -expr_less_equal::expr_less_equal(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_less_equal, loc, std::move(lvalue), std::move(rvalue) } +expr_pointer::expr_pointer(location const& loc, expr::ptr func, expr_arguments::ptr args, call::mode mode) : call{ node::type::expr_pointer, loc }, func{ std::move(func) }, args{ std::move(args) }, mode{ mode } { } -expr_greater_equal::expr_greater_equal(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_greater_equal, loc, std::move(lvalue), std::move(rvalue) } +expr_function::expr_function(location const& loc, expr_path::ptr path, expr_identifier::ptr name, expr_arguments::ptr args, call::mode mode) : call{ node::type::expr_function, loc }, path{ std::move(path) }, name{ std::move(name) }, args{ std::move(args) }, mode{ mode } { } -expr_less::expr_less(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_less, loc, std::move(lvalue), std::move(rvalue) } +expr_method::expr_method(location const& loc, expr::ptr obj, call::ptr value) : expr{ type::expr_method, loc }, obj{ std::move(obj) }, value{ std::move(value) } { } -expr_greater::expr_greater(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_greater, loc, std::move(lvalue), std::move(rvalue) } +expr_call::expr_call(location const& loc, call::ptr value) : expr{ type::expr_call, loc }, value{ std::move(value) } { } -expr_or::expr_or(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_or, loc, std::move(lvalue), std::move(rvalue) } +expr_new::expr_new(location const& loc, expr_identifier::ptr name) : expr{ type::expr_new, loc }, name{ std::move(name) } { } -expr_and::expr_and(location const& loc, expr lvalue, expr rvalue) : expr_binary{ type::expr_and, loc, std::move(lvalue), std::move(rvalue) } +expr_complement::expr_complement(location const& loc, expr::ptr rvalue) : expr{ type::expr_complement, loc }, rvalue{ std::move(rvalue) } { } -expr_ternary::expr_ternary(location const& loc, expr test, expr true_expr, expr false_expr) : node{ type::expr_ternary, loc }, test{ std::move(test) }, true_expr{ std::move(true_expr) }, false_expr{ std::move(false_expr) } +expr_negate::expr_negate(location const& loc, expr::ptr rvalue) : expr{ type::expr_negate, loc }, rvalue{ std::move(rvalue) } { } -expr_increment::expr_increment(location const& loc, expr lvalue, bool prefix) : node{ type::expr_increment, loc }, lvalue{ std::move(lvalue) }, prefix{ prefix } +expr_not::expr_not(location const& loc, expr::ptr rvalue) : expr{ type::expr_not, loc }, rvalue{ std::move(rvalue) } { } -expr_decrement::expr_decrement(location const& loc, expr lvalue, bool prefix) : node{ type::expr_decrement, loc }, lvalue{ std::move(lvalue) }, prefix{ prefix } +expr_binary::expr_binary(location const& loc, expr::ptr lvalue, expr::ptr rvalue, op oper) : expr{ type::expr_binary, loc }, lvalue{ std::move(lvalue) }, rvalue{ std::move(rvalue) }, oper{ oper } { } -expr_assign::expr_assign(type t, location const& loc, expr lvalue, expr rvalue) : node{ t, loc }, lvalue{ std::move(lvalue) }, rvalue{ std::move(rvalue) } +expr_ternary::expr_ternary(location const& loc, expr::ptr test, expr::ptr true_expr, expr::ptr false_expr) : expr{ type::expr_ternary, loc }, test{ std::move(test) }, true_expr{ std::move(true_expr) }, false_expr{ std::move(false_expr) } { } -expr_assign_equal::expr_assign_equal(location const& loc, expr lvalue, expr rvalue) : expr_assign{ type::expr_assign_equal, loc, std::move(lvalue), std::move(rvalue) } +expr_const::expr_const(location const& loc, expr_identifier::ptr lvalue, expr::ptr rvalue) : expr{ type::expr_const, loc }, lvalue{ std::move(lvalue) }, rvalue{ std::move(rvalue) } { } -expr_assign_add::expr_assign_add(location const& loc, expr lvalue, expr rvalue) : expr_assign{ type::expr_assign_add, loc, std::move(lvalue), std::move(rvalue) } +expr_assign::expr_assign(location const& loc, expr::ptr lvalue, expr::ptr rvalue, op oper) : expr{ type::expr_assign, loc }, lvalue{ std::move(lvalue) }, rvalue{ std::move(rvalue) }, oper{ oper } { } -expr_assign_sub::expr_assign_sub(location const& loc, expr lvalue, expr rvalue) : expr_assign{ type::expr_assign_sub, loc, std::move(lvalue), std::move(rvalue) } +expr_increment::expr_increment(location const& loc, expr::ptr lvalue, bool prefix) : expr{ type::expr_increment, loc }, lvalue{ std::move(lvalue) }, prefix{ prefix } { } -expr_assign_mul::expr_assign_mul(location const& loc, expr lvalue, expr rvalue) : expr_assign{ type::expr_assign_mul, loc, std::move(lvalue), std::move(rvalue) } +expr_decrement::expr_decrement(location const& loc, expr::ptr lvalue, bool prefix) : expr{ type::expr_decrement, loc }, lvalue{ std::move(lvalue) }, prefix{ prefix } { } -expr_assign_div::expr_assign_div(location const& loc, expr lvalue, expr rvalue) : expr_assign{ type::expr_assign_div, loc, std::move(lvalue), std::move(rvalue) } +stmt_empty::stmt_empty(location const& loc) : stmt{ type::stmt_empty, loc } { } -expr_assign_mod::expr_assign_mod(location const& loc, expr lvalue, expr rvalue) : expr_assign{ type::expr_assign_mod, loc, std::move(lvalue), std::move(rvalue) } +stmt_list::stmt_list(location const& loc) : stmt{ type::stmt_list, loc } { } -expr_assign_shift_left::expr_assign_shift_left(location const& loc, expr lvalue, expr rvalue) : expr_assign{ type::expr_assign_shift_left, loc, std::move(lvalue), std::move(rvalue) } +stmt_comp::stmt_comp(location const& loc, stmt_list::ptr block) : stmt{ type::stmt_comp, loc }, block{ std::move(block) } { } -expr_assign_shift_right::expr_assign_shift_right(location const& loc, expr lvalue, expr rvalue) : expr_assign{ type::expr_assign_shift_right, loc, std::move(lvalue), std::move(rvalue) } +stmt_dev::stmt_dev(location const& loc, stmt_list::ptr block) : stmt{ type::stmt_dev, loc }, block{ std::move(block) } { } -expr_assign_bitwise_or::expr_assign_bitwise_or(location const& loc, expr lvalue, expr rvalue) : expr_assign{ type::expr_assign_bitwise_or, loc, std::move(lvalue), std::move(rvalue) } +stmt_expr::stmt_expr(location const& loc, expr::ptr value) : stmt{ type::stmt_expr, loc }, value{ std::move(value) } { } -expr_assign_bitwise_and::expr_assign_bitwise_and(location const& loc, expr lvalue, expr rvalue) : expr_assign{ type::expr_assign_bitwise_and, loc, std::move(lvalue), std::move(rvalue) } +stmt_endon::stmt_endon(location const& loc, expr::ptr obj, expr::ptr event) : stmt{ type::stmt_endon, loc }, obj{ std::move(obj) }, event{ std::move(event) } { } -expr_assign_bitwise_exor::expr_assign_bitwise_exor(location const& loc, expr lvalue, expr rvalue) : expr_assign{ type::expr_assign_bitwise_exor, loc, std::move(lvalue), std::move(rvalue) } +stmt_notify::stmt_notify(location const& loc, expr::ptr obj, expr::ptr event, expr_arguments::ptr args) : stmt{ type::stmt_notify, loc }, obj{ std::move(obj) }, event{ std::move(event) }, args{ std::move(args) } { } -stmt_list::stmt_list(location const& loc) : node{ type::stmt_list, loc } +stmt_wait::stmt_wait(location const& loc, expr::ptr time) : stmt{ type::stmt_wait, loc }, time{ std::move(time) } { } -stmt_comp::stmt_comp(location const& loc, stmt_list::ptr block) : node{ type::stmt_comp, loc }, block{ std::move(block) } +stmt_waittill::stmt_waittill(location const& loc, expr::ptr obj, expr::ptr event, expr_arguments::ptr args) : stmt{ type::stmt_waittill, loc }, obj{ std::move(obj) }, event{ std::move(event) }, args{ std::move(args) } { } -stmt_dev::stmt_dev(location const& loc, stmt_list::ptr block) : node{ type::stmt_dev, loc }, block{ std::move(block) } +stmt_waittillmatch::stmt_waittillmatch(location const& loc, expr::ptr obj, expr::ptr event, expr_arguments::ptr args) : stmt{ type::stmt_waittillmatch, loc }, obj{ std::move(obj) }, event{ std::move(event) }, args{ std::move(args) } { } -stmt_expr::stmt_expr(location const& loc, expr value) : node{ type::stmt_expr, loc }, value{ std::move(value) } +stmt_waittillframeend::stmt_waittillframeend(location const& loc) : stmt{ type::stmt_waittillframeend, loc } { } -stmt_call::stmt_call(location const& loc, expr value) : node{ type::stmt_call, loc }, value{ std::move(value) } +stmt_waitrealtime::stmt_waitrealtime(location const& loc, expr::ptr time) : stmt{ type::stmt_waitrealtime, loc }, time{ std::move(time) } { } -stmt_const::stmt_const(location const& loc, expr_identifier::ptr lvalue, expr rvalue) : node{ type::stmt_const, loc }, lvalue{ std::move(lvalue) }, rvalue{ std::move(rvalue) } +stmt_if::stmt_if(location const& loc, expr::ptr test, stmt::ptr body) : stmt{ type::stmt_if, loc }, test{ std::move(test) }, body{ std::move(body) } { } -stmt_assign::stmt_assign(location const& loc, expr value) : node{ type::stmt_assign, loc }, value{ std::move(value) } +stmt_ifelse::stmt_ifelse(location const& loc, expr::ptr test, stmt::ptr stmt_if, stmt::ptr stmt_else) : stmt{ type::stmt_ifelse, loc }, test{ std::move(test) }, stmt_if{ std::move(stmt_if) }, stmt_else{ std::move(stmt_else) } { } -stmt_endon::stmt_endon(location const& loc, expr obj, expr event) : node{ type::stmt_endon, loc }, obj{ std::move(obj) }, event{ std::move(event) } +stmt_while::stmt_while(location const& loc, expr::ptr test, stmt::ptr body) : stmt{ type::stmt_while, loc }, test{ std::move(test) }, body{ std::move(body) } { } -stmt_notify::stmt_notify(location const& loc, expr obj, expr event, expr_arguments::ptr args) : node{ type::stmt_notify, loc }, obj{ std::move(obj) }, event{ std::move(event) }, args{ std::move(args) } +stmt_dowhile::stmt_dowhile(location const& loc, expr::ptr test, stmt::ptr body) : stmt{ type::stmt_dowhile, loc }, test{ std::move(test) }, body{ std::move(body) } { } -stmt_realwait::stmt_realwait(location const& loc, expr time) : node{ type::stmt_realwait, loc }, time{ std::move(time) } +stmt_for::stmt_for(location const& loc, stmt::ptr init, expr::ptr test, stmt::ptr iter, stmt::ptr body) : stmt{ type::stmt_for, loc }, init{ std::move(init) }, test{ std::move(test) }, iter{ std::move(iter) }, body{ std::move(body) } { } -stmt_wait::stmt_wait(location const& loc, expr time) : node{ type::stmt_wait, loc }, time{ std::move(time) } +stmt_foreach::stmt_foreach(location const& loc, expr::ptr container, expr::ptr value, expr::ptr array, expr::ptr key, stmt::ptr body, bool use_key) : stmt{ type::stmt_foreach, loc }, container{ std::move(container) }, value{ std::move(value) }, array{ std::move(array) }, key{ std::move(key) }, body{ std::move(body) }, use_key{ use_key } { } -stmt_waittill::stmt_waittill(location const& loc, expr obj, expr event, expr_arguments::ptr args) : node{ type::stmt_waittill, loc }, obj{ std::move(obj) }, event{ std::move(event) }, args{ std::move(args) } +stmt_switch::stmt_switch(location const& loc, expr::ptr test, stmt_comp::ptr body) : stmt{ type::stmt_switch, loc }, test{ std::move(test) }, body{ std::move(body) } { } -stmt_waittillmatch::stmt_waittillmatch(location const& loc, expr obj, expr event, expr_arguments::ptr args) : node{ type::stmt_waittillmatch, loc }, obj{ std::move(obj) }, event{ std::move(event) }, args{ std::move(args) } +stmt_case::stmt_case(location const& loc, expr::ptr value) : stmt{ type::stmt_case, loc }, value{ std::move(value) }, body{ nullptr } { } -stmt_waittillframeend::stmt_waittillframeend(location const& loc) : node{ type::stmt_waittillframeend, loc } +stmt_case::stmt_case(location const& loc, expr::ptr value, stmt_list::ptr body) : stmt{ type::stmt_case, loc }, value{ std::move(value) }, body{ std::move(body) } { } -stmt_if::stmt_if(location const& loc, expr test, stmt body) : node{ type::stmt_if, loc }, test{ std::move(test) }, body{ std::move(body) } +stmt_default::stmt_default(location const& loc) : stmt{ type::stmt_default, loc }, body{ nullptr } { } -stmt_ifelse::stmt_ifelse(location const& loc, expr test, stmt stmt_if, stmt stmt_else) : node{ type::stmt_ifelse, loc }, test{ std::move(test) }, stmt_if{ std::move(stmt_if) }, stmt_else{ std::move(stmt_else) } +stmt_default::stmt_default(location const& loc, stmt_list::ptr body) : stmt{ type::stmt_default, loc }, body{ std::move(body) } { } -stmt_while::stmt_while(location const& loc, expr test, stmt body) : node{ type::stmt_while, loc }, test{ std::move(test) }, body{ std::move(body) } +stmt_break::stmt_break(location const& loc) : stmt{ type::stmt_break, loc } { } -stmt_dowhile::stmt_dowhile(location const& loc, expr test, stmt body) : node{ type::stmt_dowhile, loc }, test{ std::move(test) }, body{ std::move(body) } +stmt_continue::stmt_continue(location const& loc) : stmt{ type::stmt_continue, loc } { } -stmt_for::stmt_for(location const& loc, stmt init, expr test, stmt iter, stmt body) : node{ type::stmt_for, loc }, init{ std::move(init) }, test{ std::move(test) }, iter{ std::move(iter) }, body{ std::move(body) } +stmt_return::stmt_return(location const& loc, expr::ptr value) : stmt{ type::stmt_return, loc }, value{ std::move(value) } { } -stmt_foreach::stmt_foreach(location const& loc, expr container, expr value, expr array, expr key, stmt body, bool use_key) : node{ type::stmt_foreach, loc }, container{ std::move(container) }, value{ std::move(value) }, array{ std::move(array) }, key{ std::move(key) }, body{ std::move(body) }, use_key{ use_key } +stmt_breakpoint::stmt_breakpoint(location const& loc) : stmt{ type::stmt_breakpoint, loc } { } -stmt_switch::stmt_switch(location const& loc, expr test, stmt_comp::ptr body) : node{ type::stmt_switch, loc }, test{ std::move(test) }, body{ std::move(body) } +stmt_prof_begin::stmt_prof_begin(location const& loc, expr_arguments::ptr args) : stmt{ type::stmt_prof_begin, loc }, args{ std::move(args) } { } -stmt_case::stmt_case(location const& loc, expr value) : node{ type::stmt_case, loc }, value{ std::move(value) }, body{ nullptr } +stmt_prof_end::stmt_prof_end(location const& loc, expr_arguments::ptr args) : stmt{ type::stmt_prof_end, loc }, args{ std::move(args) } { } -stmt_case::stmt_case(location const& loc, expr value, stmt_list::ptr body) : node{ type::stmt_case, loc }, value{ std::move(value) }, body{ std::move(body) } +stmt_jmp::stmt_jmp(location const& loc, std::string const& value) : stmt{ type::stmt_jmp, loc }, value{ value } { } -stmt_default::stmt_default(location const& loc) : node{ type::stmt_default, loc }, body{ nullptr } +stmt_jmp_back::stmt_jmp_back(location const& loc, std::string const& value) : stmt{ type::stmt_jmp_back, loc }, value{ value } { } -stmt_default::stmt_default(location const& loc, stmt_list::ptr body) : node{ type::stmt_default, loc }, body{ std::move(body) } +stmt_jmp_cond::stmt_jmp_cond(location const& loc, expr::ptr test, std::string const& value) : stmt{ type::stmt_jmp_cond, loc }, test{ std::move(test) }, value{ value } { } -stmt_break::stmt_break(location const& loc) : node{ type::stmt_break, loc } +stmt_jmp_true::stmt_jmp_true(location const& loc, expr::ptr test, std::string const& value) : stmt{ type::stmt_jmp_true, loc }, test{ std::move(test) }, value{ value } { } -stmt_continue::stmt_continue(location const& loc) : node{ type::stmt_continue, loc } +stmt_jmp_false::stmt_jmp_false(location const& loc, expr::ptr test, std::string const& value) : stmt{ type::stmt_jmp_false, loc }, test{ std::move(test) }, value{ value } { } -stmt_return::stmt_return(location const& loc, expr value) : node{ type::stmt_return, loc }, value{ std::move(value) } +stmt_jmp_switch::stmt_jmp_switch(location const& loc, expr::ptr test, std::string const& value) : stmt{ type::stmt_jmp_switch, loc }, test{ std::move(test) }, value{ value } { } -stmt_breakpoint::stmt_breakpoint(location const& loc) : node{ type::stmt_breakpoint, loc } +stmt_jmp_endswitch::stmt_jmp_endswitch(location const& loc, std::vector data) : stmt{ type::stmt_jmp_endswitch, loc }, data{ std::move(data) } { } -stmt_prof_begin::stmt_prof_begin(location const& loc, expr_arguments::ptr args) : node{ type::stmt_prof_begin, loc }, args{ std::move(args) } +stmt_jmp_dev::stmt_jmp_dev(location const& loc, std::string const& value) : stmt{ type::stmt_jmp_dev, loc }, value{ value } { } -stmt_prof_end::stmt_prof_end(location const& loc, expr_arguments::ptr args) : node{ type::stmt_prof_end, loc }, args{ std::move(args) } +decl_empty::decl_empty(location const& loc) : decl{ type::decl_empty, loc } { } -decl_function::decl_function(location const& loc, expr_identifier::ptr space, expr_identifier::ptr name, expr_parameters::ptr params, stmt_comp::ptr body, export_flags flags) : node{ type::decl_function, loc }, space{ std::move(space) }, name{ std::move(name) }, params{ std::move(params) }, body{ std::move(body) }, flags{ flags } +decl_function::decl_function(location const& loc, expr_identifier::ptr space, expr_identifier::ptr name, expr_parameters::ptr params, stmt_comp::ptr body, export_flags flags) : decl{ type::decl_function, loc }, space{ std::move(space) }, name{ std::move(name) }, params{ std::move(params) }, body{ std::move(body) }, flags{ flags } { } -decl_namespace::decl_namespace(location const& loc, expr_string::ptr name) : node{ type::decl_namespace, loc }, name{ std::move(name) } +decl_namespace::decl_namespace(location const& loc, expr_string::ptr name) : decl{ type::decl_namespace, loc }, name{ std::move(name) } { } -decl_usingtree::decl_usingtree(location const& loc, expr_string::ptr name) : node{ type::decl_usingtree, loc }, name{ std::move(name) } +decl_usingtree::decl_usingtree(location const& loc, expr_string::ptr name) : decl{ type::decl_usingtree, loc }, name{ std::move(name) } { } -decl_dev_begin::decl_dev_begin(location const& loc) : node{ type::decl_dev_begin, loc } +decl_dev_begin::decl_dev_begin(location const& loc) : decl{ type::decl_dev_begin, loc } { } -decl_dev_end::decl_dev_end(location const& loc) : node{ type::decl_dev_end, loc } +decl_dev_end::decl_dev_end(location const& loc) : decl{ type::decl_dev_end, loc } { } @@ -683,58 +894,40 @@ program::program(location const& loc) : node{ type::program, loc } { } -asm_loc::asm_loc(location const& loc, std::string const& value) : node{ type::asm_loc, loc }, value{ value } +auto operator==(expr const& lhs, expr const& rhs) -> bool { -} + if (!(lhs.kind() == rhs.kind())) return false; -asm_jmp::asm_jmp(location const& loc, std::string const& value) : node{ type::asm_jmp, loc }, value{ value } -{ -} - -asm_jmp_back::asm_jmp_back(location const& loc, std::string const& value) : node{ type::asm_jmp_back, loc }, value{ value } -{ -} - -asm_jmp_cond::asm_jmp_cond(location const& loc, expr test, std::string const& value) : node{ type::asm_jmp_cond, loc }, test{ std::move(test) }, value{ value } -{ -} - -asm_jmp_true::asm_jmp_true(location const& loc, expr test, std::string const& value) : node{ type::asm_jmp_true, loc }, test{ std::move(test) }, value{ value } -{ -} - -asm_jmp_false::asm_jmp_false(location const& loc, expr test, std::string const& value) : node{ type::asm_jmp_false, loc }, test{ std::move(test) }, value{ value } -{ -} - -asm_switch::asm_switch(location const& loc, expr test, std::string const& value) : node{ type::asm_switch, loc }, test{ std::move(test) }, value{ value } -{ -} - -asm_endswitch::asm_endswitch(location const& loc, std::vector data) : node{ type::asm_endswitch, loc }, data{ std::move(data) } -{ -} - -asm_prescriptcall::asm_prescriptcall(location const& loc) : node{ type::asm_prescriptcall, loc } -{ -} - -asm_voidcodepos::asm_voidcodepos(location const& loc) : node{ type::asm_voidcodepos, loc } -{ -} - -asm_dev::asm_dev(location const& loc, std::string const& value) : node{ type::asm_dev, loc }, value{ value } -{ -} - -auto operator==(node const& n, node::type k) -> bool -{ - return n.kind_ == k; -} - -auto operator==(node const& lhs, node const& rhs) -> bool -{ - return lhs.kind_ == rhs.kind_; + switch(lhs.kind()) + { + case node::expr_empty: return true; + case node::expr_true: return lhs.as() == rhs.as(); + case node::expr_false: return lhs.as() == rhs.as(); + case node::expr_integer: return lhs.as() == rhs.as(); + case node::expr_float: return lhs.as() == rhs.as(); + case node::expr_vector: return lhs.as() == rhs.as(); + case node::expr_hash: return lhs.as() == rhs.as(); + case node::expr_string: return lhs.as() == rhs.as(); + case node::expr_istring: return lhs.as() == rhs.as(); + case node::expr_path: return lhs.as() == rhs.as(); + case node::expr_identifier: return lhs.as() == rhs.as(); + case node::expr_animtree: return lhs.as() == rhs.as(); + case node::expr_animation: return lhs.as() == rhs.as(); + case node::expr_classes: return lhs.as() == rhs.as(); + case node::expr_world: return lhs.as() == rhs.as(); + case node::expr_level: return lhs.as() == rhs.as(); + case node::expr_anim: return lhs.as() == rhs.as(); + case node::expr_self: return lhs.as() == rhs.as(); + case node::expr_game: return lhs.as() == rhs.as(); + case node::expr_undefined: return lhs.as() == rhs.as(); + case node::expr_empty_array: return lhs.as() == rhs.as(); + case node::expr_ellipsis: return lhs.as() == rhs.as(); + case node::expr_paren: return lhs.as() == rhs.as(); + case node::expr_size: return lhs.as() == rhs.as(); + case node::expr_field: return lhs.as() == rhs.as(); + case node::expr_array: return lhs.as() == rhs.as(); + default: return false; + } } auto operator==(expr_true const&, expr_true const&) -> bool @@ -837,6 +1030,11 @@ auto operator==(expr_empty_array const&, expr_empty_array const&) -> bool return true; } +auto operator==(expr_ellipsis const&, expr_ellipsis const&) -> bool +{ + return true; +} + auto operator==(expr_paren const& lhs, expr_paren const& rhs) -> bool { return lhs.value == rhs.value; @@ -857,369 +1055,4 @@ auto operator==(expr_array const& lhs, expr_array const& rhs) -> bool return lhs.obj == rhs.obj && lhs.key == rhs.key; } -call::call() : as_node{ nullptr } -{ -} - -call::call(std::unique_ptr value) : as_node{ std::move(value) } -{ -} - -call::call(call&& value) -{ - new(&as_node) std::unique_ptr{ std::move(value.as_node) }; -} - -call::~call() -{ - if (as_node == nullptr) return; - - switch (as_node->kind()) - { - case node::null: as_node.~unique_ptr(); return; - case node::expr_pointer: as_pointer.~unique_ptr(); return; - case node::expr_function: as_function.~unique_ptr(); return; - default: return; - } -} - -auto operator==(call const& lhs, node::type rhs) -> bool -{ - return *lhs.as_node == rhs; -} - -auto call::loc() const -> location -{ - return as_node->loc(); -} - -auto call::kind() const -> node::type -{ - return as_node->kind(); -} - -auto call::label() const -> std::string -{ - return as_node->label(); -} - -expr::expr() : as_node{ nullptr } -{ -} - -expr::expr(std::unique_ptr value) : as_node{ std::move(value) } -{ -} - -expr::expr(expr&& value) -{ - new(&as_node) std::unique_ptr{ std::move(value.as_node) }; -} - -expr& expr::operator=(expr&& value) -{ - new(&as_node) std::unique_ptr{ std::move(value.as_node) }; - return *(expr*)&as_node; -} - -expr::~expr() -{ - if (as_node == nullptr) return; - - switch (as_node->kind()) - { - case node::null: as_node.~unique_ptr(); return; - case node::expr_true: as_true.~unique_ptr(); return; - case node::expr_false: as_false.~unique_ptr(); return; - case node::expr_integer: as_integer.~unique_ptr(); return; - case node::expr_float: as_float.~unique_ptr(); return; - case node::expr_vector: as_vector.~unique_ptr(); return; - case node::expr_hash: as_hash.~unique_ptr(); return; - case node::expr_string: as_string.~unique_ptr(); return; - case node::expr_istring: as_istring.~unique_ptr(); return; - case node::expr_path: as_path.~unique_ptr(); return; - case node::expr_identifier: as_identifier.~unique_ptr(); return; - case node::expr_animtree: as_animtree.~unique_ptr(); return; - case node::expr_animation: as_animation.~unique_ptr(); return; - case node::expr_classes: as_classes.~unique_ptr(); return; - case node::expr_world: as_world.~unique_ptr(); return; - case node::expr_level: as_level.~unique_ptr(); return; - case node::expr_anim: as_anim.~unique_ptr(); return; - case node::expr_self: as_self.~unique_ptr(); return; - case node::expr_game: as_game.~unique_ptr(); return; - case node::expr_undefined: as_undefined.~unique_ptr(); return; - case node::expr_empty_array: as_empty_array.~unique_ptr(); return; - case node::expr_paren: as_paren.~unique_ptr(); return; - case node::expr_size: as_size.~unique_ptr(); return; - case node::expr_field: as_field.~unique_ptr(); return; - case node::expr_array: as_array.~unique_ptr(); return; - case node::expr_reference: as_reference.~unique_ptr(); return; - case node::expr_getnextarraykey: as_getnextarraykey.~unique_ptr(); return; - case node::expr_getfirstarraykey: as_getfirstarraykey.~unique_ptr(); return; - case node::expr_getdvarcoloralpha: as_getdvarcoloralpha.~unique_ptr(); return; - case node::expr_getdvarcolorblue: as_getdvarcolorblue.~unique_ptr(); return; - case node::expr_getdvarcolorgreen: as_getdvarcolorgreen.~unique_ptr(); return; - case node::expr_getdvarcolorred: as_getdvarcolorred.~unique_ptr(); return; - case node::expr_getdvarvector: as_getdvarvector.~unique_ptr(); return; - case node::expr_getdvarfloat: as_getdvarfloat.~unique_ptr(); return; - case node::expr_getdvarint: as_getdvarint.~unique_ptr(); return; - case node::expr_getdvar: as_getdvar.~unique_ptr(); return; - case node::expr_gettime: as_gettime.~unique_ptr(); return; - case node::expr_abs: as_abs.~unique_ptr(); return; - case node::expr_vectortoangles: as_vectortoangles.~unique_ptr(); return; - case node::expr_angleclamp180: as_angleclamp180.~unique_ptr(); return; - case node::expr_anglestoforward: as_anglestoforward.~unique_ptr(); return; - case node::expr_anglestoright: as_anglestoright.~unique_ptr(); return; - case node::expr_anglestoup: as_anglestoup.~unique_ptr(); return; - case node::expr_vectorscale: as_vectorscale.~unique_ptr(); return; - case node::expr_isdefined: as_isdefined.~unique_ptr(); return; - case node::expr_arguments: as_arguments.~unique_ptr(); return; - case node::expr_parameters: as_parameters.~unique_ptr(); return; - case node::expr_member: as_member.~unique_ptr(); return; - case node::expr_pointer: as_pointer.~unique_ptr(); return; - case node::expr_function: as_function.~unique_ptr(); return; - case node::expr_method: as_method.~unique_ptr(); return; - case node::expr_call: as_call.~unique_ptr(); return; - case node::expr_new: as_new.~unique_ptr(); return; - case node::expr_complement: as_complement.~unique_ptr(); return; - case node::expr_negate: as_negate.~unique_ptr(); return; - case node::expr_not: as_not.~unique_ptr(); return; - case node::expr_add: as_add.~unique_ptr(); return; - case node::expr_sub: as_sub.~unique_ptr(); return; - case node::expr_mul: as_mul.~unique_ptr(); return; - case node::expr_div: as_div.~unique_ptr(); return; - case node::expr_mod: as_mod.~unique_ptr(); return; - case node::expr_shift_left: as_shift_left.~unique_ptr(); return; - case node::expr_shift_right: as_shift_right.~unique_ptr(); return; - case node::expr_bitwise_or: as_bitwise_or.~unique_ptr(); return; - case node::expr_bitwise_and: as_bitwise_and.~unique_ptr(); return; - case node::expr_bitwise_exor: as_bitwise_exor.~unique_ptr(); return; - case node::expr_super_equal: as_super_equal.~unique_ptr(); return; - case node::expr_super_not_equal: as_super_not_equal.~unique_ptr(); return; - case node::expr_equality: as_equality.~unique_ptr(); return; - case node::expr_inequality: as_inequality.~unique_ptr(); return; - case node::expr_less_equal: as_less_equal.~unique_ptr(); return; - case node::expr_greater_equal: as_greater_equal.~unique_ptr(); return; - case node::expr_less: as_less.~unique_ptr(); return; - case node::expr_greater: as_greater.~unique_ptr(); return; - case node::expr_or: as_or.~unique_ptr(); return; - case node::expr_and: as_and.~unique_ptr(); return; - case node::expr_ternary: as_ternary.~unique_ptr(); return; - case node::expr_increment: as_increment.~unique_ptr(); return; - case node::expr_decrement: as_decrement.~unique_ptr(); return; - case node::expr_assign_equal: as_assign_equal.~unique_ptr(); return; - case node::expr_assign_add: as_assign_add.~unique_ptr(); return; - case node::expr_assign_sub: as_assign_sub.~unique_ptr(); return; - case node::expr_assign_mul: as_assign_mul.~unique_ptr(); return; - case node::expr_assign_div: as_assign_div.~unique_ptr(); return; - case node::expr_assign_mod: as_assign_mod.~unique_ptr(); return; - case node::expr_assign_shift_left: as_assign_shift_left.~unique_ptr(); return; - case node::expr_assign_shift_right: as_assign_shift_right.~unique_ptr(); return; - case node::expr_assign_bitwise_or: as_assign_bw_or.~unique_ptr(); return; - case node::expr_assign_bitwise_and: as_assign_bw_and.~unique_ptr(); return; - case node::expr_assign_bitwise_exor: as_assign_bw_exor.~unique_ptr(); return; - default: return; - } -} - -auto operator!=(expr const& lhs, node::type rhs) -> bool -{ - return lhs.as_node->kind() != rhs; -} - -auto operator==(expr const& lhs, node::type rhs) -> bool -{ - return *lhs.as_node == rhs; -} - -auto operator==(expr const& lhs, expr const& rhs) -> bool -{ - if (!(*lhs.as_node == *rhs.as_node)) return false; - - switch(lhs.as_node->kind()) - { - case node::expr_true: return *lhs.as_true == *rhs.as_true; - case node::expr_false: return *lhs.as_false == *rhs.as_false; - case node::expr_integer: return *lhs.as_integer == *rhs.as_integer; - case node::expr_float: return *lhs.as_float == *rhs.as_float; - case node::expr_vector: return *lhs.as_vector == *rhs.as_vector; - case node::expr_hash: return *lhs.as_hash == *rhs.as_hash; - case node::expr_string: return *lhs.as_string == *rhs.as_string; - case node::expr_istring: return *lhs.as_istring == *rhs.as_istring; - case node::expr_path: return *lhs.as_path == *rhs.as_path; - case node::expr_identifier: return *lhs.as_identifier == *rhs.as_identifier; - case node::expr_animtree: return *lhs.as_animtree == *rhs.as_animtree; - case node::expr_animation: return *lhs.as_animation == *rhs.as_animation; - case node::expr_classes: return *lhs.as_classes == *rhs.as_classes; - case node::expr_world: return *lhs.as_world == *rhs.as_world; - case node::expr_level: return *lhs.as_level == *rhs.as_level; - case node::expr_anim: return *lhs.as_anim == *rhs.as_anim; - case node::expr_self: return *lhs.as_self == *rhs.as_self; - case node::expr_game: return *lhs.as_game == *rhs.as_game; - case node::expr_undefined: return *lhs.as_undefined == *rhs.as_undefined; - case node::expr_empty_array: return *lhs.as_empty_array == *rhs.as_empty_array; - case node::expr_paren: return *lhs.as_paren == *rhs.as_paren; - case node::expr_size: return *lhs.as_size == *rhs.as_size; - case node::expr_field: return *lhs.as_field == *rhs.as_field; - case node::expr_array: return *lhs.as_array == *rhs.as_array; - default: return false; - } -} - -auto expr::loc() const -> location -{ - return as_node->loc(); -} - -auto expr::kind() const -> node::type -{ - return as_node->kind(); -} - -auto expr::label() const -> std::string -{ - return as_node->label(); -} - -stmt::stmt() : as_node{ nullptr } -{ -} - -stmt::stmt(std::unique_ptr value) : as_node{ std::move(value) } -{ -} - -stmt::stmt(stmt&& value) -{ - new(&as_node) std::unique_ptr{ std::move(value.as_node) }; -} - -stmt& stmt::operator=(stmt&& value) -{ - new(&as_node) std::unique_ptr{ std::move(value.as_node) }; - return *(stmt*)&as_node; -} - -stmt::~stmt() -{ - if (as_node == nullptr) return; - - switch (as_node->kind()) - { - case node::null: as_node.~unique_ptr(); return; - case node::stmt_list: as_list.~unique_ptr(); return; - case node::stmt_comp: as_comp.~unique_ptr(); return; - case node::stmt_dev: as_dev.~unique_ptr(); return; - case node::stmt_expr: as_expr.~unique_ptr(); return; - case node::stmt_call: as_call.~unique_ptr(); return; - case node::stmt_const: as_const.~unique_ptr(); return; - case node::stmt_assign: as_assign.~unique_ptr(); return; - case node::stmt_endon: as_endon.~unique_ptr(); return; - case node::stmt_notify: as_notify.~unique_ptr(); return; - case node::stmt_realwait: as_realwait.~unique_ptr(); return; - case node::stmt_wait: as_wait.~unique_ptr(); return; - case node::stmt_waittill: as_waittill.~unique_ptr(); return; - case node::stmt_waittillmatch: as_waittillmatch.~unique_ptr(); return; - case node::stmt_waittillframeend: as_waittillframeend.~unique_ptr(); return; - case node::stmt_if: as_if.~unique_ptr(); return; - case node::stmt_ifelse: as_ifelse.~unique_ptr(); return; - case node::stmt_while: as_while.~unique_ptr(); return; - case node::stmt_dowhile: as_dowhile.~unique_ptr(); return; - case node::stmt_for: as_for.~unique_ptr(); return; - case node::stmt_foreach: as_foreach.~unique_ptr(); return; - case node::stmt_switch: as_switch.~unique_ptr(); return; - case node::stmt_case: as_case.~unique_ptr(); return; - case node::stmt_default: as_default.~unique_ptr(); return; - case node::stmt_break: as_break.~unique_ptr(); return; - case node::stmt_continue: as_continue.~unique_ptr(); return; - case node::stmt_return: as_return.~unique_ptr(); return; - case node::stmt_breakpoint: as_breakpoint.~unique_ptr(); return; - case node::stmt_prof_begin: as_prof_begin.~unique_ptr(); return; - case node::stmt_prof_end: as_prof_end.~unique_ptr(); return; - case node::asm_loc: as_loc.~unique_ptr(); return; - case node::asm_jmp: as_jump.~unique_ptr(); return; - case node::asm_jmp_back: as_jump_back.~unique_ptr(); return; - case node::asm_jmp_cond: as_cond.~unique_ptr(); return; - case node::asm_switch: as_asm_switch.~unique_ptr(); return; - case node::asm_endswitch: as_asm_endswitch.~unique_ptr(); return; - case node::asm_dev: as_asm_dev.~unique_ptr(); return; - default: return; - } -} - -auto operator==(stmt const& lhs, node::type rhs) -> bool -{ - return *lhs.as_node == rhs; -} - -auto stmt::loc() const -> location -{ - return as_node->loc(); -} - -auto stmt::kind() const -> node::type -{ - return as_node->kind(); -} - -auto stmt::label() const -> std::string -{ - return as_node->label(); -} - -decl::decl() : as_node{ nullptr } -{ -} - -decl::decl(std::unique_ptr value) : as_node{ std::move(value) } -{ -} - -decl::decl(decl&& value) -{ - new(&as_node) std::unique_ptr{ std::move(value.as_node) }; -} - -decl& decl::operator=(decl&& value) -{ - new(&as_node) std::unique_ptr{ std::move(value.as_node) }; - return *(decl*)&as_node; -} - -decl::~decl() -{ - if (as_node == nullptr) return; - - switch (as_node->kind()) - { - case node::null: as_node.~unique_ptr(); return; - case node::decl_dev_begin: as_dev_begin.~unique_ptr(); return; - case node::decl_dev_end: as_dev_end.~unique_ptr(); return; - case node::decl_function: as_function.~unique_ptr(); return; - case node::decl_usingtree: as_usingtree.~unique_ptr(); return; - case node::decl_namespace: as_namespace.~unique_ptr(); return; - default: return; - } -} - -auto operator==(decl const& lhs, node::type rhs) -> bool -{ - return *lhs.as_node == rhs; -} - -auto decl::loc() const -> location -{ - return as_node->loc(); -} - -auto decl::kind() const -> node::type -{ - return as_node->kind(); -} - -auto decl::label() const -> std::string -{ - return as_node->label(); -} - } // namespace xsk::arc diff --git a/src/arc/common/lookahead.cpp b/src/arc/common/lookahead.cpp new file mode 100644 index 00000000..034f9a98 --- /dev/null +++ b/src/arc/common/lookahead.cpp @@ -0,0 +1,40 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "xsk/stdinc.hpp" +#include "xsk/arc/common/lookahead.hpp" + +namespace xsk::arc +{ + +lookahead::lookahead(char const* data, usize size) : buffer_pos{ 0 }, available{ 0 }, last_byte{ 0 }, curr_byte{ 0 } +{ + if (data && size) + { + buffer_pos = data; + available = size; + last_byte = 0; + curr_byte = *data; + } +} + +auto lookahead::advance() -> void +{ + ++buffer_pos; + + if (available-- == 1) + { + available = 0; + last_byte = curr_byte; + curr_byte = 0; + } + else + { + last_byte = curr_byte; + curr_byte = *buffer_pos; + } +} + +} // namespace xsk::arc diff --git a/src/arc/common/token.cpp b/src/arc/common/token.cpp new file mode 100644 index 00000000..af1bbaaf --- /dev/null +++ b/src/arc/common/token.cpp @@ -0,0 +1,137 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "xsk/stdinc.hpp" +#include "xsk/utils/string.hpp" +#include "xsk/arc/common/location.hpp" +#include "xsk/arc/common/space.hpp" +#include "xsk/arc/common/token.hpp" + +namespace xsk::arc +{ + +auto token::to_string() -> std::string +{ + switch (type) + { + case token::PLUS: return "+"; + case token::MINUS: return "-"; + case token::STAR: return "*"; + case token::DIV: return "/"; + case token::MOD: return "%"; + case token::BITOR: return "|"; + case token::BITAND: return "&"; + case token::BITEXOR: return "^"; + case token::SHL: return "<<"; + case token::SHR: return ">>"; + case token::ASSIGN: return "="; + case token::PLUSEQ: return "+="; + case token::MINUSEQ: return "-="; + case token::STAREQ: return "*="; + case token::DIVEQ: return "/="; + case token::MODEQ: return "%="; + case token::BITOREQ: return "|="; + case token::BITANDEQ: return "&="; + case token::BITEXOREQ: return "^="; + case token::SHLEQ: return "<<="; + case token::SHREQ: return ">>="; + case token::INC: return "++"; + case token::DEC: return "--"; + case token::GT: return ">"; + case token::LT: return "<"; + case token::GE: return ">="; + case token::LE: return "<="; + case token::NE: return "!="; + case token::EQ: return "=="; + case token::OR: return "||"; + case token::AND: return "&&"; + case token::TILDE: return "~"; + case token::BANG: return "!"; + case token::QMARK: return "?"; + case token::COLON: return ":"; + case token::SHARP: return "#"; + case token::COMMA: return ","; + case token::DOT: return "."; + case token::DOUBLEDOT: return ".."; + case token::ELLIPSIS: return "..."; + case token::SEMICOLON: return ";"; + case token::DOUBLECOLON: return "::"; + case token::LBRACKET: return "{"; + case token::RBRACKET: return "}"; + case token::LBRACE: return "["; + case token::RBRACE: return "]"; + case token::LPAREN: return "("; + case token::RPAREN: return ")"; + case token::NAME: return data; + case token::PATH: return data; + case token::STRING: return data; + case token::ISTRING: return data; + case token::HASHSTR: return data; + case token::INT: return data; + case token::FLT: return data; + case token::DEVBEGIN: return "/#"; + case token::DEVEND: return "#/"; + case token::INLINE: return "#inline"; + case token::INCLUDE: return "#include"; + case token::USINGTREE: return "#using_animtree"; + case token::ANIMTREE: return "#animtree"; + case token::AUTOEXEC: return "autoexec"; + case token::CODECALL: return "codecall"; + case token::PRIVATE: return "private"; + case token::ENDON: return "endon"; + case token::NOTIFY: return "notify"; + case token::WAIT: return "wait"; + case token::WAITTILL: return "waittill"; + case token::WAITTILLMATCH: return "waittillmatch"; + case token::WAITTILLFRAMEEND: return "waittillframeend"; + case token::IF: return "if"; + case token::ELSE: return "else"; + case token::DO: return "do"; + case token::WHILE: return "while"; + case token::FOR: return "for"; + case token::FOREACH: return "foreach"; + case token::IN: return "in"; + case token::SWITCH: return "switch"; + case token::CASE: return "case"; + case token::DEFAULT: return "default"; + case token::BREAK: return "break"; + case token::CONTINUE: return "continue"; + case token::RETURN: return "return"; + case token::PROFBEGIN: return "prof_begin"; + case token::PROFEND: return "prof_end"; + case token::THREAD: return "thread"; + case token::TRUE: return "true"; + case token::FALSE: return "false"; + case token::UNDEFINED: return "undefined"; + case token::SIZE: return "size"; + case token::GAME: return "game"; + case token::SELF: return "self"; + case token::ANIM: return "anim"; + case token::LEVEL: return "level"; + case token::CONST: return "const"; + case token::ISDEFINED: return "isdefined"; + case token::VECTORSCALE: return "vectorscale"; + case token::ANGLESTOUP: return "anglestoup"; + case token::ANGLESTORIGHT: return "anglestoright"; + case token::ANGLESTOFORWARD: return "anglestoforward"; + case token::ANGLECLAMP180: return "angleclamp180"; + case token::VECTORTOANGLES: return "vectorangles"; + case token::ABS: return "abs"; + case token::GETTIME: return "gettime"; + case token::GETDVAR: return "getdvar"; + case token::GETDVARINT: return "getdvarint"; + case token::GETDVARFLOAT: return "getdvarfloat"; + case token::GETDVARVECTOR: return "getdvarvector"; + case token::GETDVARCOLORRED: return "getdvarcolorred"; + case token::GETDVARCOLORGREEN: return "getdvarcolorgreen"; + case token::GETDVARCOLORBLUE: return "getdvarcolorblue"; + case token::GETDVARCOLORALPHA: return "getdvarcoloralpha"; + case token::GETFIRSTARRAYKEY: return "getfirstarraykey"; + case token::GETNEXTARRAYKEY: return "getnextarraykey"; + default: return "*INTERNAL*"; + } +} + +} // namespace xsk::arc diff --git a/src/arc/compiler.cpp b/src/arc/compiler.cpp new file mode 100644 index 00000000..8112f36e --- /dev/null +++ b/src/arc/compiler.cpp @@ -0,0 +1,2214 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "xsk/stdinc.hpp" +#include "xsk/arc/compiler.hpp" +#include "xsk/arc/context.hpp" + +namespace xsk::arc +{ + +compiler::compiler(context* ctx) : ctx_{ ctx } +{ +} + +auto compiler::compile(program const& data) -> assembly::ptr +{ + emit_program(data); + return std::move(assembly_); +} + +auto compiler::compile(std::string const& file, std::vector& data) -> assembly::ptr +{ + auto prog = ctx_->source().parse_program(file, data); + return compile(*prog); +} + +auto compiler::emit_program(program const& prog) -> void +{ + assembly_ = assembly::make(); + localfuncs_.clear(); + developer_thread_ = false; + animtree_ = {}; + index_ = 0; + + for (auto const& include : prog.includes) + { + emit_include(*include); + } + + for (auto const& dec : prog.declarations) + { + if (dec->is()) + { + auto const& name = dec->as().name->value; + + for (auto const& entry : localfuncs_) + { + if (entry == name) + throw comp_error(dec->loc(), fmt::format("function name '{}' already defined as local function", name)); + } + + localfuncs_.push_back(dec->as().name->value); + } + } + + for (auto const& dec : prog.declarations) + { + emit_decl(*dec); + } +} + +auto compiler::emit_include(include const& inc) -> void +{ + auto const& path = inc.path->value; + + for (auto const& entry : assembly_->includes) + { + if (entry == path) + { + throw comp_error(inc.loc(), fmt::format("duplicated include file {}", path)); + } + } + + assembly_->includes.push_back(path); +} + +auto compiler::emit_decl(decl const& dec) -> void +{ + switch (dec.kind()) + { + case node::decl_dev_begin: + developer_thread_ = true; + break; + case node::decl_dev_end: + developer_thread_ = false; + break; + case node::decl_usingtree: + emit_decl_usingtree(dec.as()); + break; + case node::decl_function: + emit_decl_function(dec.as()); + break; + default: + throw comp_error(dec.loc(), "unknown declaration"); + } +} + +auto compiler::emit_decl_usingtree(decl_usingtree const& animtree) -> void +{ + if (developer_thread_) + throw comp_error(animtree.loc(), "cannot put #using_animtree inside developer comment"); + + animtree_ = animtree.name->value; +} + +auto compiler::emit_decl_function(decl_function const& func) -> void +{ + label_idx_ = 0; + can_break_ = false; + can_continue_ = false; + scopes_.clear(); + constants_.clear(); + stackframe_.clear(); + + function_ = function::make(); + function_->index = index_; + function_->name = func.name->value; + function_->params = static_cast(func.params->list.size()); + function_->flags = static_cast(func.flags); + + process_function(func); + + scopes_.push_back(scope()); + + emit_expr_parameters(*func.params); + emit_stmt_comp(*func.body); + + if (scopes_.back().abort == scope::abort_none) + emit_opcode(opcode::OP_End); + + scopes_.pop_back(); + + function_->size = index_ - function_->index; + assembly_->functions.push_back(std::move(function_)); +} + +auto compiler::emit_stmt(stmt const& stm) -> void +{ + switch (stm.kind()) + { + case node::stmt_list: + emit_stmt_list(stm.as()); + break; + case node::stmt_comp: + emit_stmt_comp(stm.as()); + break; + case node::stmt_dev: + emit_stmt_dev(stm.as()); + break; + case node::stmt_expr: + emit_stmt_expr(stm.as()); + break; + case node::stmt_endon: + emit_stmt_endon(stm.as()); + break; + case node::stmt_notify: + emit_stmt_notify(stm.as()); + break; + case node::stmt_wait: + emit_stmt_wait(stm.as()); + break; + case node::stmt_waittill: + emit_stmt_waittill(stm.as()); + break; + case node::stmt_waittillmatch: + emit_stmt_waittillmatch(stm.as()); + break; + case node::stmt_waittillframeend: + emit_stmt_waittillframeend(stm.as()); + break; + case node::stmt_if: + emit_stmt_if(stm.as()); + break; + case node::stmt_ifelse: + emit_stmt_ifelse(stm.as()); + break; + case node::stmt_while: + emit_stmt_while(stm.as()); + break; + case node::stmt_dowhile: + emit_stmt_dowhile(stm.as()); + break; + case node::stmt_for: + emit_stmt_for(stm.as()); + break; + case node::stmt_foreach: + emit_stmt_foreach(stm.as()); + break; + case node::stmt_switch: + emit_stmt_switch(stm.as()); + break; + case node::stmt_case: + emit_stmt_case(stm.as()); + break; + case node::stmt_default: + emit_stmt_default(stm.as()); + break; + case node::stmt_break: + emit_stmt_break(stm.as()); + break; + case node::stmt_continue: + emit_stmt_continue(stm.as()); + break; + case node::stmt_return: + emit_stmt_return(stm.as()); + break; + case node::stmt_breakpoint: + emit_stmt_breakpoint(stm.as()); + break; + case node::stmt_prof_begin: + emit_stmt_prof_begin(stm.as()); + break; + case node::stmt_prof_end: + emit_stmt_prof_end(stm.as()); + break; + default: + throw comp_error(stm.loc(), "unknown statement"); + } +} + +auto compiler::emit_stmt_list(stmt_list const& stm) -> void +{ + for (auto const& entry : stm.list) + { + emit_stmt(*entry); + } +} + +auto compiler::emit_stmt_comp(stmt_comp const& stm) -> void +{ + emit_stmt_list(*stm.block); +} + +auto compiler::emit_stmt_dev(stmt_dev const& stm) -> void +{ + emit_stmt_list(*stm.block); +} + +auto compiler::emit_stmt_expr(stmt_expr const& stm) -> void +{ + switch (stm.value->kind()) + { + case node::expr_increment: + emit_expr_increment(stm.value->as(), true); + break; + case node::expr_decrement: + emit_expr_decrement(stm.value->as(), true); + break; + case node::expr_assign: + emit_expr_assign(stm.value->as()); + break; + case node::expr_call: + emit_expr_call(stm.value->as(), true); + break; + case node::expr_method: + emit_expr_method(stm.value->as(), true); + break; + case node::expr_const: + emit_expr_const(stm.value->as()); + break; + case node::expr_empty: + break; + default: + throw comp_error(stm.loc(), "unknown expr statement expression"); + } +} + +auto compiler::emit_stmt_endon(stmt_endon const& stm) -> void +{ + emit_expr(*stm.event); + emit_expr(*stm.obj); + emit_opcode(opcode::OP_EndOn); +} + +auto compiler::emit_stmt_notify(stmt_notify const& stm) -> void +{ + emit_opcode(opcode::OP_VoidCodePos); + + for (auto it = stm.args->list.rbegin(); it != stm.args->list.rend(); it++) + { + emit_expr(**it); + } + + emit_expr(*stm.event); + emit_expr(*stm.obj); + emit_opcode(opcode::OP_Notify); +} + +auto compiler::emit_stmt_wait(stmt_wait const& stm) -> void +{ + emit_expr(*stm.time); + emit_opcode(opcode::OP_Wait); +} + +auto compiler::emit_stmt_waittill(stmt_waittill const& stm) -> void +{ + emit_expr(*stm.event); + emit_expr(*stm.obj); + emit_opcode(opcode::OP_WaitTill); + + for (auto const& entry : stm.args->list) + { + emit_opcode(opcode::OP_SafeSetWaittillVariableFieldCached, fmt::format("{}", variable_access(entry->as()))); + } + + emit_opcode(opcode::OP_ClearParams); +} + +auto compiler::emit_stmt_waittillmatch(stmt_waittillmatch const& stm) -> void +{ + emit_expr_arguments(*stm.args); + emit_expr(*stm.event); + emit_expr(*stm.obj); + emit_opcode(opcode::OP_WaitTillMatch, fmt::format("{}", stm.args->list.size())); + emit_opcode(opcode::OP_ClearParams); +} + +auto compiler::emit_stmt_waittillframeend(stmt_waittillframeend const&) -> void +{ + emit_opcode(opcode::OP_WaitTillFrameEnd); +} + +auto compiler::emit_stmt_if(stmt_if const& stm) -> void +{ + auto end_loc = create_label(); + + if (stm.test->is()) + { + emit_expr(*stm.test->as().rvalue); + emit_opcode(opcode::OP_JumpOnTrue, end_loc); + } + else + { + emit_expr(*stm.test); + emit_opcode(opcode::OP_JumpOnFalse, end_loc); + } + + auto& paren = scopes_.back(); + scopes_.push_back(scope(paren.brk, paren.cnt)); + + emit_stmt(*stm.body); + + scopes_.pop_back(); + + insert_label(end_loc); +} + +auto compiler::emit_stmt_ifelse(stmt_ifelse const& stm) -> void +{ + auto else_loc = create_label(); + auto end_loc = create_label(); + + if (stm.test->is()) + { + emit_expr(*stm.test->as().rvalue); + emit_opcode(opcode::OP_JumpOnTrue, else_loc); + } + else + { + emit_expr(*stm.test); + emit_opcode(opcode::OP_JumpOnFalse, else_loc); + } + + auto& paren = scopes_.back(); + scopes_.push_back(scope(paren.brk, paren.cnt)); + emit_stmt(*stm.stmt_if); + scopes_.pop_back(); + + emit_opcode(opcode::OP_Jump, end_loc); + + insert_label(else_loc); + + paren = scopes_.back(); + scopes_.push_back(scope(paren.brk, paren.cnt)); + emit_stmt(*stm.stmt_else); + scopes_.pop_back(); + + insert_label(end_loc); +} + +auto compiler::emit_stmt_while(stmt_while const& stm) -> void +{ + auto break_loc = create_label(); + auto continue_loc = insert_label(); + auto old_break = can_break_; + auto old_continue = can_continue_; + can_break_ = true; + can_continue_ = true; + + if (stm.test->is()) + { + emit_expr(*stm.test->as().rvalue); + emit_opcode(opcode::OP_JumpOnTrue, break_loc); + } + else + { + emit_expr(*stm.test); + emit_opcode(opcode::OP_JumpOnFalse, break_loc); + } + + scopes_.push_back(scope(break_loc, continue_loc)); + emit_stmt(*stm.body); + scopes_.pop_back(); + + emit_opcode(opcode::OP_Jump, continue_loc); + insert_label(break_loc); + + can_break_ = old_break; + can_continue_ = old_continue; +} + +auto compiler::emit_stmt_dowhile(stmt_dowhile const& stm) -> void +{ + auto old_break = can_break_; + auto old_continue = can_continue_; + can_break_ = true; + can_continue_ = true; + + auto break_loc = create_label(); + auto continue_loc = create_label(); + auto begin_loc = insert_label(); + + scopes_.push_back(scope(break_loc, continue_loc)); + emit_stmt(*stm.body); + scopes_.pop_back(); + + insert_label(continue_loc); + + if (stm.test->is()) + { + emit_expr(*stm.test->as().rvalue); + emit_opcode(opcode::OP_JumpOnFalse, begin_loc); + } + else + { + emit_expr(*stm.test); + emit_opcode(opcode::OP_JumpOnTrue, begin_loc); + } + + insert_label(break_loc); + + can_break_ = old_break; + can_continue_ = old_continue; +} + +auto compiler::emit_stmt_for(stmt_for const& stm) -> void +{ + auto old_break = can_break_; + auto old_continue = can_continue_; + + emit_stmt(*stm.init); + + auto break_loc = create_label(); + auto continue_loc = create_label(); + + auto begin_loc = insert_label(); + + bool const_cond = is_constant_condition(*stm.test); + + if (!const_cond) + { + emit_expr(*stm.test); + emit_opcode(opcode::OP_JumpOnFalse, break_loc); + } + + can_break_ = true; + can_continue_ = true; + + scopes_.push_back(scope(break_loc, continue_loc)); + emit_stmt(*stm.body); + scopes_.pop_back(); + + can_break_ = false; + can_continue_ = false; + + insert_label(continue_loc); + emit_stmt(*stm.iter); + emit_opcode(opcode::OP_Jump, begin_loc); + insert_label(break_loc); + + can_break_ = old_break; + can_continue_ = old_continue; +} + +auto compiler::emit_stmt_foreach(stmt_foreach const& stm) -> void +{ + auto old_break = can_break_; + auto old_continue = can_continue_; + + emit_expr(*stm.container); + emit_expr_variable_ref(*stm.array, true); + emit_expr_variable(*stm.array); + emit_opcode(opcode::OP_FirstArrayKey); + emit_expr_variable_ref(*stm.key, true); + + auto break_loc = create_label(); + auto continue_loc = create_label(); + auto begin_loc = insert_label(); + + emit_expr_variable(*stm.key); + emit_opcode(opcode::OP_IsDefined); + emit_opcode(opcode::OP_JumpOnFalse, break_loc); + + can_break_ = true; + can_continue_ = true; + + emit_expr_variable(*stm.key); + emit_opcode(opcode::OP_EvalLocalVariableCached, fmt::format("{}", variable_access(stm.array->as()))); + emit_opcode(opcode::OP_EvalArray); + emit_expr_variable_ref(*stm.value, true); + + scopes_.push_back(scope(break_loc, continue_loc)); + emit_stmt(*stm.body); + scopes_.pop_back(); + + can_break_ = false; + can_continue_ = false; + + insert_label(continue_loc); + + emit_expr_variable(*stm.key); + emit_expr_variable(*stm.array); + emit_opcode(opcode::OP_NextArrayKey); + emit_expr_variable_ref(*stm.key, true); + emit_opcode(opcode::OP_Jump, begin_loc); + insert_label(break_loc); + + can_break_ = old_break; + can_continue_ = old_continue; +} + +auto compiler::emit_stmt_switch(stmt_switch const& stm) -> void +{ + auto old_break = can_break_; + can_break_ = false; + + auto table_loc = create_label(); + auto break_loc = create_label(); + + emit_expr(*stm.test); + emit_opcode(opcode::OP_Switch, table_loc); + + can_break_ = true; + + auto data = std::vector{}; + data.push_back(fmt::format("{}", stm.body->block->list.size())); + + auto type = switch_type::none; + auto loc_default = std::string{}; + auto has_default = false; + + for (auto i = 0u; i < stm.body->block->list.size(); i++) + { + auto const& entry = stm.body->block->list[i]; + + if (entry->is()) + { + data.push_back("case"); + + if (entry->as().value->is()) + { + if (type == switch_type::string) + { + throw comp_error(entry->loc(), "switch cases with different types"); + } + + type = switch_type::integer; + + data.push_back(entry->as().value->as().value); + data.push_back(insert_label()); + } + else if (entry->as().value->is()) + { + if (type == switch_type::integer) + { + throw comp_error(entry->loc(), "switch cases with different types"); + } + + type = switch_type::string; + + data.push_back(entry->as().value->as().value); + data.push_back(insert_label()); + } + else + { + throw comp_error(entry->loc(), "case type must be int or string"); + } + + auto& paren = scopes_.back(); + scopes_.push_back(scope(break_loc, paren.cnt)); + emit_stmt_list(*entry->as().body); + scopes_.pop_back(); + } + else if (entry->is()) + { + loc_default = insert_label(); + has_default = true; + + auto& paren = scopes_.back(); + scopes_.push_back(scope(break_loc, paren.cnt)); + emit_stmt_list(*entry->as().body); + scopes_.pop_back(); + } + else + { + throw comp_error(entry->loc(), "missing case statement"); + } + } + + if (has_default) + { + data.push_back("default"); + data.push_back(loc_default); + } + + data.push_back(fmt::format("{}", static_cast>(type))); + + insert_label(table_loc); + emit_opcode(opcode::OP_EndSwitch, data); + insert_label(break_loc); + + can_break_ = old_break; +} + +auto compiler::emit_stmt_case(stmt_case const& stm) -> void +{ + throw comp_error(stm.loc(), "illegal case statement"); +} + +auto compiler::emit_stmt_default(stmt_default const& stm) -> void +{ + throw comp_error(stm.loc(), "illegal default statement"); +} + +auto compiler::emit_stmt_break(stmt_break const& stm) -> void +{ + if (!can_break_ || scopes_.back().abort != scope::abort_none || scopes_.back().brk == "") + throw comp_error(stm.loc(), "illegal break statement"); + + scopes_.back().abort = scope::abort_break; + emit_opcode(opcode::OP_Jump, scopes_.back().brk); +} + +auto compiler::emit_stmt_continue(stmt_continue const& stm) -> void +{ + if (!can_continue_ || scopes_.back().abort != scope::abort_none || scopes_.back().cnt == "") + throw comp_error(stm.loc(), "illegal continue statement"); + + scopes_.back().abort = scope::abort_continue; + emit_opcode(opcode::OP_Jump, scopes_.back().cnt); +} + +auto compiler::emit_stmt_return(stmt_return const& stm) -> void +{ + if (scopes_.back().abort == scope::abort_none) + scopes_.back().abort = scope::abort_return; + + if (!stm.value->is()) + { + emit_expr(*stm.value); + emit_opcode(opcode::OP_Return); + } + else + emit_opcode(opcode::OP_End); +} + +auto compiler::emit_stmt_breakpoint(stmt_breakpoint const&) -> void +{ + // TODO: +} + +auto compiler::emit_stmt_prof_begin(stmt_prof_begin const&) -> void +{ + // TODO: +} + +auto compiler::emit_stmt_prof_end(stmt_prof_end const&) -> void +{ + // TODO: +} + +auto compiler::emit_expr(expr const& exp) -> void +{ + switch (exp.kind()) + { + case node::expr_paren: + emit_expr(*exp.as().value); + break; + case node::expr_ternary: + emit_expr_ternary(exp.as()); + break; + case node::expr_binary: + emit_expr_binary(exp.as()); + break; + case node::expr_complement: + emit_expr_complement(exp.as()); + break; + case node::expr_negate: + emit_expr_negate(exp.as()); + break; + case node::expr_not: + emit_expr_not(exp.as()); + break; + case node::expr_call: + emit_expr_call(exp.as(), false); + break; + case node::expr_method: + emit_expr_method(exp.as(), false); + break; + case node::expr_isdefined: + emit_expr_isdefined(exp.as()); + break; + case node::expr_vectorscale: + emit_expr_vectorscale(exp.as()); + break; + case node::expr_anglestoup: + emit_expr_anglestoup(exp.as()); + break; + case node::expr_anglestoright: + emit_expr_anglestoright(exp.as()); + break; + case node::expr_anglestoforward: + emit_expr_anglestoforward(exp.as()); + break; + case node::expr_angleclamp180: + emit_expr_angleclamp180(exp.as()); + break; + case node::expr_vectortoangles: + emit_expr_vectortoangles(exp.as()); + break; + case node::expr_abs: + emit_expr_abs(exp.as()); + break; + case node::expr_gettime: + emit_expr_gettime(exp.as()); + break; + case node::expr_getdvar: + emit_expr_getdvar(exp.as()); + break; + case node::expr_getdvarint: + emit_expr_getdvarint(exp.as()); + break; + case node::expr_getdvarfloat: + emit_expr_getdvarfloat(exp.as()); + break; + case node::expr_getdvarvector: + emit_expr_getdvarvector(exp.as()); + break; + case node::expr_getdvarcolorred: + emit_expr_getdvarcolorred(exp.as()); + break; + case node::expr_getdvarcolorgreen: + emit_expr_getdvarcolorgreen(exp.as()); + break; + case node::expr_getdvarcolorblue: + emit_expr_getdvarcolorblue(exp.as()); + break; + case node::expr_getdvarcoloralpha: + emit_expr_getdvarcoloralpha(exp.as()); + break; + case node::expr_getfirstarraykey: + emit_expr_getfirstarraykey(exp.as()); + break; + case node::expr_getnextarraykey: + emit_expr_getnextarraykey(exp.as()); + break; + case node::expr_reference: + emit_expr_reference(exp.as()); + break; + case node::expr_array: + emit_expr_array(exp.as()); + break; + case node::expr_field: + emit_expr_field(exp.as()); + break; + case node::expr_size: + emit_expr_size(exp.as()); + break; + case node::expr_empty_array: + emit_opcode(opcode::OP_EmptyArray); + break; + case node::expr_undefined: + emit_opcode(opcode::OP_GetUndefined); + break; + case node::expr_game: + emit_opcode(opcode::OP_GetGame); + break; + case node::expr_self: + emit_opcode(opcode::OP_GetSelf); + break; + case node::expr_anim: + emit_opcode(opcode::OP_GetAnim); + break; + case node::expr_level: + emit_opcode(opcode::OP_GetLevel); + break; + case node::expr_animation: + emit_expr_animation(exp.as()); + break; + case node::expr_animtree: + emit_expr_animtree(exp.as()); + break; + case node::expr_identifier: + emit_expr_local(exp.as()); + break; + case node::expr_istring: + emit_expr_istring(exp.as()); + break; + case node::expr_string: + emit_expr_string(exp.as()); + break; + case node::expr_vector: + emit_expr_vector(exp.as()); + break; + case node::expr_hash: + emit_expr_hash(exp.as()); + break; + case node::expr_float: + emit_expr_float(exp.as()); + break; + case node::expr_integer: + emit_expr_integer(exp.as()); + break; + case node::expr_false: + emit_expr_false(exp.as()); + break; + case node::expr_true: + emit_expr_true(exp.as()); + break; + case node::expr_empty: + break; + default: + throw comp_error(exp.loc(), "unknown expression"); + } +} + +auto compiler::emit_expr_const(expr_const const& exp) -> void +{ + auto const itr = constants_.find(exp.lvalue->value); + + if (itr != constants_.end()) + throw comp_error(exp.loc(), fmt::format("duplicated constant '{}'", exp.lvalue->value)); + + if (std::find(stackframe_.begin(), stackframe_.end(), exp.lvalue->value) != stackframe_.end()) + throw comp_error(exp.loc(), fmt::format("constant already defined as local variable '{}'", exp.lvalue->value)); + + constants_.insert({ exp.lvalue->value, exp.rvalue.get() }); +} + +auto compiler::emit_expr_assign(expr_assign const& exp) -> void +{ + if (exp.oper == expr_assign::op::eq) + { + if (exp.rvalue->is()) + { + emit_expr_clear(*exp.lvalue); + } + else + { + emit_expr(*exp.rvalue); + emit_expr_variable_ref(*exp.lvalue, true); + } + + return; + } + + emit_expr(*exp.lvalue); + emit_expr(*exp.rvalue); + + switch (exp.oper) + { + case expr_assign::op::add: + emit_opcode(opcode::OP_Plus); + break; + case expr_assign::op::sub: + emit_opcode(opcode::OP_Minus); + break; + case expr_assign::op::mul: + emit_opcode(opcode::OP_Multiply); + break; + case expr_assign::op::div: + emit_opcode(opcode::OP_Divide); + break; + case expr_assign::op::mod: + emit_opcode(opcode::OP_Modulus); + break; + case expr_assign::op::shl: + emit_opcode(opcode::OP_ShiftLeft); + break; + case expr_assign::op::shr: + emit_opcode(opcode::OP_ShiftRight); + break; + case expr_assign::op::bwor: + emit_opcode(opcode::OP_Bit_Or); + break; + case expr_assign::op::bwand: + emit_opcode(opcode::OP_Bit_And); + break; + case expr_assign::op::bwexor: + emit_opcode(opcode::OP_Bit_Xor); + break; + default: + throw comp_error(exp.loc(), "unknown assign operation"); + } + + emit_expr_variable_ref(*exp.lvalue, true); +} + +auto compiler::emit_expr_clear(expr const& exp) -> void +{ + switch (exp.kind()) + { + case node::expr_array: + emit_expr(*exp.as().key); + exp.as().obj->is() ? emit_opcode(opcode::OP_GetGameRef) : emit_expr_variable_ref(*exp.as().obj, false); + emit_opcode(opcode::OP_ClearArray); + break; + case node::expr_field: + emit_expr_object(*exp.as().obj); + emit_opcode(opcode::OP_ClearFieldVariable, exp.as().field->value); + break; + case node::expr_identifier: + emit_opcode(opcode::OP_GetUndefined); + emit_expr_local_ref(exp.as(), true); + break; + default: + throw comp_error(exp.loc(), "unknown clear variable lvalue"); + } +} + +auto compiler::emit_expr_increment(expr_increment const& exp, bool is_stmt) -> void +{ + if (is_stmt) + { + emit_expr_variable_ref(*exp.lvalue, false); + emit_opcode(opcode::OP_Inc); + emit_opcode(opcode::OP_SetVariableField); + } + else + { + // TODO: + } +} + +auto compiler::emit_expr_decrement(expr_decrement const& exp, bool is_stmt) -> void +{ + if (is_stmt) + { + emit_expr_variable_ref(*exp.lvalue, false); + emit_opcode(opcode::OP_Dec); + emit_opcode(opcode::OP_SetVariableField); + } + else + { + // TODO: + } +} + +auto compiler::emit_expr_ternary(expr_ternary const& exp) -> void +{ + auto else_loc = create_label(); + auto end_loc = create_label(); + + if (exp.test->is()) + { + emit_expr(*exp.test->as().rvalue); + emit_opcode(opcode::OP_JumpOnTrue, else_loc); + } + else + { + emit_expr(*exp.test); + emit_opcode(opcode::OP_JumpOnFalse, else_loc); + } + + emit_expr(*exp.true_expr); + emit_opcode(opcode::OP_Jump, end_loc); + + insert_label(else_loc); + emit_expr(*exp.false_expr); + insert_label(end_loc); +} + +auto compiler::emit_expr_binary(expr_binary const& exp) -> void +{ + if (exp.oper == expr_binary::op::bool_and) + { + auto label = create_label(); + + emit_expr(*exp.lvalue); + emit_opcode(opcode::OP_JumpOnFalseExpr, label); + emit_expr(*exp.rvalue); + + insert_label(label); + } + else if (exp.oper == expr_binary::op::bool_or) + { + auto label = create_label(); + + emit_expr(*exp.lvalue); + emit_opcode(opcode::OP_JumpOnTrueExpr, label); + emit_expr(*exp.rvalue); + + insert_label(label); + } + else + { + emit_expr(*exp.lvalue); + emit_expr(*exp.rvalue); + + switch (exp.oper) + { + case expr_binary::op::eq: + emit_opcode(opcode::OP_Equal); + break; + case expr_binary::op::ne: + emit_opcode(opcode::OP_NotEqual); + break; + case expr_binary::op::lt: + emit_opcode(opcode::OP_LessThan); + break; + case expr_binary::op::gt: + emit_opcode(opcode::OP_GreaterThan); + break; + case expr_binary::op::le: + emit_opcode(opcode::OP_LessThanOrEqualTo); + break; + case expr_binary::op::ge: + emit_opcode(opcode::OP_GreaterThanOrEqualTo); + break; + case expr_binary::op::bwor: + emit_opcode(opcode::OP_Bit_Or); + break; + case expr_binary::op::bwand: + emit_opcode(opcode::OP_Bit_And); + break; + case expr_binary::op::bwexor: + emit_opcode(opcode::OP_Bit_Xor); + break; + case expr_binary::op::shl: + emit_opcode(opcode::OP_ShiftLeft); + break; + case expr_binary::op::shr: + emit_opcode(opcode::OP_ShiftRight); + break; + case expr_binary::op::add: + emit_opcode(opcode::OP_Plus); + break; + case expr_binary::op::sub: + emit_opcode(opcode::OP_Minus); + break; + case expr_binary::op::mul: + emit_opcode(opcode::OP_Multiply); + break; + case expr_binary::op::div: + emit_opcode(opcode::OP_Divide); + break; + case expr_binary::op::mod: + emit_opcode(opcode::OP_Modulus); + break; + default: + throw comp_error(exp.loc(), "unknown binary expression"); + } + } +} + +auto compiler::emit_expr_complement(expr_complement const& exp) -> void +{ + emit_expr(*exp.rvalue); + emit_opcode(opcode::OP_BoolComplement); +} + +auto compiler::emit_expr_negate(expr_negate const& exp) -> void +{ + emit_opcode(opcode::OP_GetZero); + emit_expr(*exp.rvalue); + emit_opcode(opcode::OP_Minus); +} + +auto compiler::emit_expr_not(expr_not const& exp) -> void +{ + emit_expr(*exp.rvalue); + emit_opcode(opcode::OP_BoolNot); +} + +auto compiler::emit_expr_call(expr_call const& exp, bool is_stmt) -> void +{ + if (exp.value->is()) + emit_expr_call_pointer(exp.value->as(), is_stmt); + else if (exp.value->is()) + emit_expr_call_function(exp.value->as(), is_stmt); + else + throw comp_error(exp.loc(), "unknown function call expression"); +} + +auto compiler::emit_expr_call_pointer(expr_pointer const& exp, bool is_stmt) -> void +{ + emit_opcode(opcode::OP_PreScriptCall); + emit_expr_arguments(*exp.args); + emit_expr(*exp.func); + + auto argcount = fmt::format("{}", exp.args->list.size()); + + switch (exp.mode) + { + case call::mode::normal: + emit_opcode(opcode::OP_ScriptFunctionCallPointer, argcount); + break; + case call::mode::thread: + emit_opcode(opcode::OP_ScriptThreadCallPointer, argcount); + break; + default: + break; + } + + if (is_stmt) + emit_opcode(opcode::OP_DecTop); +} + +auto compiler::emit_expr_call_function(expr_function const& exp, bool is_stmt) -> void +{ + if (exp.path->value != "") + { + bool found = false; + + for (const auto& entry : assembly_->includes) + { + if (entry == exp.path->value) + { + found = true; + break; + } + } + + if (!found) + { + assembly_->includes.push_back(exp.path->value); + } + } + + bool as_dev = false; + std::string end; + + if (!developer_thread_ && is_stmt && exp.name->value == "assert") + { + as_dev = true; + developer_thread_ = true; + end = create_label(); + emit_opcode(opcode::OP_DevblockBegin, end); + } + + emit_opcode(opcode::OP_PreScriptCall); + emit_expr_arguments(*exp.args); + + auto argcount = fmt::format("{}", exp.args->list.size()); + auto flags = developer_thread_ ? static_cast(import_flags::developer) : 0; + + switch (exp.mode) + { + case call::mode::normal: + flags |= static_cast(import_flags::func_call); + emit_opcode(opcode::OP_ScriptFunctionCall, { exp.path->value, exp.name->value, argcount, fmt::format("{}", flags) }); + break; + case call::mode::thread: + flags |= static_cast(import_flags::func_call_thread); + emit_opcode(opcode::OP_ScriptThreadCall, { exp.path->value, exp.name->value, argcount, fmt::format("{}", flags) }); + break; + default: + break; + } + + if (is_stmt) + emit_opcode(opcode::OP_DecTop); + + if (as_dev) + { + insert_label(end); + developer_thread_ = false; + } +} + +auto compiler::emit_expr_method(expr_method const& exp, bool is_stmt) -> void +{ + if (exp.value->is()) + emit_expr_method_pointer(exp.value->as(), *exp.obj, is_stmt); + else if (exp.value->is()) + emit_expr_method_function(exp.value->as(), *exp.obj, is_stmt); + else + throw comp_error(exp.loc(), "unknown method call expression"); +} + +auto compiler::emit_expr_method_pointer(expr_pointer const& exp, expr const& obj, bool is_stmt) -> void +{ + emit_opcode(opcode::OP_PreScriptCall); + emit_expr_arguments(*exp.args); + emit_expr(obj); + emit_expr(*exp.func); + + auto argcount = fmt::format("{}", exp.args->list.size()); + + switch (exp.mode) + { + case call::mode::normal: + emit_opcode(opcode::OP_ScriptMethodCallPointer, argcount); + break; + case call::mode::thread: + emit_opcode(opcode::OP_ScriptMethodThreadCallPointer, argcount); + break; + default: + break; + } + + if (is_stmt) + emit_opcode(opcode::OP_DecTop); +} + +auto compiler::emit_expr_method_function(expr_function const& exp, expr const& obj, bool is_stmt) -> void +{ + if (exp.path->value != "") + { + bool found = false; + + for (const auto& entry : assembly_->includes) + { + if (entry == exp.path->value) + { + found = true; + break; + } + } + + if (!found) + { + assembly_->includes.push_back(exp.path->value); + } + } + + emit_opcode(opcode::OP_PreScriptCall); + emit_expr_arguments(*exp.args); + emit_expr(obj); + + auto argcount = fmt::format("{}", exp.args->list.size()); + auto flags = developer_thread_ ? static_cast(import_flags::developer) : 0; + + switch (exp.mode) + { + case call::mode::normal: + flags |= static_cast(import_flags::meth_call); + emit_opcode(opcode::OP_ScriptMethodCall, { exp.path->value, exp.name->value, argcount, fmt::format("{}", flags) }); + break; + case call::mode::thread: + flags |= static_cast(import_flags::meth_call_thread); + emit_opcode(opcode::OP_ScriptMethodThreadCall, { exp.path->value, exp.name->value, argcount, fmt::format("{}", flags) }); + break; + default: + break; + } + + if (is_stmt) + emit_opcode(opcode::OP_DecTop); +} + +auto compiler::emit_expr_parameters(expr_parameters const& exp) -> void +{ + if (stackframe_.size() == 0) + { + emit_opcode(opcode::OP_CheckClearParams); + } + else + { + emit_opcode(opcode::OP_SafeCreateLocalVariables, stackframe_); + } + + for (auto const& entry : exp.list) + { + if (entry->is()) + { + auto end_loc = create_label(); + emit_expr_variable(*(entry->as().lvalue)); + emit_opcode(opcode::OP_IsDefined); + emit_opcode(opcode::OP_JumpOnTrue, end_loc); + emit_expr(*(entry->as().rvalue)); + emit_expr_variable_ref(*(entry->as().lvalue), true); + insert_label(end_loc); + } + } +} + +auto compiler::emit_expr_arguments(expr_arguments const& exp) -> void +{ + for (auto it = exp.list.rbegin(); it != exp.list.rend(); ++it) + { + emit_expr(**it); + } +} + +auto compiler::emit_expr_isdefined(expr_isdefined const& exp) -> void +{ + emit_expr(*exp.value); + emit_opcode(opcode::OP_IsDefined); +} + +auto compiler::emit_expr_vectorscale(expr_vectorscale const& exp) -> void +{ + emit_expr(*exp.arg2); + emit_expr(*exp.arg1); + emit_opcode(opcode::OP_VectorScale); +} + +auto compiler::emit_expr_anglestoup(expr_anglestoup const& exp) -> void +{ + emit_expr(*exp.arg); + emit_opcode(opcode::OP_AnglesToUp); +} + +auto compiler::emit_expr_anglestoright(expr_anglestoright const& exp) -> void +{ + emit_expr(*exp.arg); + emit_opcode(opcode::OP_AnglesToRight); +} + +auto compiler::emit_expr_anglestoforward(expr_anglestoforward const& exp) -> void +{ + emit_expr(*exp.arg); + emit_opcode(opcode::OP_AnglesToForward); +} + +auto compiler::emit_expr_angleclamp180(expr_angleclamp180 const& exp) -> void +{ + emit_expr(*exp.arg); + emit_opcode(opcode::OP_AngleClamp180); +} + +auto compiler::emit_expr_vectortoangles(expr_vectortoangles const& exp) -> void +{ + emit_expr(*exp.arg); + emit_opcode(opcode::OP_VectorToAngles); +} + +auto compiler::emit_expr_abs(expr_abs const& exp) -> void +{ + emit_expr(*exp.arg); + emit_opcode(opcode::OP_Abs); +} + +auto compiler::emit_expr_gettime(expr_gettime const&) -> void +{ + emit_opcode(opcode::OP_GetTime); +} + +auto compiler::emit_expr_getdvar(expr_getdvar const& exp) -> void +{ + emit_expr(*exp.arg); + emit_opcode(opcode::OP_GetDvar); +} + +auto compiler::emit_expr_getdvarint(expr_getdvarint const& exp) -> void +{ + emit_expr(*exp.arg); + emit_opcode(opcode::OP_GetDvarInt); +} + +auto compiler::emit_expr_getdvarfloat(expr_getdvarfloat const& exp) -> void +{ + emit_expr(*exp.arg); + emit_opcode(opcode::OP_GetDvarFloat); +} + +auto compiler::emit_expr_getdvarvector(expr_getdvarvector const& exp) -> void +{ + emit_expr(*exp.arg); + emit_opcode(opcode::OP_GetDvarVector); +} + +auto compiler::emit_expr_getdvarcolorred(expr_getdvarcolorred const& exp) -> void +{ + emit_expr(*exp.arg); + emit_opcode(opcode::OP_GetDvarColorRed); +} + +auto compiler::emit_expr_getdvarcolorgreen(expr_getdvarcolorgreen const& exp) -> void +{ + emit_expr(*exp.arg); + emit_opcode(opcode::OP_GetDvarColorGreen); +} + +auto compiler::emit_expr_getdvarcolorblue(expr_getdvarcolorblue const& exp) -> void +{ + emit_expr(*exp.arg); + emit_opcode(opcode::OP_GetDvarColorBlue); +} + +auto compiler::emit_expr_getdvarcoloralpha(expr_getdvarcoloralpha const& exp) -> void +{ + emit_expr(*exp.arg); + emit_opcode(opcode::OP_GetDvarColorAlpha); +} + +auto compiler::emit_expr_getfirstarraykey(expr_getfirstarraykey const& exp) -> void +{ + emit_expr(*exp.arg); + emit_opcode(opcode::OP_FirstArrayKey); +} + +auto compiler::emit_expr_getnextarraykey(expr_getnextarraykey const& exp) -> void +{ + emit_expr(*exp.arg2); + emit_expr(*exp.arg1); + emit_opcode(opcode::OP_NextArrayKey); +} + +auto compiler::emit_expr_reference(expr_reference const& exp) -> void +{ + if (exp.path->value != "") + { + bool found = false; + + for (const auto& entry : assembly_->includes) + { + if (entry == exp.path->value) + { + found = true; + break; + } + } + + if (!found) + { + assembly_->includes.push_back(exp.path->value); + } + } + + // TODO: resolve import calls path + + auto flags = developer_thread_ ? static_cast(import_flags::developer) : 0; + flags |= static_cast(import_flags::func_reference); + + emit_opcode(opcode::OP_GetFunction, { exp.path->value, exp.name->value, "0", fmt::format("{}", flags) }); +} + +auto compiler::emit_expr_size(expr_size const& exp) -> void +{ + emit_expr(*exp.obj); + emit_opcode(opcode::OP_SizeOf); +} + +auto compiler::emit_expr_variable_ref(expr const& exp, bool set) -> void +{ + switch (exp.kind()) + { + case node::expr_array: + emit_expr_array_ref(exp.as(), set); + break; + case node::expr_field: + emit_expr_field_ref(exp.as(), set); + break; + case node::expr_identifier: + emit_expr_local_ref(exp.as(), set); + break; + default: + throw comp_error(exp.loc(), "invalid lvalue"); + } +} + +auto compiler::emit_expr_array_ref(expr_array const& exp, bool set) -> void +{ + emit_expr(*exp.key); + + switch (exp.obj->kind()) + { + case node::expr_game: + emit_opcode(opcode::OP_GetGameRef); + emit_opcode(opcode::OP_EvalArrayRef); + if (set) emit_opcode(opcode::OP_SetVariableField); + break; + case node::expr_array: + case node::expr_field: + case node::expr_identifier: + emit_expr_variable_ref(*exp.obj, false); + emit_opcode(opcode::OP_EvalArrayRef); + if (set) emit_opcode(opcode::OP_SetVariableField); + break; + case node::expr_call: + case node::expr_method: + default: + throw comp_error(exp.loc(), "invalid array lvalue"); + } +} + +auto compiler::emit_expr_field_ref(expr_field const& exp, bool set) -> void +{ + auto const& field = exp.field->value; + + switch (exp.obj->kind()) + { + case node::expr_level: + emit_opcode(opcode::OP_GetLevelObject); + emit_opcode(opcode::OP_EvalFieldVariableRef, field); + if (set) emit_opcode(opcode::OP_SetVariableField); + break; + case node::expr_anim: + emit_opcode(opcode::OP_GetAnimObject); + emit_opcode(opcode::OP_EvalFieldVariableRef, field); + if (set) emit_opcode(opcode::OP_SetVariableField); + break; + case node::expr_self: + emit_opcode(opcode::OP_GetSelfObject); + emit_opcode(opcode::OP_EvalFieldVariableRef, field); + if (set) emit_opcode(opcode::OP_SetVariableField); + break; + case node::expr_array: + emit_expr_array(exp.obj->as()); + emit_opcode(opcode::OP_CastFieldObject); + emit_opcode(opcode::OP_EvalFieldVariableRef, field); + if (set) emit_opcode(opcode::OP_SetVariableField); + break; + case node::expr_field: + emit_expr_field(exp.obj->as()); + emit_opcode(opcode::OP_CastFieldObject); + emit_opcode(opcode::OP_EvalFieldVariableRef, field); + if (set) emit_opcode(opcode::OP_SetVariableField); + break; + case node::expr_identifier: + emit_opcode(opcode::OP_EvalLocalVariableCached, fmt::format("{}", variable_access(exp.obj->as()))); + emit_opcode(opcode::OP_EvalFieldVariableRef, field); + if (set) emit_opcode(opcode::OP_SetVariableField); + break; + case node::expr_call: + emit_expr_call(exp.obj->as(), false); + emit_opcode(opcode::OP_CastFieldObject); + emit_opcode(opcode::OP_EvalFieldVariableRef, field); + if (set) emit_opcode(opcode::OP_SetVariableField); + break; + case node::expr_method: + emit_expr_method(exp.obj->as(), false); + emit_opcode(opcode::OP_CastFieldObject); + emit_opcode(opcode::OP_EvalFieldVariableRef, field); + if (set) emit_opcode(opcode::OP_SetVariableField); + break; + default: + throw comp_error(exp.obj->loc(), "not an object"); + } +} + +auto compiler::emit_expr_local_ref(expr_identifier const& exp, bool set) -> void +{ + auto const it = constants_.find(exp.value); + + if (it != constants_.end()) + { + throw comp_error(exp.loc(), fmt::format("variable name already defined as constant '{}'", exp.value)); + } + + emit_opcode(opcode::OP_EvalLocalVariableRefCached, fmt::format("{}", variable_access(exp))); + + if (set) + { + emit_opcode(opcode::OP_SetVariableField); + } +} + +auto compiler::emit_expr_variable(expr const& exp) -> void +{ + switch (exp.kind()) + { + case node::expr_array: + emit_expr_array(exp.as()); + break; + case node::expr_field: + emit_expr_field(exp.as()); + break; + case node::expr_identifier: + emit_expr_local(exp.as()); + break; + default: + throw comp_error(exp.loc(), "invalid variable type."); + } +} + +auto compiler::emit_expr_array(expr_array const& exp) -> void +{ + emit_expr(*exp.key); + emit_expr(*exp.obj); + emit_opcode(opcode::OP_EvalArray); +} + +auto compiler::emit_expr_field(expr_field const& exp) -> void +{ + auto const& field = exp.field->value; + + switch (exp.obj->kind()) + { + case node::expr_level: + emit_opcode(opcode::OP_GetLevelObject); + emit_opcode(opcode::OP_EvalFieldVariable, field); + break; + case node::expr_anim: + emit_opcode(opcode::OP_GetAnimObject); + emit_opcode(opcode::OP_EvalFieldVariable, field); + break; + case node::expr_self: + emit_opcode(opcode::OP_GetSelfObject); + emit_opcode(opcode::OP_EvalFieldVariable, field); + break; + case node::expr_array: + emit_expr_array(exp.obj->as()); + emit_opcode(opcode::OP_CastFieldObject); + emit_opcode(opcode::OP_EvalFieldVariable, field); + break; + case node::expr_field: + emit_expr_field(exp.obj->as()); + emit_opcode(opcode::OP_CastFieldObject); + emit_opcode(opcode::OP_EvalFieldVariable, field); + break; + case node::expr_call: + emit_expr_call(exp.obj->as(), false); + emit_opcode(opcode::OP_CastFieldObject); + emit_opcode(opcode::OP_EvalFieldVariable, field); + break; + case node::expr_method: + emit_expr_method(exp.obj->as(), false); + emit_opcode(opcode::OP_CastFieldObject); + emit_opcode(opcode::OP_EvalFieldVariable, field); + break; + case node::expr_identifier: + emit_opcode(opcode::OP_EvalLocalVariableCached, fmt::format("{}", variable_access(exp.obj->as()))); + emit_opcode(opcode::OP_CastFieldObject); + emit_opcode(opcode::OP_EvalFieldVariable, field); + break; + default: + throw comp_error(exp.loc(), "unknown field variable object type"); + } +} + +auto compiler::emit_expr_local(expr_identifier const& exp) -> void +{ + auto const it = constants_.find(exp.value); + + if (it != constants_.end()) + emit_expr(*it->second); + else + emit_opcode(opcode::OP_EvalLocalVariableCached, fmt::format("{}", variable_access(exp))); +} + +auto compiler::emit_expr_object(expr const& exp) -> void +{ + switch (exp.kind()) + { + case node::expr_level: + emit_opcode(opcode::OP_GetLevelObject); + break; + case node::expr_anim: + emit_opcode(opcode::OP_GetAnimObject); + break; + case node::expr_self: + emit_opcode(opcode::OP_GetSelfObject); + break; + case node::expr_array: + emit_expr_array(exp.as()); + emit_opcode(opcode::OP_CastFieldObject); + break; + case node::expr_field: + emit_expr_field(exp.as()); + emit_opcode(opcode::OP_CastFieldObject); + break; + case node::expr_call: + emit_expr_call(exp.as(), false); + emit_opcode(opcode::OP_CastFieldObject); + break; + case node::expr_method: + emit_expr_method(exp.as(), false); + emit_opcode(opcode::OP_CastFieldObject); + break; + case node::expr_identifier: + emit_opcode(opcode::OP_EvalLocalVariableCached, fmt::format("{}", variable_access(exp.as()))); + emit_opcode(opcode::OP_CastFieldObject); + break; + default: + throw comp_error(exp.loc(), "not an object"); + } +} + +auto compiler::emit_expr_vector(expr_vector const& exp) -> void +{ + auto data = std::vector{}; + auto isconst = true; + auto flags = 0; + + if (exp.x->is()) + { + auto value = std::atoi(exp.x->as().value.data()); + data.push_back(exp.x->as().value); + + if (value != 1 && value != -1 && value != 0) + isconst = false; + else + flags |= (value == 1) ? 0x20 : (value == -1) ? 0x10 : 0; + } + else if (exp.x->is()) + { + auto value = std::stof(exp.x->as().value.data()); + data.push_back(exp.x->as().value); + + if (value != 1.0 && value != -1.0 && value != 0.0) + isconst = false; + else + flags |= (value == 1.0) ? 0x20 : (value == -1.0) ? 0x10 : 0; + } + else + { + isconst = false; + } + + if (exp.y->is()) + { + auto value = std::atoi(exp.y->as().value.data()); + data.push_back(exp.y->as().value); + + if (value != 1 && value != -1 && value != 0) + isconst = false; + else + flags |= (value == 1) ? 0x08 : (value == -1) ? 0x04 : 0; + } + else if (exp.y->is()) + { + auto value = std::stof(exp.y->as().value.data()); + data.push_back(exp.y->as().value); + + if (value != 1.0 && value != -1.0 && value != 0.0) + isconst = false; + else + flags |= (value == 1.0) ? 0x08 : (value == -1.0) ? 0x04 : 0; + } + else + { + isconst = false; + } + + if (exp.z->is()) + { + auto value = std::atoi(exp.z->as().value.data()); + data.push_back(exp.z->as().value); + + if (value != 1 && value != -1 && value != 0) + isconst = false; + else + flags |= (value == 1) ? 0x02 : (value == -1) ? 0x01 : 0; + } + else if (exp.z->is()) + { + auto value = std::stof(exp.z->as().value.data()); + data.push_back(exp.z->as().value); + + if (value != 1.0 && value != -1.0 && value != 0.0) + isconst = false; + else + flags |= (value == 1.0) ? 0x02 : (value == -1.0) ? 0x01 : 0; + } + else + { + isconst = false; + } + + if (isconst) + { + emit_opcode(opcode::OP_VectorConstant, fmt::format("{}", flags)); + } + else + { + // OP_GetVector seems to be broken, always use OP_Vector + emit_expr(*exp.z); + emit_expr(*exp.y); + emit_expr(*exp.x); + emit_opcode(opcode::OP_Vector); + } +} + +auto compiler::emit_expr_animation(expr_animation const& exp) -> void +{ + if (animtree_.empty()) + { + throw comp_error(exp.loc(), "trying to use animation without specified using animtree"); + } + + emit_opcode(opcode::OP_GetAnimation, { animtree_, exp.value }); +} + +auto compiler::emit_expr_animtree(expr_animtree const& exp) -> void +{ + if (animtree_.empty()) + { + throw comp_error(exp.loc(), "trying to use animtree without specified using animtree"); + } + + emit_opcode(opcode::OP_GetInteger, { animtree_, "-1" }); +} + +auto compiler::emit_expr_istring(expr_istring const& exp) -> void +{ + emit_opcode(opcode::OP_GetIString, exp.value); +} + +auto compiler::emit_expr_string(expr_string const& exp) -> void +{ + emit_opcode(opcode::OP_GetString, exp.value); +} + +auto compiler::emit_expr_hash(expr_hash const& exp) -> void +{ + emit_opcode(opcode::OP_GetHash, exp.value); +} + +auto compiler::emit_expr_float(expr_float const& exp) -> void +{ + emit_opcode(opcode::OP_GetFloat, exp.value); +} + +auto compiler::emit_expr_integer(expr_integer const& exp) -> void +{ + auto value = std::atoi(exp.value.data()); + + if (value == 0) + { + emit_opcode(opcode::OP_GetZero); + } + else if (value > 0 && value < 256) + { + emit_opcode(opcode::OP_GetByte, exp.value); + } + else if (value < 0 && value > -256) + { + emit_opcode(opcode::OP_GetNegByte, exp.value.substr(1)); + } + else if (value > 0 && value < 65536) + { + emit_opcode(opcode::OP_GetUnsignedShort, exp.value); + } + else if (value < 0 && value > -65536) + { + emit_opcode(opcode::OP_GetNegUnsignedShort, exp.value.substr(1)); + } + else + { + emit_opcode(opcode::OP_GetInteger, exp.value); + } +} + +auto compiler::emit_expr_false(expr_false const&) -> void +{ + emit_opcode(opcode::OP_GetZero); +} + +auto compiler::emit_expr_true(expr_true const&) -> void +{ + emit_opcode(opcode::OP_GetByte, "1"); +} + +auto compiler::emit_opcode(opcode op) -> void +{ + function_->instructions.push_back(instruction::make()); + + auto& inst = function_->instructions.back(); + inst->opcode = op; + inst->size = ctx_->opcode_size(op); + inst->index = index_; + + index_ += inst->size; +} + +auto compiler::emit_opcode(opcode op, std::string const& data) -> void +{ + function_->instructions.push_back(instruction::make()); + + auto& inst = function_->instructions.back(); + inst->opcode = op; + inst->size = ctx_->opcode_size(op); + inst->index = index_; + inst->data.push_back(data); + + index_ += inst->size; +} + +auto compiler::emit_opcode(opcode op, std::vector const& data) -> void +{ + function_->instructions.push_back(instruction::make()); + + auto& inst = function_->instructions.back(); + inst->opcode = op; + inst->size = ctx_->opcode_size(op); + inst->index = index_; + inst->data = data; + + index_ += inst->size; +} + +auto compiler::process_function(decl_function const& func) -> void +{ + process_expr_parameters(*func.params); + process_stmt_comp(*func.body); +} + +auto compiler::process_stmt(stmt const& stm) -> void +{ + switch (stm.kind()) + { + case node::stmt_list: + process_stmt_list(stm.as()); + break; + case node::stmt_comp: + process_stmt_comp(stm.as()); + break; + case node::stmt_dev: + process_stmt_dev(stm.as()); + break; + case node::stmt_expr: + process_stmt_expr(stm.as()); + break; + case node::stmt_waittill: + process_stmt_waittill(stm.as()); + break; + case node::stmt_if: + process_stmt_if(stm.as()); + break; + case node::stmt_ifelse: + process_stmt_ifelse(stm.as()); + break; + case node::stmt_while: + process_stmt_while(stm.as()); + break; + case node::stmt_dowhile: + process_stmt_dowhile(stm.as()); + break; + case node::stmt_for: + process_stmt_for(stm.as()); + break; + case node::stmt_foreach: + process_stmt_foreach(stm.as()); + break; + case node::stmt_switch: + process_stmt_switch(stm.as()); + break; + case node::stmt_endon: + case node::stmt_notify: + case node::stmt_wait: + case node::stmt_waittillmatch: + case node::stmt_waittillframeend: + case node::stmt_case: + case node::stmt_default: + case node::stmt_break: + case node::stmt_continue: + case node::stmt_return: + case node::stmt_breakpoint: + case node::stmt_prof_begin: + case node::stmt_prof_end: + break; + default: + throw comp_error(stm.loc(), "unknown statement"); + } +} + +auto compiler::process_stmt_list(stmt_list const& stm) -> void +{ + for (auto const& entry : stm.list) + { + process_stmt(*entry); + } +} + +auto compiler::process_stmt_comp(stmt_comp const& stm) -> void +{ + process_stmt_list(*stm.block); +} + +auto compiler::process_stmt_dev(stmt_dev const& stm) -> void +{ + process_stmt_list(*stm.block); +} + +auto compiler::process_stmt_expr(stmt_expr const& stm) -> void +{ + switch (stm.value->kind()) + { + case node::expr_increment: + process_expr(*stm.value->as().lvalue); + break; + case node::expr_decrement: + process_expr(*stm.value->as().lvalue); + break; + case node::expr_assign: + process_expr(*stm.value->as().lvalue); + break; + case node::expr_call: + case node::expr_method: + case node::expr_const: + case node::expr_empty: + break; + default: + throw comp_error(stm.loc(), "unknown expr statement expression"); + } +} + +auto compiler::process_stmt_waittill(stmt_waittill const& stm) -> void +{ + for (auto const& entry : stm.args->list) + { + if (!entry->is()) + { + throw comp_error(entry->loc(), "illegal waittill param, must be a local variable"); + } + + variable_register(entry->as()); + } +} + +auto compiler::process_stmt_if(stmt_if const& stm) -> void +{ + process_stmt(*stm.body); +} + +auto compiler::process_stmt_ifelse(stmt_ifelse const& stm) -> void +{ + process_stmt(*stm.stmt_if); + process_stmt(*stm.stmt_else); +} + +auto compiler::process_stmt_while(stmt_while const& stm) -> void +{ + process_stmt(*stm.body); +} + +auto compiler::process_stmt_dowhile(stmt_dowhile const& stm) -> void +{ + process_stmt(*stm.body); +} + +auto compiler::process_stmt_for(stmt_for const& stm) -> void +{ + process_stmt(*stm.init); + process_stmt(*stm.body); + process_stmt(*stm.iter); +} + +auto compiler::process_stmt_foreach(stmt_foreach const& stm) -> void +{ + if (stm.use_key) + { + process_expr(*stm.key); + process_expr(*stm.value); + } + else + { + process_expr(*stm.value); + process_expr(*stm.key); + } + + process_expr(*stm.array); + process_stmt(*stm.body); +} + +auto compiler::process_stmt_switch(stmt_switch const& stm) -> void +{ + for (auto i = 0u; i < stm.body->block->list.size(); i++) + { + auto& entry = stm.body->block->list[i]; + + if (entry->is()) + { + process_stmt_list(*entry->as().body); + } + else if (entry->is()) + { + process_stmt_list(*entry->as().body); + } + } +} + +auto compiler::process_expr(expr const& exp) -> void +{ + if (exp.is()) + { + variable_register(exp.as()); + } + else if (exp.is()) + { + process_expr(*exp.as().obj); + } +} + +auto compiler::process_expr_parameters(expr_parameters const& exp) -> void +{ + for (auto const& entry : exp.list) + { + if (entry->is()) + { + variable_register(entry->as()); + } + else if (entry->is()) + { + process_expr(*entry->as().lvalue); + } + } +} + +auto compiler::variable_register(expr_identifier const& exp) -> void +{ + auto found = false; + + for (auto i = 0u; i < stackframe_.size(); i++) + { + if (stackframe_[i] == exp.value) + { + found = true; + break; + } + } + + if (!found) stackframe_.push_back(exp.value); +} + +auto compiler::variable_access(expr_identifier const& exp) -> u8 +{ + for (auto i = 0u; i < stackframe_.size(); i++) + { + if (stackframe_[i] == exp.value) + { + return static_cast(stackframe_.size() - 1 - i); + } + } + + throw comp_error(exp.loc(), fmt::format("local variable '{}' not found", exp.value)); +} + +auto compiler::is_constant_condition(expr const& exp) -> bool +{ + switch (exp.kind()) + { + case node::expr_empty: + case node::expr_true: + return true; + case node::expr_false: + throw comp_error(exp.loc(), "condition can't be always false"); + case node::expr_integer: + { + auto num = std::stoi(exp.as().value); + if (num != 0) + return true; + else + throw comp_error(exp.loc(), "condition can't be always false"); + } + default: + break; + } + + return false; +} + +auto compiler::insert_label(std::string const& name) -> void +{ + auto const itr = function_->labels.find(index_); + + if (itr != function_->labels.end()) + { + for (auto& inst : function_->instructions) + { + switch (inst->opcode) + { + case opcode::OP_JumpOnFalse: + case opcode::OP_JumpOnTrue: + case opcode::OP_JumpOnFalseExpr: + case opcode::OP_JumpOnTrueExpr: + case opcode::OP_Jump: + case opcode::OP_JumpBack: + case opcode::OP_Switch: + case opcode::OP_DevblockBegin: + if (inst->data[0] == name) + inst->data[0] = itr->second; + break; + case opcode::OP_EndSwitch: + default: + break; + } + } + } + else + { + function_->labels.insert({ index_, name }); + } +} + +auto compiler::insert_label() -> std::string +{ + auto const itr = function_->labels.find(index_); + + if (itr != function_->labels.end()) + { + return itr->second; + } + else + { + label_idx_++; + auto name = fmt::format("loc_{}", label_idx_); + function_->labels.insert({ index_, name }); + return name; + } +} + +auto compiler::create_label() -> std::string +{ + label_idx_++; + return fmt::format("loc_{}", label_idx_); +} + +} // namespace xsk::arc diff --git a/src/arc/context.cpp b/src/arc/context.cpp index 967ac11b..ea1872ad 100644 --- a/src/arc/context.cpp +++ b/src/arc/context.cpp @@ -13,7 +13,7 @@ extern std::array, opcode_count> const opcod context::context(arc::props props, arc::engine engine, arc::endian endian, arc::system system, u64 magic) : props_{ props }, engine_{ engine }, endian_{ endian }, system_{ system }, instance_{ arc::instance::server }, magic_{ magic }, - source_{ this },/* assembler_{ this },*/ disassembler_{ this }/*, compiler_{ this }*/, decompiler_{ this } + source_{ this }, assembler_{ this }, disassembler_{ this }, compiler_{ this }, decompiler_{ this } { opcode_map_.reserve(opcode_list.size()); opcode_map_rev_.reserve(opcode_list.size()); @@ -137,9 +137,9 @@ auto context::opcode_size(opcode op) const -> u32 case opcode::OP_GetClasses: case opcode::OP_SuperEqual: case opcode::OP_SuperNotEqual: - return (props_ & props::version2) ? 2 : 1; + return (props_ & props::size64) ? 2 : 1; case opcode::OP_SafeSetVariableFieldCached: - return (props_ & props::version2) ? 3 : 1; + return (props_ & props::size64) ? 3 : 1; case opcode::OP_GetByte: case opcode::OP_GetNegByte: case opcode::OP_SafeCreateLocalVariables: @@ -154,7 +154,7 @@ auto context::opcode_size(opcode op) const -> u32 case opcode::OP_ScriptMethodThreadCallPointer: case opcode::OP_WaitTillMatch: case opcode::OP_VectorConstant: - return (props_ & props::version2) ? 3 : 2; + return (props_ & props::size64) ? 3 : 2; case opcode::OP_GetUnsignedShort: case opcode::OP_GetNegUnsignedShort: case opcode::OP_JumpOnFalse: @@ -165,13 +165,13 @@ auto context::opcode_size(opcode op) const -> u32 case opcode::OP_JumpBack: case opcode::OP_DevblockBegin: case opcode::OP_DevblockEnd: - return (props_ & props::version2) ? 4 : 3; + return (props_ & props::size64) ? 4 : 3; case opcode::OP_GetString: case opcode::OP_GetIString: case opcode::OP_EvalFieldVariable: case opcode::OP_EvalFieldVariableRef: case opcode::OP_ClearFieldVariable: - return (props_ & props::version2) ? 6 : 3; + return (props_ & props::size64) ? 6 : 3; case opcode::OP_EvalLocalVariableCachedDebug: case opcode::OP_EvalLocalVariableRefCachedDebug: case opcode::OP_LevelEvalFieldVariableRef: @@ -185,32 +185,32 @@ auto context::opcode_size(opcode op) const -> u32 case opcode::OP_Switch: case opcode::OP_EndSwitch: case opcode::OP_GetHash: - return (props_ & props::version2) ? 6 : 5; + return (props_ & props::size64) ? 6 : 5; case opcode::OP_ScriptFunctionCallClass: case opcode::OP_ScriptThreadCallClass: return 7; case opcode::OP_GetAPIFunction: return 10; case opcode::OP_ProfileStart: - return (props_ & props::version2) ? 10 : 1; + return (props_ & props::size64) ? 10 : 1; case opcode::OP_GetAnimation: case opcode::OP_GetFunction: - return (props_ & props::version2) ? 10 : 5; + return (props_ & props::size64) ? 10 : 5; case opcode::OP_CallBuiltin: case opcode::OP_CallBuiltinMethod: case opcode::OP_ScriptFunctionCall: case opcode::OP_ScriptMethodCall: case opcode::OP_ScriptThreadCall: case opcode::OP_ScriptMethodThreadCall: - return (props_ & props::version2) ? 11 : 6; + return (props_ & props::size64) ? 11 : 6; case opcode::OP_GetVector: - return (props_ & props::version2) ? 14 : 13; + return (props_ & props::size64) ? 14 : 13; default: throw error(fmt::format("couldn't resolve instruction size for '{}'", opcode_name(op))); } } -auto context::opcode_id(opcode op) const -> u8 +auto context::opcode_id(opcode op) const -> u16 { auto const itr = code_map_rev_.find(op); @@ -256,31 +256,36 @@ auto context::opcode_enum(u16 id) const -> opcode } return opcode::OP_Invalid; - //throw error(fmt::format("couldn't resolve opcode enum for '{:02X}'", id)); } -auto context::dvar_id(std::string const& /*name*/) const -> u32 +auto context::hash_id(std::string const& name) const -> u32 { - // todo hash func - return 0; -} - -auto context::dvar_name(u32 id) const -> std::string -{ - auto const itr = dvar_map_.find(id); - - if (itr != dvar_map_.end()) + if (props_ & props::hashids) { - return std::string(itr->second); + auto* str = name.data(); + auto hash = 16777619u * (std::tolower(static_cast(*str)) ^ 1268436527u); + + while (*str++) + { + hash = 16777619u * (std::tolower(static_cast(*str)) ^ hash); + } + + return hash; } + else + { + if (name.empty()) + return 0; - return fmt::format("_hash_{:08X}", id); -} + auto hash = 5381u; -auto context::hash_id(std::string const& /*name*/) const -> u32 -{ - // todo hash func - return 0; + for (auto i = 0u; i < name.size(); i++) + { + hash = std::tolower(static_cast(name[i])) + 33 * hash; + } + + return hash; + } } auto context::hash_name(u32 id) const -> std::string @@ -295,6 +300,48 @@ auto context::hash_name(u32 id) const -> std::string return fmt::format("_id_{:08X}", id); } +auto context::make_token(std::string_view str) const -> std::string +{ + if (str.starts_with("_id_") || str.starts_with("_func_") || str.starts_with("_meth_")) + { + return std::string{ str }; + } + + auto data = std::string{ str.begin(), str.end() }; + + for (auto i = 0u; i < data.size(); i++) + { + data[i] = static_cast(std::tolower(static_cast(str[i]))); + if (data[i] == '\\') data[i] = '/'; + } + + return data; +} + +auto context::load_header(std::string const& name) -> std::tuple +{ + auto const itr = header_files_.find(name); + + if (itr != header_files_.end()) + { + return { &itr->first, reinterpret_cast(itr->second.data()), itr->second.size() }; + } + + auto data = fs_callback_(name); + + if (!data.empty()) + { + auto const res = header_files_.insert({ name, std::move(data) }); + + if (res.second) + { + return { &res.first->first, reinterpret_cast(res.first->second.data()), res.first->second.size() }; + } + } + + throw error(fmt::format("couldn't open gsh file '{}'", name)); +} + extern std::array, opcode_count> const opcode_list {{ { opcode::OP_Invalid, "OP_Invalid" }, diff --git a/src/arc/decompiler.cpp b/src/arc/decompiler.cpp index 3cda6cb4..38e16f90 100644 --- a/src/arc/decompiler.cpp +++ b/src/arc/decompiler.cpp @@ -4,9 +4,9 @@ // that can be found in the LICENSE file. #include "xsk/stdinc.hpp" +#include "xsk/utils/string.hpp" #include "xsk/arc/decompiler.hpp" #include "xsk/arc/context.hpp" -#include "xsk/utils/string.hpp" namespace xsk::arc { @@ -17,11 +17,11 @@ decompiler::decompiler(context const* ctx) : ctx_{ ctx } auto decompiler::decompile(assembly const& data) -> program::ptr { - program_ = make_program(); + program_ = program::make(); for (auto it = data.includes.rbegin(); it != data.includes.rend(); it++) { - program_->includes.push_back(make_include(location{}, make_expr_path(location{}, *it))); + program_->includes.push_back(include::make(location{}, expr_path::make(location{}, *it))); } for (auto const& func : data.functions) @@ -37,6 +37,7 @@ auto decompiler::decompile_function(function const& func) -> void expr_labels_.clear(); tern_labels_.clear(); locals_.clear(); + params_.clear(); vars_.clear(); labels_ = func.labels; in_waittill_ = false; @@ -45,12 +46,12 @@ auto decompiler::decompile_function(function const& func) -> void stack_ = {}; auto loc = location{ nullptr, static_cast(func.index) }; - auto space = make_expr_identifier(loc, func.space); - auto name = make_expr_identifier(loc, func.name); - auto prms = make_expr_parameters(loc); - auto body = make_stmt_comp(loc, make_stmt_list(loc)); + auto space = expr_identifier::make(loc, func.space); + auto name = expr_identifier::make(loc, func.name); + auto prms = expr_parameters::make(loc); + auto body = stmt_comp::make(loc, stmt_list::make(loc)); auto flags = static_cast(func.flags); - func_ = make_decl_function(loc, std::move(space), std::move(name), std::move(prms), std::move(body), flags); + func_ = decl_function::make(loc, std::move(space), std::move(name), std::move(prms), std::move(body), flags); for (auto const& inst : func.instructions) { @@ -59,7 +60,23 @@ auto decompiler::decompile_function(function const& func) -> void for (auto i = 0u; i < func.params; i++) { - func_->params->list.push_back(expr{ make_expr_identifier(loc, locals_.at(locals_.size() - 1 - i)) }); + auto const& param = locals_.at(locals_.size() - 1 - i); + + if (ctx_->props() & props::refvarg) + { + auto const& type = params_.at(params_.size() - 1 - i); + + if (type == param_type::reference) + func_->params->list.push_back(expr_reference::make(loc, expr_path::make(loc), expr_identifier::make(loc, param))); + else if (type == param_type::vararg) + func_->params->list.push_back(expr_ellipsis::make(loc)); + else + func_->params->list.push_back(expr_identifier::make(loc, param)); + } + else + { + func_->params->list.push_back(expr_identifier::make(loc, param)); + } } if (!stack_.empty()) @@ -68,19 +85,19 @@ auto decompiler::decompile_function(function const& func) -> void } auto& list = func_->body->block->list; - locs_.end = fmt::format("loc_{:X}", list.back().loc().begin.line + 1); + locs_.end = fmt::format("loc_{:X}", list.back()->loc().begin.line + 1); decompile_statements(*func_->body->block); - if (!list.empty() && list.back() == node::stmt_return) + if (!list.empty() && list.back()->is()) { - if (list.back().as_return->value == node::null) + if (list.back()->as().value->is()) list.pop_back(); } process_function(*func_); - program_->declarations.push_back(decl{ std::move(func_) }); + program_->declarations.push_back(std::move(func_)); } auto decompiler::decompile_instruction(instruction const& inst, bool last) -> void @@ -94,31 +111,31 @@ auto decompiler::decompile_instruction(instruction const& inst, bool last) -> vo case opcode::OP_End: { retbool_ = !last ? false : retbool_; - func_->body->block->list.push_back(stmt{ make_stmt_return(loc, expr{ make_node(loc) }) }); + func_->body->block->list.push_back(stmt_return::make(loc, expr_empty::make(loc))); break; } case opcode::OP_Return: { - auto value = expr{ std::move(stack_.top()) }; stack_.pop(); - retbool_ = !value.as_node->is_boolean() ? false : retbool_; - func_->body->block->list.push_back(stmt{ make_stmt_return(value.loc(), std::move(value)) }); + auto value = node::as(std::move(stack_.top())); stack_.pop(); + retbool_ = !value->is_boolean() ? false : retbool_; + func_->body->block->list.push_back(stmt_return::make(value->loc(), std::move(value))); break; } case opcode::OP_GetZero: { - stack_.push(make_expr_integer(loc, "0")); + stack_.push(expr_integer::make(loc, "0")); break; } case opcode::OP_GetByte: case opcode::OP_GetUnsignedShort: { - stack_.push(make_expr_integer(loc, inst.data[0])); + stack_.push(expr_integer::make(loc, inst.data[0])); break; } case opcode::OP_GetNegByte: case opcode::OP_GetNegUnsignedShort: { - stack_.push(make_expr_integer(loc, "-" + inst.data[0])); + stack_.push(expr_integer::make(loc, "-" + inst.data[0])); break; } case opcode::OP_GetInteger: @@ -129,94 +146,94 @@ auto decompiler::decompile_instruction(instruction const& inst, bool last) -> vo for (auto i = program_->declarations.rbegin(); i != program_->declarations.rend(); i++) { - if (*i == node::decl_usingtree) + if ((*i)->is()) { - found = (i->as_usingtree->name->value == inst.data[0]); + found = (*i)->as().name->value == inst.data[0]; break; } } if (!found) { - auto dec = make_decl_usingtree(loc, make_expr_string(loc, inst.data[0])); - program_->declarations.push_back(decl{ std::move(dec) }); + auto dec = decl_usingtree::make(loc, expr_string::make(loc, inst.data[0])); + program_->declarations.push_back(std::move(dec)); } - stack_.push(make_expr_animtree(loc)); + stack_.push(expr_animtree::make(loc)); } else { - stack_.push(make_expr_integer(loc, inst.data[0])); + stack_.push(expr_integer::make(loc, inst.data[0])); } break; } case opcode::OP_GetFloat: { - stack_.push(make_expr_float(loc, inst.data[0])); + stack_.push(expr_float::make(loc, inst.data[0])); break; } case opcode::OP_GetVector: { - auto x = expr{ make_expr_float(loc, inst.data[0]) }; - auto y = expr{ make_expr_float(loc, inst.data[1]) }; - auto z = expr{ make_expr_float(loc, inst.data[2]) }; - stack_.push(make_expr_vector(loc, std::move(x), std::move(y), std::move(z))); + auto x = expr_float::make(loc, inst.data[0]); + auto y = expr_float::make(loc, inst.data[1]); + auto z = expr_float::make(loc, inst.data[2]); + stack_.push(expr_vector::make(loc, std::move(x), std::move(y), std::move(z))); break; } case opcode::OP_GetString: { - stack_.push(make_expr_string(loc, inst.data[0])); + stack_.push(expr_string::make(loc, inst.data[0])); break; } case opcode::OP_GetIString: { - stack_.push(make_expr_istring(loc, inst.data[0])); + stack_.push(expr_istring::make(loc, inst.data[0])); break; } case opcode::OP_GetUndefined: { - stack_.push(make_expr_undefined(loc)); + stack_.push(expr_undefined::make(loc)); break; } case opcode::OP_EmptyArray: { - stack_.push(make_expr_empty_array(loc)); + stack_.push(expr_empty_array::make(loc)); break; } case opcode::OP_GetClasses: case opcode::OP_GetClassesObject: { - stack_.push(make_expr_classes(loc)); + stack_.push(expr_classes::make(loc)); break; } case opcode::OP_GetWorld: case opcode::OP_GetWorldObject: { - stack_.push(make_expr_world(loc)); + stack_.push(expr_world::make(loc)); break; } case opcode::OP_GetLevel: case opcode::OP_GetLevelObject: { - stack_.push(make_expr_level(loc)); + stack_.push(expr_level::make(loc)); break; } case opcode::OP_GetAnim: case opcode::OP_GetAnimObject: { - stack_.push(make_expr_anim(loc)); + stack_.push(expr_anim::make(loc)); break; } case opcode::OP_GetSelf: case opcode::OP_GetSelfObject: { - stack_.push(make_expr_self(loc)); + stack_.push(expr_self::make(loc)); break; } case opcode::OP_GetGame: case opcode::OP_GetGameRef: { - stack_.push(make_expr_game(loc)); + stack_.push(expr_game::make(loc)); break; } case opcode::OP_GetAnimation: @@ -225,113 +242,124 @@ auto decompiler::decompile_instruction(instruction const& inst, bool last) -> vo for (auto i = program_->declarations.rbegin(); i != program_->declarations.rend(); i++) { - if (*i == node::decl_usingtree) + if ((*i)->is()) { - found = (i->as_usingtree->name->value == inst.data[0]); + found = (*i)->as().name->value == inst.data[0]; break; } } if (!found) { - auto dec = make_decl_usingtree(loc, make_expr_string(loc, inst.data[0])); - program_->declarations.push_back(decl{ std::move(dec) }); + auto dec = decl_usingtree::make(loc, expr_string::make(loc, inst.data[0])); + program_->declarations.push_back(std::move(dec)); } - stack_.push(make_expr_animation(loc, inst.data[1])); + stack_.push(expr_animation::make(loc, inst.data[1])); break; } case opcode::OP_GetFunction: { - auto path = make_expr_path(loc, inst.data[0]); - auto name = make_expr_identifier(loc, inst.data[1]); - stack_.push(make_expr_reference(loc, std::move(path), std::move(name))); + auto path = expr_path::make(loc, inst.data[0]); + auto name = expr_identifier::make(loc, inst.data[1]); + stack_.push(expr_reference::make(loc, std::move(path), std::move(name))); break; } case opcode::OP_SafeCreateLocalVariables: { - for (const auto& entry : inst.data) - locals_.insert(locals_.begin(), entry); + if (ctx_->props() & props::refvarg) + { + for (auto i = 0u; i < inst.data.size(); i += 2) + { + locals_.insert(locals_.begin(), inst.data[i]); + params_.insert(params_.begin(), static_cast(std::stoul(inst.data[i + 1]))); + } + } + else + { + for (const auto& entry : inst.data) + locals_.insert(locals_.begin(), entry); + } break; } case opcode::OP_EvalLocalVariableCached: { - stack_.push(make_expr_identifier(loc, locals_.at(std::stoi(inst.data[0])))); + stack_.push(expr_identifier::make(loc, locals_.at(std::stoi(inst.data[0])))); break; } case opcode::OP_EvalArray: { - auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); - auto key = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_expr_array(key.loc(), std::move(obj), std::move(key))); + auto obj = node::as(std::move(stack_.top())); stack_.pop(); + auto key = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_array::make(key->loc(), std::move(obj), std::move(key))); break; } case opcode::OP_EvalLocalArrayRefCached: { - auto key = expr{ std::move(stack_.top()) }; stack_.pop(); - auto obj = expr{ make_expr_identifier(loc, locals_.at(std::stoi(inst.data[0]))) }; - stack_.push(make_expr_array(key.loc(), std::move(obj), std::move(key))); + auto key = node::as(std::move(stack_.top())); stack_.pop(); + auto obj = expr_identifier::make(loc, locals_.at(std::stoi(inst.data[0]))); + stack_.push(expr_array::make(key->loc(), std::move(obj), std::move(key))); break; } case opcode::OP_EvalArrayRef: { - auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); - auto key = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_expr_array(key.loc(), std::move(obj), std::move(key))); + auto obj = node::as(std::move(stack_.top())); stack_.pop(); + auto key = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_array::make(key->loc(), std::move(obj), std::move(key))); break; } case opcode::OP_ClearArray: { - auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); - auto key = expr{ std::move(stack_.top()) }; stack_.pop(); - loc = key.loc(); - auto lvalue = expr{ make_expr_array(loc, std::move(obj), std::move(key)) }; - auto rvalue = expr{ make_expr_undefined(loc) }; - auto exp = expr{ make_expr_assign_equal(loc, std::move(lvalue), std::move(rvalue)) }; - func_->body->block->list.push_back(stmt{ make_stmt_assign(loc, std::move(exp)) }); + auto obj = node::as(std::move(stack_.top())); stack_.pop(); + auto key = node::as(std::move(stack_.top())); stack_.pop(); + loc = key->loc(); + auto lvalue = expr_array::make(loc, std::move(obj), std::move(key)); + auto rvalue = expr_undefined::make(loc); + auto exp = expr_assign::make(loc, std::move(lvalue), std::move(rvalue), expr_assign::op::eq); + func_->body->block->list.push_back(stmt_expr::make(loc, std::move(exp))); break; } case opcode::OP_EvalFieldVariable: { - auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); - auto field = make_expr_identifier(loc, inst.data[0]); - stack_.push(make_expr_field(obj.loc(), std::move(obj), std::move(field))); + auto obj = node::as(std::move(stack_.top())); stack_.pop(); + auto field = expr_identifier::make(loc, inst.data[0]); + stack_.push(expr_field::make(obj->loc(), std::move(obj), std::move(field))); break; } case opcode::OP_EvalFieldVariableRef: { - auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); - auto field = make_expr_identifier(loc, inst.data[0]); - stack_.push(make_expr_field(obj.loc(), std::move(obj), std::move(field))); + auto obj = node::as(std::move(stack_.top())); stack_.pop(); + auto field = expr_identifier::make(loc, inst.data[0]); + stack_.push(expr_field::make(obj->loc(), std::move(obj), std::move(field))); break; } case opcode::OP_ClearFieldVariable: { - auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); - loc = obj.loc(); - auto name = make_expr_identifier(loc, inst.data[0]); - auto field = expr{ make_expr_field(loc, std::move(obj), std::move(name)) }; - auto undef = expr{ make_expr_undefined(loc) }; - auto exp = expr{ make_expr_assign_equal(loc, std::move(field), std::move(undef)) }; - func_->body->block->list.push_back(stmt{ make_stmt_assign(loc, std::move(exp)) }); + auto obj = node::as(std::move(stack_.top())); stack_.pop(); + loc = obj->loc(); + auto name = expr_identifier::make(loc, inst.data[0]); + auto field = expr_field::make(loc, std::move(obj), std::move(name)); + auto undef = expr_undefined::make(loc); + auto exp = expr_assign::make(loc, std::move(field), std::move(undef), expr_assign::op::eq); + func_->body->block->list.push_back(stmt_expr::make(loc, std::move(exp))); break; } case opcode::OP_SafeSetWaittillVariableFieldCached: { - stack_.push(make_expr_identifier(loc, locals_.at(std::stoi(inst.data[0])))); + stack_.push(expr_identifier::make(loc, locals_.at(std::stoi(inst.data[0])))); break; } case opcode::OP_ClearParams: { if (in_waittill_) { - auto args = make_expr_arguments(loc); + auto args = expr_arguments::make(loc); auto arg = std::move(stack_.top()); stack_.pop(); while (arg->kind() != node::stmt_waittill) { - args->list.push_back(std::move(arg)); + args->list.push_back(node::as(std::move(arg))); arg = std::move(stack_.top()); stack_.pop(); } @@ -342,727 +370,727 @@ auto decompiler::decompile_instruction(instruction const& inst, bool last) -> vo in_waittill_ = false; } - func_->body->block->list.push_back(stmt{ std::move(arg) }); + func_->body->block->list.push_back(node::as(std::move(arg))); } break; } case opcode::OP_EvalLocalVariableRefCached: { - stack_.push(make_expr_identifier(loc, locals_.at(std::stoi(inst.data[0])))); + stack_.push(expr_identifier::make(loc, locals_.at(std::stoi(inst.data[0])))); break; } case opcode::OP_SetVariableField: { - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - loc = rvalue.loc(); - auto exp = expr{ make_expr_assign_equal(loc, std::move(lvalue), std::move(rvalue)) }; - func_->body->block->list.push_back(stmt{ make_stmt_assign(loc, std::move(exp)) }); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + auto rvalue = node::as(std::move(stack_.top())); stack_.pop(); + loc = rvalue->loc(); + auto exp = expr_assign::make(loc, std::move(lvalue), std::move(rvalue), expr_assign::op::eq); + func_->body->block->list.push_back(stmt_expr::make(loc, std::move(exp))); break; } case opcode::OP_CallBuiltin: { - auto args = make_expr_arguments(loc); - auto path = make_expr_path(loc, inst.data[0]); - auto name = make_expr_identifier(loc, inst.data[1]); + auto args = expr_arguments::make(loc); + auto path = expr_path::make(loc, inst.data[0]); + auto name = expr_identifier::make(loc, inst.data[1]); auto var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); - while (var->kind() != node::asm_prescriptcall) + while (var->kind() != node::node_prescriptcall) { - args->list.push_back(std::move(var)); + args->list.push_back(node::as(std::move(var))); var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); } - stack_.push(make_expr_call(loc, call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::normal) })); + stack_.push(expr_call::make(loc, expr_function::make(loc, std::move(path), std::move(name), std::move(args), call::mode::normal))); break; } case opcode::OP_CallBuiltinMethod: { - auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); - loc = obj.loc(); - auto args = make_expr_arguments(loc); - auto path = make_expr_path(loc, inst.data[0]); - auto name = make_expr_identifier(loc, inst.data[1]); + auto obj = node::as(std::move(stack_.top())); stack_.pop(); + loc = obj->loc(); + auto args = expr_arguments::make(loc); + auto path = expr_path::make(loc, inst.data[0]); + auto name = expr_identifier::make(loc, inst.data[1]); auto var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); - while (var->kind() != node::asm_prescriptcall) + while (var->kind() != node::node_prescriptcall) { - args->list.push_back(std::move(var)); + args->list.push_back(node::as(std::move(var))); var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); } - stack_.push(make_expr_method(loc, std::move(obj), call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::normal) })); + stack_.push(expr_method::make(loc, std::move(obj), expr_function::make(loc, std::move(path), std::move(name), std::move(args), call::mode::normal))); break; } case opcode::OP_Wait: { - auto exp = expr{ std::move(stack_.top()) }; stack_.pop(); - func_->body->block->list.push_back(stmt{ make_stmt_wait(exp.loc(), std::move(exp)) }); + auto exp = node::as(std::move(stack_.top())); stack_.pop(); + func_->body->block->list.push_back(stmt_wait::make(exp->loc(), std::move(exp))); break; } case opcode::OP_WaitTillFrameEnd: { - func_->body->block->list.push_back(stmt{ make_stmt_waittillframeend(loc) }); + func_->body->block->list.push_back(stmt_waittillframeend::make(loc)); break; } case opcode::OP_PreScriptCall: { - stack_.push(make_asm_prescriptcall(loc)); + stack_.push(node_prescriptcall::make(loc)); break; } case opcode::OP_ScriptFunctionCall: { - auto args = make_expr_arguments(loc); - auto path = make_expr_path(loc, inst.data[0]); - auto name = make_expr_identifier(loc, inst.data[1]); + auto args = expr_arguments::make(loc); + auto path = expr_path::make(loc, inst.data[0]); + auto name = expr_identifier::make(loc, inst.data[1]); auto var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); - while (var->kind() != node::asm_prescriptcall) + while (var->kind() != node::node_prescriptcall) { - args->list.push_back(std::move(var)); + args->list.push_back(node::as(std::move(var))); var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); } - stack_.push(make_expr_call(loc, call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::normal) })); + stack_.push(expr_call::make(loc, expr_function::make(loc, std::move(path), std::move(name), std::move(args), call::mode::normal))); break; } case opcode::OP_ScriptFunctionCallPointer: { - auto args = make_expr_arguments(loc); - auto func = expr{ std::move(stack_.top()) }; stack_.pop(); + auto args = expr_arguments::make(loc); + auto func = node::as(std::move(stack_.top())); stack_.pop(); auto var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); - while (var->kind() != node::asm_prescriptcall) + while (var->kind() != node::node_prescriptcall) { - args->list.push_back(std::move(var)); + args->list.push_back(node::as(std::move(var))); var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); } - stack_.push(make_expr_call(loc, call{ make_expr_pointer(loc, std::move(func), std::move(args), call::mode::normal) })); + stack_.push(expr_call::make(loc, expr_pointer::make(loc, std::move(func), std::move(args), call::mode::normal))); break; } case opcode::OP_ScriptMethodCall: { - auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); - loc = obj.loc(); + auto obj = node::as(std::move(stack_.top())); stack_.pop(); + loc = obj->loc(); - auto args = make_expr_arguments(loc); - auto path = make_expr_path(loc, inst.data[0]); - auto name = make_expr_identifier(loc, inst.data[1]); + auto args = expr_arguments::make(loc); + auto path = expr_path::make(loc, inst.data[0]); + auto name = expr_identifier::make(loc, inst.data[1]); auto var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); - while (var->kind() != node::asm_prescriptcall) + while (var->kind() != node::node_prescriptcall) { - args->list.push_back(std::move(var)); + args->list.push_back(node::as(std::move(var))); var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); } - stack_.push(make_expr_method(loc, std::move(obj), call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::normal) })); + stack_.push(expr_method::make(loc, std::move(obj), expr_function::make(loc, std::move(path), std::move(name), std::move(args), call::mode::normal))); break; } case opcode::OP_ScriptMethodCallPointer: { - auto args = make_expr_arguments(loc); - auto func = expr{ std::move(stack_.top()) }; stack_.pop(); - auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + auto args = expr_arguments::make(loc); + auto func = node::as(std::move(stack_.top())); stack_.pop(); + auto obj = node::as(std::move(stack_.top())); stack_.pop(); auto var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); - while (var->kind() != node::asm_prescriptcall) + while (var->kind() != node::node_prescriptcall) { - args->list.push_back(std::move(var)); + args->list.push_back(node::as(std::move(var))); var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); } - stack_.push(make_expr_method(loc, std::move(obj), call{ make_expr_pointer(loc, std::move(func), std::move(args), call::mode::normal) })); + stack_.push(expr_method::make(loc, std::move(obj), expr_pointer::make(loc, std::move(func), std::move(args), call::mode::normal))); break; } case opcode::OP_ScriptThreadCall: { - auto args = make_expr_arguments(loc); - auto path = make_expr_path(loc, inst.data[0]); - auto name = make_expr_identifier(loc, inst.data[1]); + auto args = expr_arguments::make(loc); + auto path = expr_path::make(loc, inst.data[0]); + auto name = expr_identifier::make(loc, inst.data[1]); auto var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); - while (var->kind() != node::asm_prescriptcall) + while (var->kind() != node::node_prescriptcall) { - args->list.push_back(std::move(var)); + args->list.push_back(node::as(std::move(var))); var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); } - stack_.push(make_expr_call(loc, call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::thread) })); + stack_.push(expr_call::make(loc, expr_function::make(loc, std::move(path), std::move(name), std::move(args), call::mode::thread))); break; } case opcode::OP_ScriptThreadCallPointer: { - auto args = make_expr_arguments(loc); - auto func = expr{ std::move(stack_.top()) }; stack_.pop(); - loc = func.loc(); + auto args = expr_arguments::make(loc); + auto func = node::as(std::move(stack_.top())); stack_.pop(); + loc = func->loc(); auto var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); - while (var->kind() != node::asm_prescriptcall) + while (var->kind() != node::node_prescriptcall) { - args->list.push_back(std::move(var)); + args->list.push_back(node::as(std::move(var))); var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); } - stack_.push(make_expr_call(loc, call{ make_expr_pointer(loc, std::move(func), std::move(args), call::mode::thread) })); + stack_.push(expr_call::make(loc, expr_pointer::make(loc, std::move(func), std::move(args), call::mode::thread))); break; } case opcode::OP_ScriptMethodThreadCall: { - auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); - loc = obj.loc(); + auto obj = node::as(std::move(stack_.top())); stack_.pop(); + loc = obj->loc(); - auto args = make_expr_arguments(loc); - auto path = make_expr_path(loc, inst.data[0]); - auto name = make_expr_identifier(loc, inst.data[1]); + auto args = expr_arguments::make(loc); + auto path = expr_path::make(loc, inst.data[0]); + auto name = expr_identifier::make(loc, inst.data[1]); auto var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); - while (var->kind() != node::asm_prescriptcall) + while (var->kind() != node::node_prescriptcall) { - args->list.push_back(std::move(var)); + args->list.push_back(node::as(std::move(var))); var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); } - stack_.push(make_expr_method(loc, std::move(obj), call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::thread) })); + stack_.push(expr_method::make(loc, std::move(obj), expr_function::make(loc, std::move(path), std::move(name), std::move(args), call::mode::thread))); break; } case opcode::OP_ScriptMethodThreadCallPointer: { - auto args = make_expr_arguments(loc); - auto func = expr{ std::move(stack_.top()) }; stack_.pop(); - auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); - loc = obj.loc(); + auto args = expr_arguments::make(loc); + auto func = node::as(std::move(stack_.top())); stack_.pop(); + auto obj = node::as(std::move(stack_.top())); stack_.pop(); + loc = obj->loc(); auto var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); - while (var->kind() != node::asm_prescriptcall) + while (var->kind() != node::node_prescriptcall) { - args->list.push_back(std::move(var)); + args->list.push_back(node::as(std::move(var))); var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); } - stack_.push(make_expr_method(loc, std::move(obj), call{ make_expr_pointer(loc, std::move(func), std::move(args), call::mode::thread) })); + stack_.push(expr_method::make(loc, std::move(obj), expr_pointer::make(loc, std::move(func), std::move(args), call::mode::thread))); break; } case opcode::OP_DecTop: { if (stack_.top()->kind() != node::expr_new) { - auto exp = expr{ std::move(stack_.top()) }; stack_.pop(); - func_->body->block->list.push_back(stmt{ make_stmt_call(exp.loc(), std::move(exp)) }); + auto exp = node::as(std::move(stack_.top())); stack_.pop(); + func_->body->block->list.push_back(stmt_expr::make(exp->loc(), std::move(exp))); } break; } case opcode::OP_BoolNot: { - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_expr_not(lvalue.loc(), std::move(lvalue))); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_not::make(lvalue->loc(), std::move(lvalue))); break; } case opcode::OP_BoolComplement: { - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_expr_complement(lvalue.loc(), std::move(lvalue))); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_complement::make(lvalue->loc(), std::move(lvalue))); break; } case opcode::OP_JumpOnTrue: { - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - loc = lvalue.loc(); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + loc = lvalue->loc(); if (inst.index > resolve_label(inst.data[0])) { - func_->body->block->list.push_back(stmt{ make_asm_jmp_cond(loc, std::move(lvalue), inst.data[0]) }); + func_->body->block->list.push_back(stmt_jmp_cond::make(loc, std::move(lvalue), inst.data[0])); } else { - auto test = expr{ make_expr_not(loc, std::move(lvalue)) }; - func_->body->block->list.push_back(stmt{ make_asm_jmp_cond(loc, std::move(test), inst.data[0]) }); + auto test = expr_not::make(loc, std::move(lvalue)); + func_->body->block->list.push_back(stmt_jmp_cond::make(loc, std::move(test), inst.data[0])); } break; } case opcode::OP_JumpOnFalse: { - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - loc = lvalue.loc(); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + loc = lvalue->loc(); if (inst.index > resolve_label(inst.data[0])) { - auto test = expr{ make_expr_not(loc, std::move(lvalue)) }; - func_->body->block->list.push_back(stmt{ make_asm_jmp_cond(loc, std::move(test), inst.data[0]) }); + auto test = expr_not::make(loc, std::move(lvalue)); + func_->body->block->list.push_back(stmt_jmp_cond::make(loc, std::move(test), inst.data[0])); } else { - func_->body->block->list.push_back(stmt{ make_asm_jmp_cond(lvalue.loc(), std::move(lvalue), inst.data[0]) }); + func_->body->block->list.push_back(stmt_jmp_cond::make(lvalue->loc(), std::move(lvalue), inst.data[0])); } break; } case opcode::OP_JumpOnTrueExpr: { - auto test = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_asm_jmp_true(test.loc(), std::move(test), inst.data[0])); + auto test = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(stmt_jmp_true::make(test->loc(), std::move(test), inst.data[0])); expr_labels_.push_back(inst.data[0]); break; } case opcode::OP_JumpOnFalseExpr: { - auto test = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_asm_jmp_false(test.loc(), std::move(test), inst.data[0])); + auto test = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(stmt_jmp_false::make(test->loc(), std::move(test), inst.data[0])); expr_labels_.push_back(inst.data[0]); break; } case opcode::OP_Jump: { - func_->body->block->list.push_back(stmt{ make_asm_jmp(loc, inst.data[0]) }); + func_->body->block->list.push_back(stmt_jmp::make(loc, inst.data[0])); if (stack_.size() != 0) tern_labels_.push_back(inst.data[0]); break; } case opcode::OP_JumpBack: { - func_->body->block->list.push_back(stmt{ make_asm_jmp_back(loc, inst.data[0]) }); + func_->body->block->list.push_back(stmt_jmp_back::make(loc, inst.data[0])); break; } case opcode::OP_Inc: { - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - loc = lvalue.loc(); - auto exp = expr{ make_expr_increment(lvalue.loc(), std::move(lvalue), false) }; - func_->body->block->list.push_back(stmt{ make_stmt_assign(loc, std::move(exp)) }); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + loc = lvalue->loc(); + auto exp = expr_increment::make(lvalue->loc(), std::move(lvalue), false); + func_->body->block->list.push_back(stmt_expr::make(loc, std::move(exp))); break; } case opcode::OP_Dec: { - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - loc = lvalue.loc(); - auto exp = expr{ make_expr_decrement(loc, std::move(lvalue), false) }; - func_->body->block->list.push_back(stmt{ make_stmt_assign(loc, std::move(exp)) }); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + loc = lvalue->loc(); + auto exp = expr_decrement::make(loc, std::move(lvalue), false); + func_->body->block->list.push_back(stmt_expr::make(loc, std::move(exp))); break; } case opcode::OP_Bit_Or: { - auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_expr_bitwise_or(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + auto rvalue = node::as(std::move(stack_.top())); stack_.pop(); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_binary::make(lvalue->loc(), std::move(lvalue), std::move(rvalue), expr_binary::op::bwor)); break; } case opcode::OP_Bit_Xor: { - auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_expr_bitwise_exor(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + auto rvalue = node::as(std::move(stack_.top())); stack_.pop(); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_binary::make(lvalue->loc(), std::move(lvalue), std::move(rvalue), expr_binary::op::bwexor)); break; } case opcode::OP_Bit_And: { - auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_expr_bitwise_and(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + auto rvalue = node::as(std::move(stack_.top())); stack_.pop(); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_binary::make(lvalue->loc(), std::move(lvalue), std::move(rvalue), expr_binary::op::bwand)); break; } case opcode::OP_SuperEqual: { - auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_expr_super_equal(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + auto rvalue = node::as(std::move(stack_.top())); stack_.pop(); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_binary::make(lvalue->loc(), std::move(lvalue), std::move(rvalue), expr_binary::op::seq)); break; } case opcode::OP_SuperNotEqual: { - auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_expr_super_not_equal(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + auto rvalue = node::as(std::move(stack_.top())); stack_.pop(); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_binary::make(lvalue->loc(), std::move(lvalue), std::move(rvalue), expr_binary::op::sne)); break; } case opcode::OP_Equal: { - auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_expr_equality(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + auto rvalue = node::as(std::move(stack_.top())); stack_.pop(); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_binary::make(lvalue->loc(), std::move(lvalue), std::move(rvalue), expr_binary::op::eq)); break; } case opcode::OP_NotEqual: { - auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_expr_inequality(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + auto rvalue = node::as(std::move(stack_.top())); stack_.pop(); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_binary::make(lvalue->loc(), std::move(lvalue), std::move(rvalue), expr_binary::op::ne)); break; } case opcode::OP_LessThan: { - auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_expr_less(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + auto rvalue = node::as(std::move(stack_.top())); stack_.pop(); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_binary::make(lvalue->loc(), std::move(lvalue), std::move(rvalue), expr_binary::op::lt)); break; } case opcode::OP_GreaterThan: { - auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_expr_greater(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + auto rvalue = node::as(std::move(stack_.top())); stack_.pop(); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_binary::make(lvalue->loc(), std::move(lvalue), std::move(rvalue), expr_binary::op::gt)); break; } case opcode::OP_LessThanOrEqualTo: { - auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_expr_less_equal(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + auto rvalue = node::as(std::move(stack_.top())); stack_.pop(); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_binary::make(lvalue->loc(), std::move(lvalue), std::move(rvalue), expr_binary::op::le)); break; } case opcode::OP_GreaterThanOrEqualTo: { - auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_expr_greater_equal(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + auto rvalue = node::as(std::move(stack_.top())); stack_.pop(); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_binary::make(lvalue->loc(), std::move(lvalue), std::move(rvalue), expr_binary::op::ge)); break; } case opcode::OP_ShiftLeft: { - auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_expr_shift_left(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + auto rvalue = node::as(std::move(stack_.top())); stack_.pop(); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_binary::make(lvalue->loc(), std::move(lvalue), std::move(rvalue), expr_binary::op::shl)); break; } case opcode::OP_ShiftRight: { - auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_expr_shift_right(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + auto rvalue = node::as(std::move(stack_.top())); stack_.pop(); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_binary::make(lvalue->loc(), std::move(lvalue), std::move(rvalue), expr_binary::op::shr)); break; } case opcode::OP_Plus: { - auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_expr_add(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + auto rvalue = node::as(std::move(stack_.top())); stack_.pop(); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_binary::make(lvalue->loc(), std::move(lvalue), std::move(rvalue), expr_binary::op::add)); break; } case opcode::OP_Minus: { - auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_expr_sub(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + auto rvalue = node::as(std::move(stack_.top())); stack_.pop(); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_binary::make(lvalue->loc(), std::move(lvalue), std::move(rvalue), expr_binary::op::sub)); break; } case opcode::OP_Multiply: { - auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_expr_mul(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + auto rvalue = node::as(std::move(stack_.top())); stack_.pop(); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_binary::make(lvalue->loc(), std::move(lvalue), std::move(rvalue), expr_binary::op::mul)); break; } case opcode::OP_Divide: { - auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_expr_div(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + auto rvalue = node::as(std::move(stack_.top())); stack_.pop(); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_binary::make(lvalue->loc(), std::move(lvalue), std::move(rvalue), expr_binary::op::div)); break; } case opcode::OP_Modulus: { - auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_expr_mod(lvalue.loc(), std::move(lvalue), std::move(rvalue))); + auto rvalue = node::as(std::move(stack_.top())); stack_.pop(); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_binary::make(lvalue->loc(), std::move(lvalue), std::move(rvalue), expr_binary::op::mod)); break; } case opcode::OP_SizeOf: { - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_expr_size(lvalue.loc(), std::move(lvalue))); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_size::make(lvalue->loc(), std::move(lvalue))); break; } case opcode::OP_WaitTillMatch: { - auto args = make_expr_arguments(loc); - auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); - auto event = expr{ std::move(stack_.top()) }; stack_.pop(); - loc = event.loc(); + auto args = expr_arguments::make(loc); + auto obj = node::as(std::move(stack_.top())); stack_.pop(); + auto event = node::as(std::move(stack_.top())); stack_.pop(); + loc = event->loc(); for (auto i = std::stoul(inst.data[0]); i > 0; i--) { - auto arg = std::move(stack_.top()); stack_.pop(); + auto arg = node::as(std::move(stack_.top())); stack_.pop(); loc = arg->loc(); args->list.push_back(std::move(arg)); } - func_->body->block->list.push_back(stmt{ make_stmt_waittillmatch(loc, std::move(obj), std::move(event), std::move(args)) }); + func_->body->block->list.push_back(stmt_waittillmatch::make(loc, std::move(obj), std::move(event), std::move(args))); break; } case opcode::OP_WaitTill: { - auto args = make_expr_arguments(loc); - auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); - auto event = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_stmt_waittill(event.loc(), std::move(obj), std::move(event), std::move(args))); + auto args = expr_arguments::make(loc); + auto obj = node::as(std::move(stack_.top())); stack_.pop(); + auto event = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(stmt_waittill::make(event->loc(), std::move(obj), std::move(event), std::move(args))); in_waittill_ = true; break; } case opcode::OP_Notify: { - auto args = make_expr_arguments(loc); - auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); - auto event = expr{ std::move(stack_.top()) }; stack_.pop(); + auto args = expr_arguments::make(loc); + auto obj = node::as(std::move(stack_.top())); stack_.pop(); + auto event = node::as(std::move(stack_.top())); stack_.pop(); auto var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); - while (var->kind() != ((ctx_->props() & props::version2) ? node::asm_prescriptcall : node::asm_voidcodepos)) + while (var->kind() != ((ctx_->props() & props::size64) ? node::node_prescriptcall : node::node_voidcodepos)) { - args->list.push_back(std::move(var)); + args->list.push_back(node::as(std::move(var))); var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); } - func_->body->block->list.push_back(stmt{ make_stmt_notify(loc, std::move(obj), std::move(event), std::move(args)) }); + func_->body->block->list.push_back(stmt_notify::make(loc, std::move(obj), std::move(event), std::move(args))); break; } case opcode::OP_EndOn: { - auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); - auto event = expr{ std::move(stack_.top()) }; stack_.pop(); - func_->body->block->list.push_back(stmt{ make_stmt_endon(event.loc(), std::move(obj), std::move(event)) }); + auto obj = node::as(std::move(stack_.top())); stack_.pop(); + auto event = node::as(std::move(stack_.top())); stack_.pop(); + func_->body->block->list.push_back(stmt_endon::make(event->loc(), std::move(obj), std::move(event))); break; } case opcode::OP_VoidCodePos: { - stack_.push(make_asm_voidcodepos(loc)); + stack_.push(node_voidcodepos::make(loc)); break; } case opcode::OP_Switch: { - auto test = expr{ std::move(stack_.top()) }; stack_.pop(); - func_->body->block->list.push_back(stmt{ make_asm_switch(test.loc(), std::move(test), inst.data[0]) }); + auto test = node::as(std::move(stack_.top())); stack_.pop(); + func_->body->block->list.push_back(stmt_jmp_switch::make(test->loc(), std::move(test), inst.data[0])); break; } case opcode::OP_EndSwitch: { - func_->body->block->list.push_back(stmt{ make_asm_endswitch(loc, inst.data) }); + func_->body->block->list.push_back(stmt_jmp_endswitch::make(loc, inst.data)); break; } case opcode::OP_Vector: { - auto x = expr{ std::move(stack_.top()) }; stack_.pop(); - auto y = expr{ std::move(stack_.top()) }; stack_.pop(); - auto z = expr{ std::move(stack_.top()) }; stack_.pop(); - stack_.push(make_expr_vector(z.loc(), std::move(x), std::move(y), std::move(z))); + auto x = node::as(std::move(stack_.top())); stack_.pop(); + auto y = node::as(std::move(stack_.top())); stack_.pop(); + auto z = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_vector::make(z->loc(), std::move(x), std::move(y), std::move(z))); break; } case opcode::OP_GetHash: { - stack_.push(make_expr_hash(loc, inst.data[0])); + stack_.push(expr_hash::make(loc, inst.data[0])); break; } case opcode::OP_RealWait: { - auto exp = expr{ std::move(stack_.top()) }; stack_.pop(); - func_->body->block->list.push_back(stmt{ make_stmt_realwait(exp.loc(), std::move(exp)) }); + auto exp = node::as(std::move(stack_.top())); stack_.pop(); + func_->body->block->list.push_back(stmt_waitrealtime::make(exp->loc(), std::move(exp))); break; } case opcode::OP_VectorConstant: { auto flags = static_cast(std::stoi(inst.data[0])); - auto x = expr{ make_expr_float(loc, (flags & 0x20) ? "1" : (flags & 0x10) ? "-1" : "0") }; - auto y = expr{ make_expr_float(loc, (flags & 0x08) ? "1" : (flags & 0x04) ? "-1" : "0") }; - auto z = expr{ make_expr_float(loc, (flags & 0x02) ? "1" : (flags & 0x01) ? "-1" : "0") }; - stack_.push(make_expr_vector(loc, std::move(x), std::move(y), std::move(z))); + auto x = expr_float::make(loc, (flags & 0x20) ? "1" : (flags & 0x10) ? "-1" : "0"); + auto y = expr_float::make(loc, (flags & 0x08) ? "1" : (flags & 0x04) ? "-1" : "0"); + auto z = expr_float::make(loc, (flags & 0x02) ? "1" : (flags & 0x01) ? "-1" : "0"); + stack_.push(expr_vector::make(loc, std::move(x), std::move(y), std::move(z))); break; } case opcode::OP_IsDefined: { - auto arg = std::move(stack_.top()); stack_.pop(); - stack_.push(make_expr_isdefined(arg->loc(), std::move(arg))); + auto arg = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_isdefined::make(arg->loc(), std::move(arg))); break; } case opcode::OP_VectorScale: { - auto arg1 = std::move(stack_.top()); stack_.pop(); - auto arg2 = std::move(stack_.top()); stack_.pop(); - stack_.push(make_expr_vectorscale(arg2->loc(), std::move(arg1), std::move(arg2))); + auto arg1 = node::as(std::move(stack_.top())); stack_.pop(); + auto arg2 = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_vectorscale::make(arg2->loc(), std::move(arg1), std::move(arg2))); break; } case opcode::OP_AnglesToUp: { - auto arg = std::move(stack_.top()); stack_.pop(); - stack_.push(make_expr_anglestoup(arg->loc(), std::move(arg))); + auto arg = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_anglestoup::make(arg->loc(), std::move(arg))); break; } case opcode::OP_AnglesToRight: { - auto arg = std::move(stack_.top()); stack_.pop(); - stack_.push(make_expr_anglestoright(arg->loc(), std::move(arg))); + auto arg = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_anglestoright::make(arg->loc(), std::move(arg))); break; } case opcode::OP_AnglesToForward: { - auto arg = std::move(stack_.top()); stack_.pop(); - stack_.push(make_expr_anglestoforward(arg->loc(), std::move(arg))); + auto arg = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_anglestoforward::make(arg->loc(), std::move(arg))); break; } case opcode::OP_AngleClamp180: { - auto arg = std::move(stack_.top()); stack_.pop(); - stack_.push(make_expr_angleclamp180(arg->loc(), std::move(arg))); + auto arg = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_angleclamp180::make(arg->loc(), std::move(arg))); break; } case opcode::OP_VectorToAngles: { - auto arg = std::move(stack_.top()); stack_.pop(); - stack_.push(make_expr_vectortoangles(arg->loc(), std::move(arg))); + auto arg = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_vectortoangles::make(arg->loc(), std::move(arg))); break; } case opcode::OP_Abs: { - auto arg = std::move(stack_.top()); stack_.pop(); - stack_.push(make_expr_abs(arg->loc(), std::move(arg))); + auto arg = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_abs::make(arg->loc(), std::move(arg))); break; } case opcode::OP_GetTime: { - stack_.push(make_expr_gettime(loc)); + stack_.push(expr_gettime::make(loc)); break; } case opcode::OP_GetDvar: { - auto arg = std::move(stack_.top()); stack_.pop(); - stack_.push(make_expr_getdvar(arg->loc(), std::move(arg))); + auto arg = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_getdvar::make(arg->loc(), std::move(arg))); break; } case opcode::OP_GetDvarInt: { - auto arg = std::move(stack_.top()); stack_.pop(); - stack_.push(make_expr_getdvarint(arg->loc(), std::move(arg))); + auto arg = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_getdvarint::make(arg->loc(), std::move(arg))); break; } case opcode::OP_GetDvarFloat: { - auto arg = std::move(stack_.top()); stack_.pop(); - stack_.push(make_expr_getdvarfloat(arg->loc(), std::move(arg))); + auto arg = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_getdvarfloat::make(arg->loc(), std::move(arg))); break; } case opcode::OP_GetDvarVector: { - auto arg = std::move(stack_.top()); stack_.pop(); - stack_.push(make_expr_getdvarvector(arg->loc(), std::move(arg))); + auto arg = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_getdvarvector::make(arg->loc(), std::move(arg))); break; } case opcode::OP_GetDvarColorRed: { - auto arg = std::move(stack_.top()); stack_.pop(); - stack_.push(make_expr_getdvarcolorred(arg->loc(), std::move(arg))); + auto arg = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_getdvarcolorred::make(arg->loc(), std::move(arg))); break; } case opcode::OP_GetDvarColorGreen: { - auto arg = std::move(stack_.top()); stack_.pop(); - stack_.push(make_expr_getdvarcolorgreen(arg->loc(), std::move(arg))); + auto arg = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_getdvarcolorgreen::make(arg->loc(), std::move(arg))); break; } case opcode::OP_GetDvarColorBlue: { - auto arg = std::move(stack_.top()); stack_.pop(); - stack_.push(make_expr_getdvarcolorblue(arg->loc(), std::move(arg))); + auto arg = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_getdvarcolorblue::make(arg->loc(), std::move(arg))); break; } case opcode::OP_GetDvarColorAlpha: { - auto arg = std::move(stack_.top()); stack_.pop(); - stack_.push(make_expr_getdvarcoloralpha(arg->loc(), std::move(arg))); + auto arg = node::as(std::move(stack_.top())); stack_.pop(); + stack_.push(expr_getdvarcoloralpha::make(arg->loc(), std::move(arg))); break; } case opcode::OP_FirstArrayKey: { - auto args = make_expr_arguments(loc); - auto path = make_expr_path(loc); - auto name = make_expr_identifier(loc, "getfirstarraykey"); - auto var = std::move(stack_.top()); stack_.pop(); + auto args = expr_arguments::make(loc); + auto path = expr_path::make(loc); + auto name = expr_identifier::make(loc, "getfirstarraykey"); + auto var = node::as(std::move(stack_.top())); stack_.pop(); loc = var->loc(); args->list.push_back(std::move(var)); - stack_.push(make_expr_call(loc, call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::normal) })); + stack_.push(expr_call::make(loc, expr_function::make(loc, std::move(path), std::move(name), std::move(args), call::mode::normal))); break; } case opcode::OP_NextArrayKey: { - auto args = make_expr_arguments(loc); - auto path = make_expr_path(loc); - auto name = make_expr_identifier(loc, "getnextarraykey"); - auto var = std::move(stack_.top()); stack_.pop(); + auto args = expr_arguments::make(loc); + auto path = expr_path::make(loc); + auto name = expr_identifier::make(loc, "getnextarraykey"); + auto var = node::as(std::move(stack_.top())); stack_.pop(); args->list.push_back(std::move(var)); - var = std::move(stack_.top()); stack_.pop(); + var = node::as(std::move(stack_.top())); stack_.pop(); loc = var->loc(); args->list.push_back(std::move(var)); - stack_.push(make_expr_call(loc, call{ make_expr_function(loc, std::move(path), std::move(name), std::move(args), call::mode::normal) })); + stack_.push(expr_call::make(loc, expr_function::make(loc, std::move(path), std::move(name), std::move(args), call::mode::normal))); break; } case opcode::OP_LevelEvalFieldVariable: case opcode::OP_LevelEvalFieldVariableRef: { - auto obj = expr{ make_expr_level(loc) }; - auto field = make_expr_identifier(loc, inst.data[0]); - stack_.push(make_expr_field(loc, std::move(obj), std::move(field))); + auto obj = expr_level::make(loc); + auto field = expr_identifier::make(loc, inst.data[0]); + stack_.push(expr_field::make(loc, std::move(obj), std::move(field))); break; } case opcode::OP_SelfEvalFieldVariable: case opcode::OP_SelfEvalFieldVariableRef: { - auto obj = expr{ make_expr_self(loc) }; - auto field = make_expr_identifier(loc, inst.data[0]); - stack_.push(make_expr_field(loc, std::move(obj), std::move(field))); + auto obj = expr_self::make(loc); + auto field = expr_identifier::make(loc, inst.data[0]); + stack_.push(expr_field::make(loc, std::move(obj), std::move(field))); break; } case opcode::OP_DevblockBegin: { - func_->body->block->list.push_back(stmt{ make_asm_dev(loc, inst.data[0]) }); + func_->body->block->list.push_back(stmt_jmp_dev::make(loc, inst.data[0])); break; } case opcode::OP_New: { - stack_.push(make_expr_new(loc, make_expr_identifier(loc, inst.data[0]))); + stack_.push(expr_new::make(loc, expr_identifier::make(loc, inst.data[0]))); break; } case opcode::OP_ScriptFunctionCallClass: { - if (stack_.top()->kind() != node::expr_new) + if (stack_.top()->kind() != node::expr_new || inst.data[0] != "__constructor") { - auto args = make_expr_arguments(loc); - auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + auto args = expr_arguments::make(loc); + auto obj = node::as(std::move(stack_.top())); stack_.pop(); auto var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); - while (var->kind() != node::asm_prescriptcall) + while (var->kind() != node::node_prescriptcall) { - args->list.push_back(std::move(var)); + args->list.push_back(node::as(std::move(var))); var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); } - stack_.push(make_expr_call(loc, call{ make_expr_member(loc, std::move(obj), make_expr_identifier(loc, inst.data[0]), std::move(args), call::mode::normal) })); + stack_.push(expr_call::make(loc, expr_member::make(loc, std::move(obj), expr_identifier::make(loc, inst.data[0]), std::move(args), call::mode::normal))); } break; } @@ -1070,19 +1098,19 @@ auto decompiler::decompile_instruction(instruction const& inst, bool last) -> vo { if (stack_.top()->kind() != node::expr_new) { - auto args = make_expr_arguments(loc); - auto obj = expr{ std::move(stack_.top()) }; stack_.pop(); + auto args = expr_arguments::make(loc); + auto obj = node::as(std::move(stack_.top())); stack_.pop(); auto var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); - while (var->kind() != node::asm_prescriptcall) + while (var->kind() != node::node_prescriptcall) { - args->list.push_back(std::move(var)); + args->list.push_back(node::as(std::move(var))); var = std::move(stack_.top()); stack_.pop(); loc = var->loc(); } - stack_.push(make_expr_call(loc, call{ make_expr_member(loc, std::move(obj), make_expr_identifier(loc, inst.data[0]), std::move(args), call::mode::thread) })); + stack_.push(expr_call::make(loc, expr_member::make(loc, std::move(obj), expr_identifier::make(loc, inst.data[0]), std::move(args), call::mode::thread))); } break; } @@ -1123,19 +1151,19 @@ auto decompiler::decompile_expressions(instruction const& inst) -> void { if (exp == itr->second) { - auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + auto rvalue = node::as(std::move(stack_.top())); stack_.pop(); auto jump = std::move(stack_.top()); stack_.pop(); auto loc = jump->loc(); - if (jump->kind() == node::asm_jmp_true) + if (jump->kind() == node::stmt_jmp_true) { - auto lvalue = std::move(reinterpret_cast(jump.get())->test); - stack_.push(make_expr_or(loc, std::move(lvalue), std::move(rvalue))); + auto lvalue = std::move(reinterpret_cast(jump.get())->test); + stack_.push(expr_binary::make(loc, std::move(lvalue), std::move(rvalue), expr_binary::op::bool_or)); } - else if (jump->kind() == node::asm_jmp_false) + else if (jump->kind() == node::stmt_jmp_false) { - auto lvalue = std::move(reinterpret_cast(jump.get())->test); - stack_.push(make_expr_and(loc, std::move(lvalue), std::move(rvalue))); + auto lvalue = std::move(reinterpret_cast(jump.get())->test); + stack_.push(expr_binary::make(loc, std::move(lvalue), std::move(rvalue), expr_binary::op::bool_and)); } else { @@ -1148,17 +1176,17 @@ auto decompiler::decompile_expressions(instruction const& inst) -> void { if (tern == itr->second) { - auto rvalue = expr{ std::move(stack_.top()) }; stack_.pop(); - auto lvalue = expr{ std::move(stack_.top()) }; stack_.pop(); + auto rvalue = node::as(std::move(stack_.top())); stack_.pop(); + auto lvalue = node::as(std::move(stack_.top())); stack_.pop(); func_->body->block->list.pop_back(); auto stm = std::move(func_->body->block->list.back()); func_->body->block->list.pop_back(); - if (stm == node::asm_jmp_cond) + if (stm->is()) { - auto loc = stm.as_cond->loc(); - stack_.push(make_expr_ternary(loc, std::move(stm.as_cond->test), std::move(lvalue), std::move(rvalue))); + auto loc = stm->as().loc(); + stack_.push(expr_ternary::make(loc, std::move(stm->as().test), std::move(lvalue), std::move(rvalue))); } else { @@ -1185,35 +1213,35 @@ auto decompiler::decompile_infinites(stmt_list& stm) -> void for (auto i = static_cast(stm.list.size() - 1); i > 0; i--) { - if (stm.list.at(i) == node::asm_jmp) + if (stm.list.at(i)->is()) { - if (stm.list.at(i).loc().begin.line < std::stol(stm.list.at(i).as_jump->value.substr(4), 0, 16)) + if (stm.list.at(i)->loc().begin.line < std::stol(stm.list.at(i)->as().value.substr(4), 0, 16)) continue; - if (stm.list.at(i).as_jump->value == locs_.cnt) + if (stm.list.at(i)->as().value == locs_.cnt) continue; - auto break_loc = last_location_index(stm, i) ? locs_.end : stm.list.at(i + 1).label(); - auto start = find_location_index(stm, stm.list.at(i).as_jump->value); + auto break_loc = last_location_index(stm, i) ? locs_.end : stm.list.at(i + 1)->label(); + auto start = find_location_index(stm, stm.list.at(i)->as().value); - if (stm.list.at(i - 1) == node::asm_jmp_cond && stm.list.at(i - 1).as_cond->value == break_loc) + if (stm.list.at(i - 1)->is() && stm.list.at(i - 1)->as().value == break_loc) { continue; } - else if (stm.list.at(start) != node::asm_jmp_cond) + else if (!stm.list.at(start)->is()) { decompile_inf(stm, start, i); - i = stm.list.size(); + i = static_cast(stm.list.size()); } - else if (stm.list.at(start).as_cond->value != break_loc) + else if (stm.list.at(start)->as().value != break_loc) { decompile_inf(stm, start, i); - i = stm.list.size(); + i = static_cast(stm.list.size()); } - else if (stm.list.at(start).as_cond->value == break_loc) + else if (stm.list.at(start)->as().value == break_loc) { decompile_loop(stm, start, i); - i = stm.list.size(); + i = static_cast(stm.list.size()); } } } @@ -1225,9 +1253,9 @@ auto decompiler::decompile_loops(stmt_list& stm) -> void { auto& entry = stm.list.at(i); - if (entry == node::asm_jmp_cond) + if (entry->is()) { - auto j = find_location_index(stm, entry.as_cond->value); + auto j = find_location_index(stm, entry->as().value); if (j < i) { @@ -1238,12 +1266,12 @@ auto decompiler::decompile_loops(stmt_list& stm) -> void j -= 1; - if (stm.list.at(j) == node::asm_jmp) + if (stm.list.at(j)->is()) { - if (stm.list.at(j).as_node->loc().begin.line < std::stol(stm.list.at(j).as_jump->value.substr(4), 0, 16)) + if (stm.list.at(j)->loc().begin.line < std::stol(stm.list.at(j)->as().value.substr(4), 0, 16)) continue; - if (stm.list.at(i).loc().label() == stm.list.at(j).as_jump->value) + if (stm.list.at(i)->loc().label() == stm.list.at(j)->as().value) { decompile_loop(stm, i, j); i = 0; @@ -1257,9 +1285,9 @@ auto decompiler::decompile_switches(stmt_list& stm) -> void { for (auto i = 0u; i < stm.list.size(); i++) { - if (stm.list[i] == node::asm_switch) + if (stm.list[i]->is()) { - auto end = find_location_index(stm, stm.list[i].as_asm_switch->value); + auto end = find_location_index(stm, stm.list[i]->as().value); decompile_switch(stm, i, end); } } @@ -1271,35 +1299,35 @@ auto decompiler::decompile_ifelses(stmt_list& stm) -> void { const auto& entry = stm.list.at(i); - if (entry == node::asm_jmp_cond) + if (entry->is()) { - auto j = find_location_index(stm, entry.as_cond->value) - 1; + auto j = find_location_index(stm, entry->as().value) - 1; auto last_loc = locs_.end; - if (stm.list.at(j) == node::asm_jmp) + if (stm.list.at(j)->is()) { // if block is a loop check break, continue - if (stm.list.at(j).as_jump->value == locs_.cnt) + if (stm.list.at(j)->as().value == locs_.cnt) { //if its a while, continue jumps back - if (stm.list.at(j).as_node->loc().begin.line > std::stol(stm.list.at(j).as_jump->value.substr(4), 0, 16)) + if (stm.list.at(j)->loc().begin.line > std::stol(stm.list.at(j)->as().value.substr(4), 0, 16)) { decompile_if(stm, i, j); } // a dowhile, for or foreach, check for if/else or if/continue - else if (j - i > 1 && stm.list.at(j - 1) == node::stmt_return) + else if (j - i > 1 && stm.list.at(j - 1)->is()) { // block ends with a return, so jump belows to if/else decompile_ifelse(stm, i, j); } - else if (j - i > 1 && stm.list.at(j - 1) == node::asm_jmp) + else if (j - i > 1 && stm.list.at(j - 1)->is()) { - if (stm.list.at(j - 1).as_jump->value == locs_.brk) + if (stm.list.at(j - 1)->as().value == locs_.brk) { // block ends with a break, so jump belows to if/else decompile_ifelse(stm, i, j); } - else if (stm.list.at(j - 1).as_jump->value == locs_.cnt) + else if (stm.list.at(j - 1)->as().value == locs_.cnt) { // block ends with a continue, so jump belows to if/else decompile_ifelse(stm, i, j); @@ -1315,20 +1343,20 @@ auto decompiler::decompile_ifelses(stmt_list& stm) -> void decompile_if(stm, i, j); } } - else if (stm.list.at(j).as_jump->value == locs_.brk) + else if (stm.list.at(j)->as().value == locs_.brk) { decompile_if(stm, i, j); } - else if (stm.list.at(j).as_jump->value == locs_.end) + else if (stm.list.at(j)->as().value == locs_.end) { - if (find_location_reference(stm, i + 1, j, entry.as_cond->value)) + if (find_location_reference(stm, i + 1, j, entry->as().value)) decompile_if(stm, i, j); else decompile_ifelse(stm, i, j); } - else if (stm.list.at(j).as_jump->value == entry.as_cond->value) + else if (stm.list.at(j)->as().value == entry->as().value) { - if (find_location_reference(stm, i + 1, j, entry.as_cond->value)) + if (find_location_reference(stm, i + 1, j, entry->as().value)) decompile_if(stm, i, j); else decompile_ifelse(stm, i, j); @@ -1350,37 +1378,37 @@ auto decompiler::decompile_aborts(stmt_list& stm) -> void { for (auto i = static_cast>(stm.list.size() - 1); i >= 0; i--) { - if (stm.list.at(i) == node::asm_jmp) + if (stm.list[i]->is()) { - auto loc = stm.list.at(i).loc(); - auto jump_loc = stm.list.at(i).as_jump->value; + auto const loc = stm.list[i]->loc(); + auto const jmp = stm.list[i]->as().value; - if (jump_loc == locs_.brk) + if (jmp == locs_.brk) { stm.list.erase(stm.list.begin() + i); - stm.list.insert(stm.list.begin() + i, stmt{ make_stmt_break(loc) }); + stm.list.insert(stm.list.begin() + i, stmt_break::make(loc)); } - else if (jump_loc == locs_.cnt) + else if (jmp == locs_.cnt) { stm.list.erase(stm.list.begin() + i); - stm.list.insert(stm.list.begin() + i, stmt{ make_stmt_continue(loc) }); + stm.list.insert(stm.list.begin() + i, stmt_continue::make(loc)); } else { // fix for treyarch compiler bug: nested switch break locs are not preserved - if (jump_loc != locs_.end) + if (jmp != locs_.end) { - auto j = find_location_index(stm, jump_loc); + auto j = find_location_index(stm, jmp); - if (stm.list.at(j) == node::stmt_break) + if (stm.list.at(j)->is()) { stm.list.erase(stm.list.begin() + i); - stm.list.insert(stm.list.begin() + i, stmt{ make_stmt_break(loc) }); + stm.list.insert(stm.list.begin() + i, stmt_break::make(loc)); continue; } } - std::cout << "WARNING: unresolved jump to '" + jump_loc + "', maybe incomplete for loop\n"; + std::cout << "WARNING: unresolved jump to '" + jmp + "', maybe incomplete for loop\n"; } } } @@ -1390,7 +1418,7 @@ auto decompiler::decompile_devblocks(stmt_list& stm) -> void { for (auto i = 0u; i < stm.list.size(); i++) { - if (stm.list.at(i) == node::asm_dev) + if (stm.list.at(i)->is()) { if (locs_.is_dev) { @@ -1400,23 +1428,23 @@ auto decompiler::decompile_devblocks(stmt_list& stm) -> void if (i + 1 < stm.list.size()) { - if (stm.list.at(i + 1) == node::asm_dev && stm.list.at(i + 1).as_asm_dev->value == stm.list.at(i).as_asm_dev->value) + if (stm.list.at(i + 1)->is() && stm.list.at(i + 1)->as().value == stm.list.at(i)->as().value) { stm.list.erase(stm.list.begin() + i + 1); } } - auto loc = stm.list.at(i).loc(); - auto end = find_location_index(stm, stm.list.at(i).as_asm_dev->value); + auto loc = stm.list.at(i)->loc(); + auto end = find_location_index(stm, stm.list.at(i)->as().value); auto save = locs_; - locs_.end = stm.list.at(i).as_asm_dev->value; + locs_.end = stm.list.at(i)->as().value; locs_.is_dev = true; stm.list.erase(stm.list.begin() + i); end -= 1; - auto list_stmt = make_stmt_list(loc); + auto list_stmt = stmt_list::make(loc); for (auto j = i; j < end; j++) { @@ -1427,23 +1455,21 @@ auto decompiler::decompile_devblocks(stmt_list& stm) -> void decompile_statements(*list_stmt); locs_ = save; - if (list_stmt->list.size() == 1 && list_stmt->list.at(0) == node::stmt_call) + if (list_stmt->list.size() == 1 && list_stmt->list.at(0)->is()) { const auto& st = list_stmt->list.at(0); - if (st.as_call->value == node::expr_call && st.as_call->value.as_call->value == node::expr_function) + if (st->as().value->is() && st->as().value->as().value->is()) { - if (st.as_call->value.as_call->value.as_function->name->value == "assert") + if (st->as().value->as().value->as().name->value == "assert") { - auto new_stmt = stmt{ make_stmt_call(loc, std::move(st.as_call->value)) }; - stm.list.insert(stm.list.begin() + i, std::move(new_stmt)); + stm.list.insert(stm.list.begin() + i, std::move(list_stmt->list.at(0))); continue; } - } } - auto new_stmt = stmt{ make_stmt_dev(loc, std::move(list_stmt)) }; + auto new_stmt = stmt_dev::make(loc, std::move(list_stmt)); stm.list.insert(stm.list.begin() + i, std::move(new_stmt)); } } @@ -1452,14 +1478,14 @@ auto decompiler::decompile_devblocks(stmt_list& stm) -> void auto decompiler::decompile_if(stmt_list& stm, usize begin, usize end) -> void { auto save = locs_; - locs_.end = stm.list[begin].as_cond->value; + locs_.end = stm.list[begin]->as().value; - auto loc = stm.list[begin].loc(); - auto test = std::move(stm.list[begin].as_cond->test); + auto loc = stm.list[begin]->loc(); + auto test = std::move(stm.list[begin]->as().test); stm.list.erase(stm.list.begin() + begin); - auto body = make_stmt_list(loc); + auto body = stmt_list::make(loc); for (auto i = begin; i < end; i++) { @@ -1469,21 +1495,21 @@ auto decompiler::decompile_if(stmt_list& stm, usize begin, usize end) -> void decompile_statements(*body); locs_ = save; - stm.list.insert(stm.list.begin() + begin, stmt{ make_stmt_if(loc, std::move(test), stmt{ make_stmt_comp(loc, std::move(body)) }) }); + stm.list.insert(stm.list.begin() + begin, stmt_if::make(loc, std::move(test), stmt_comp::make(loc, std::move(body)))); } auto decompiler::decompile_ifelse(stmt_list& stm, usize begin, usize end) -> void { auto save = locs_; - locs_.end = stm.list[end].label(); + locs_.end = stm.list[end]->label(); - auto loc = stm.list[begin].loc(); - auto test = std::move(stm.list[begin].as_cond->test); + auto loc = stm.list[begin]->loc(); + auto test = std::move(stm.list[begin]->as().test); stm.list.erase(stm.list.begin() + begin); end--; - auto body_if = make_stmt_list(loc); + auto body_if = stmt_list::make(loc); for (auto i = begin; i < end; i++) { @@ -1494,7 +1520,7 @@ auto decompiler::decompile_ifelse(stmt_list& stm, usize begin, usize end) -> voi decompile_statements(*body_if); locs_ = save; - auto end_loc = stm.list[begin].as_jump->value; + auto end_loc = stm.list[begin]->as().value; stm.list.erase(stm.list.begin() + begin); @@ -1503,7 +1529,7 @@ auto decompiler::decompile_ifelse(stmt_list& stm, usize begin, usize end) -> voi save = locs_; locs_.end = end_loc; - auto body_else = make_stmt_list(loc); + auto body_else = stmt_list::make(loc); for (auto i = begin; i < end; i++) { @@ -1513,21 +1539,21 @@ auto decompiler::decompile_ifelse(stmt_list& stm, usize begin, usize end) -> voi decompile_statements(*body_else); locs_ = save; - stm.list.insert(stm.list.begin() + begin, stmt{ make_stmt_ifelse(loc, std::move(test), stmt{ make_stmt_comp(loc, std::move(body_if)) }, stmt{ make_stmt_comp(loc, std::move(body_else)) }) }); + stm.list.insert(stm.list.begin() + begin, stmt_ifelse::make(loc, std::move(test), stmt_comp::make(loc, std::move(body_if)), stmt_comp::make(loc, std::move(body_else)))); } auto decompiler::decompile_inf(stmt_list& stm, usize begin, usize end) -> void { auto save = locs_; - locs_.brk = last_location_index(stm, end) ? locs_.end : stm.list[end + 1].label(); - locs_.end = stm.list[end].label(); - locs_.cnt = stm.list[end].label(); + locs_.brk = last_location_index(stm, end) ? locs_.end : stm.list[end + 1]->label(); + locs_.end = stm.list[end]->label(); + locs_.cnt = stm.list[end]->label(); - auto loc = stm.list[begin].loc(); + auto loc = stm.list[begin]->loc(); stm.list.erase(stm.list.begin() + end); - auto body = make_stmt_list(loc); + auto body = stmt_list::make(loc); for (auto i = begin; i < end; i++) { @@ -1537,26 +1563,26 @@ auto decompiler::decompile_inf(stmt_list& stm, usize begin, usize end) -> void decompile_statements(*body); locs_ = save; - stm.list.insert(stm.list.begin() + begin, stmt{ make_stmt_for(loc, stmt{ make_node(loc) }, expr{ make_node(loc) }, stmt{ make_node(loc) }, stmt{ make_stmt_comp(loc, std::move(body)) }) }); + stm.list.insert(stm.list.begin() + begin, stmt_for::make(loc, stmt_empty::make(loc), expr_empty::make(loc), stmt_empty::make(loc), stmt_comp::make(loc, std::move(body)))); } auto decompiler::decompile_loop(stmt_list& stm, usize begin, usize end) -> void { - if (ctx_->props() & props::version2 && (begin + 2 < end)) + if (ctx_->props() & props::foreach && (begin + 2 < end)) { auto& last = stm.list.at(begin + 2); - if (last == node::stmt_assign) + if (last->is()) { - if (last.as_assign->value == node::expr_assign_equal) + if (last->as().value->is()) { - auto& call = last.as_assign->value.as_assign_equal->rvalue; + auto& val = last->as().value->as().rvalue; - if (call == node::expr_call && call.as_call->value == node::expr_function) + if (val->is() && val->as().value->is()) { - if (utils::string::to_lower(call.as_call->value.as_function->name->value) == "getnextarraykey") + if (utils::string::to_lower(val->as().value->as().name->value) == "getnextarraykey") { - auto ref = stm.list.at(begin).loc().label(); + auto ref = stm.list.at(begin)->label(); if (!find_location_reference(stm, 0, begin, ref)) { @@ -1571,17 +1597,17 @@ auto decompiler::decompile_loop(stmt_list& stm, usize begin, usize end) -> void auto& last = stm.list.at(end - 1); - if (last == node::stmt_assign) + if (last->is()) { - if (last.as_assign->value == node::expr_assign_equal) + if (last->as().value->is()) { - auto& call = last.as_assign->value.as_assign_equal->rvalue; + auto& val = last->as().value->as().rvalue; - if (call == node::expr_call && call.as_call->value == node::expr_function) + if (val->is() && val->as().value->is()) { - if (utils::string::to_lower(call.as_call->value.as_function->name->value) == "getnextarraykey") + if (utils::string::to_lower(val->as().value->as().name->value) == "getnextarraykey") { - auto ref = stm.list.at(begin).loc().label(); + auto ref = stm.list.at(begin)->label(); if (!find_location_reference(stm, 0, begin, ref)) { @@ -1592,18 +1618,18 @@ auto decompiler::decompile_loop(stmt_list& stm, usize begin, usize end) -> void } } - if (begin > 0) // while at func start + if (begin > 0 && stm.list.at(begin - 1)->is()) // while at func start { - if (stm.list.at(begin - 1) == node::stmt_assign) + if (stm.list.at(begin - 1)->as().value->is_assign()) { - if (!lvalues_match(*stm.list.at(begin - 1).as_assign, *last.as_assign)) + if (!lvalues_match(stm.list.at(begin - 1)->as(), last->as())) { decompile_while(stm, begin, end); return; } - auto ref1 = stm.list.at(end).loc().label(); - auto ref2 = stm.list.at(begin).loc().label(); + auto ref1 = stm.list.at(end)->label(); + auto ref2 = stm.list.at(begin)->label(); if (find_location_reference(stm, begin, end, ref1)) { @@ -1638,18 +1664,18 @@ auto decompiler::decompile_loop(stmt_list& stm, usize begin, usize end) -> void auto decompiler::decompile_while(stmt_list& stm, usize begin, usize end) -> void { auto save = locs_; - locs_.end = stm.list[end].label(); - locs_.cnt = stm.list[begin].label(); - locs_.brk = stm.list[begin].as_cond->value; + locs_.end = stm.list[end]->label(); + locs_.cnt = stm.list[begin]->label(); + locs_.brk = stm.list[begin]->as().value; - auto loc = stm.list[begin].loc(); - auto test = std::move(stm.list[begin].as_cond->test); + auto loc = stm.list[begin]->loc(); + auto test = std::move(stm.list[begin]->as().test); end--; stm.list.erase(stm.list.begin() + begin); stm.list.erase(stm.list.begin() + end); - auto body = make_stmt_list(loc); + auto body = stmt_list::make(loc); for (auto i = begin; i < end; i++) { @@ -1659,21 +1685,21 @@ auto decompiler::decompile_while(stmt_list& stm, usize begin, usize end) -> void decompile_statements(*body); locs_ = save; - stm.list.insert(stm.list.begin() + begin, stmt{ make_stmt_while(loc, std::move(test), stmt{ make_stmt_comp(loc, std::move(body)) }) }); + stm.list.insert(stm.list.begin() + begin, stmt_while::make(loc, std::move(test), stmt_comp::make(loc, std::move(body)))); } auto decompiler::decompile_dowhile(stmt_list& stm, usize begin, usize end) -> void { auto save = locs_; - locs_.end = stm.list[end].label(); - locs_.cnt = stm.list[end].label(); - locs_.brk = last_location_index(stm, end) ? save.end : stm.list[end + 1].label(); + locs_.end = stm.list[end]->label(); + locs_.cnt = stm.list[end]->label(); + locs_.brk = last_location_index(stm, end) ? save.end : stm.list[end + 1]->label(); - auto test = std::move(stm.list[end].as_cond->test); - auto loc = stm.list[begin].loc(); + auto test = std::move(stm.list[end]->as().test); + auto loc = stm.list[begin]->loc(); stm.list.erase(stm.list.begin() + end); - auto body = make_stmt_list(loc); + auto body = stmt_list::make(loc); for (auto i = begin; i < end; i++) { @@ -1683,30 +1709,30 @@ auto decompiler::decompile_dowhile(stmt_list& stm, usize begin, usize end) -> vo decompile_statements(*body); locs_ = save; - stm.list.insert(stm.list.begin() + begin, stmt{ make_stmt_dowhile(loc, std::move(test), stmt{ make_stmt_comp(loc, std::move(body)) }) }); + stm.list.insert(stm.list.begin() + begin, stmt_dowhile::make(loc, std::move(test), stmt_comp::make(loc, std::move(body)))); } auto decompiler::decompile_for(stmt_list& stm, usize begin, usize end) -> void { auto save = locs_; - locs_.end = stm.list[end - 1].label(); - locs_.cnt = stm.list[end - 1].label(); - locs_.brk = stm.list[begin].as_cond->value; + locs_.end = stm.list[end - 1]->label(); + locs_.cnt = stm.list[end - 1]->label(); + locs_.brk = stm.list[begin]->as().value; begin--; - auto loc = stm.list[begin].loc(); - auto init = make_stmt_expr(loc, std::move(stm.list[begin].as_assign->value)); + auto loc = stm.list[begin]->loc(); + auto init = std::move(stm.list[begin]); stm.list.erase(stm.list.begin() + begin); - auto test = std::move(stm.list[begin].as_cond->test); + auto test = std::move(stm.list[begin]->as().test); stm.list.erase(stm.list.begin() + begin); end -= 3; - auto iter = make_stmt_expr(loc, std::move(stm.list[end].as_assign->value)); + auto iter = std::move(stm.list[end]); stm.list.erase(stm.list.begin() + end); stm.list.erase(stm.list.begin() + end); - auto body = make_stmt_list(loc); + auto body = stmt_list::make(loc); for (auto i = begin; i < end; i++) { @@ -1716,44 +1742,44 @@ auto decompiler::decompile_for(stmt_list& stm, usize begin, usize end) -> void decompile_statements(*body); locs_ = save; - stm.list.insert(stm.list.begin() + begin, stmt{ make_stmt_for(loc, stmt { std::move(init) }, std::move(test), stmt { std::move(iter) }, stmt{ make_stmt_comp(loc, std::move(body)) }) }); + stm.list.insert(stm.list.begin() + begin, stmt_for::make(loc, std::move(init), std::move(test), std::move(iter), stmt_comp::make(loc, std::move(body)))); } auto decompiler::decompile_foreach(stmt_list& stm, usize begin, usize end) -> void { auto save = locs_; - locs_.end = stm.list[end - 1].label(); - locs_.cnt = stm.list[end - 1].label(); - locs_.brk = stm.list[begin].as_cond->value; + locs_.end = stm.list[end - 1]->label(); + locs_.cnt = stm.list[end - 1]->label(); + locs_.brk = stm.list[begin]->as().value; begin -= 2; - auto loc = stm.list[begin].loc(); - auto container = std::move(stm.list[begin].as_assign->value.as_assign->rvalue); - auto array = std::move(stm.list[begin].as_assign->value.as_assign->lvalue); + auto loc = stm.list[begin]->loc(); + auto container = std::move(stm.list[begin]->as().value->as().rvalue); + auto array = std::move(stm.list[begin]->as().value->as().lvalue); stm.list.erase(stm.list.begin() + begin); - auto key = std::move(stm.list[begin].as_assign->value.as_assign->lvalue); + auto key = std::move(stm.list[begin]->as().value->as().lvalue); stm.list.erase(stm.list.begin() + begin); stm.list.erase(stm.list.begin() + begin); - auto value = std::move(stm.list[begin].as_assign->value.as_assign->lvalue); + auto value = std::move(stm.list[begin]->as().value->as().lvalue); stm.list.erase(stm.list.begin() + begin); - end -= (ctx_->props() & props::version2) ? 6 : 5; + end -= (ctx_->props() & props::foreach) ? 6 : 5; - if (ctx_->props() & props::version2) + if (ctx_->props() & props::foreach) stm.list.erase(stm.list.begin() + begin); stm.list.erase(stm.list.begin() + end); stm.list.erase(stm.list.begin() + end); - auto use_key = !key.as_identifier->value.starts_with("_k"); + auto use_key = !key->as().value.starts_with("_k"); - if ((ctx_->props() & props::version2) && key.as_identifier->value.starts_with("_id_")) + if ((ctx_->props() & props::foreach) && key->as().value.starts_with("_id_")) use_key = false; - auto body = make_stmt_list(loc); + auto body = stmt_list::make(loc); for (auto i = begin; i < end; i++) { @@ -1763,12 +1789,12 @@ auto decompiler::decompile_foreach(stmt_list& stm, usize begin, usize end) -> vo decompile_statements(*body); locs_ = save; - stm.list.insert(stm.list.begin() + begin, stmt{ make_stmt_foreach(loc, std::move(container), std::move(value), std::move(array), std::move(key), stmt{ make_stmt_comp(loc, std::move(body)) }, use_key) }); + stm.list.insert(stm.list.begin() + begin, stmt_foreach::make(loc, std::move(container), std::move(value), std::move(array), std::move(key), stmt_comp::make(loc, std::move(body)), use_key)); } auto decompiler::decompile_switch(stmt_list& stm, usize begin, usize end) -> void { - auto const& data = stm.list[end].as_asm_endswitch->data; + auto const& data = stm.list[end]->as().data; auto const count = std::stoul(data[0]); if (count) @@ -1781,18 +1807,18 @@ auto decompiler::decompile_switch(stmt_list& stm, usize begin, usize end) -> voi if (data[index] == "case") { auto j = find_location_index(stm, data[index + 2]); - auto loc = stm.list[j].loc(); - auto exp = (type == switch_type::integer) ? expr{ make_expr_integer(loc, data[index + 1]) } : expr{ make_expr_string(loc, data[index + 1]) }; - while (stm.list[j] == node::stmt_case) j++; - stm.list.insert(stm.list.begin() + j, stmt{ make_stmt_case(loc, std::move(exp), make_stmt_list(loc)) }); + auto loc = stm.list[j]->loc(); + auto exp = (type == switch_type::integer) ? expr::ptr{ expr_integer::make(loc, data[index + 1]) } : expr::ptr{ expr_string::make(loc, data[index + 1]) }; + while (stm.list[j]->is()) j++; + stm.list.insert(stm.list.begin() + j, stmt_case::make(loc, std::move(exp), stmt_list::make(loc))); index += 3; } else if (data[index] == "default") { auto j = find_location_index(stm, data[index + 1]); - auto loc = stm.list[j].loc(); - while (stm.list[j] == node::stmt_case) j++; - stm.list.insert(stm.list.begin() + j, stmt{ make_stmt_default(loc, make_stmt_list(loc)) }); + auto loc = stm.list[j]->loc(); + while (stm.list[j]->is()) j++; + stm.list.insert(stm.list.begin() + j, stmt_default::make(loc, stmt_list::make(loc))); index += 2; } else @@ -1805,17 +1831,17 @@ auto decompiler::decompile_switch(stmt_list& stm, usize begin, usize end) -> voi } auto save = locs_; - locs_.brk = last_location_index(stm, end) ? locs_.end : stm.list[end + 1].label(); - locs_.end = stm.list[begin].as_asm_switch->value; + locs_.brk = last_location_index(stm, end) ? locs_.end : stm.list[end + 1]->label(); + locs_.end = stm.list[begin]->as().value; - auto loc = stm.list[begin].loc(); - auto test = std::move(stm.list[begin].as_asm_switch->test); + auto loc = stm.list[begin]->loc(); + auto test = std::move(stm.list[begin]->as().test); end--; stm.list.erase(stm.list.begin() + begin); stm.list.erase(stm.list.begin() + end); - auto body = make_stmt_list(loc); + auto body = stmt_list::make(loc); for (auto i = begin; i < end; i++) { @@ -1826,13 +1852,13 @@ auto decompiler::decompile_switch(stmt_list& stm, usize begin, usize end) -> voi decompile_statements(*body); locs_ = save; - auto temp = stmt{ make_node() }; + auto temp = stmt::ptr{ stmt_empty::make(location{}) }; for (auto i = 0u; i < body->list.size(); ) { - if (body->list[i] == node::stmt_case || body->list[i] == node::stmt_default) + if (body->list[i]->is() || body->list[i]->is()) { - if (temp != node::null) + if (!temp->is()) { body->list.insert(body->list.begin() + i, std::move(temp)); i++; @@ -1843,14 +1869,14 @@ auto decompiler::decompile_switch(stmt_list& stm, usize begin, usize end) -> voi } else { - if (temp == node::stmt_case) + if (temp->is()) { - temp.as_case->body->list.push_back(std::move(body->list[i])); + temp->as().body->list.push_back(std::move(body->list[i])); body->list.erase(body->list.begin() + i); } - else if (temp == node::stmt_default) + else if (temp->is()) { - temp.as_default->body->list.push_back(std::move(body->list[i])); + temp->as().body->list.push_back(std::move(body->list[i])); body->list.erase(body->list.begin() + i); } else @@ -1860,12 +1886,12 @@ auto decompiler::decompile_switch(stmt_list& stm, usize begin, usize end) -> voi } } - if (temp != node::null) + if (!temp->is()) { body->list.push_back(std::move(temp)); } - stm.list.insert(stm.list.begin() + begin, stmt{ make_stmt_switch(loc, std::move(test), make_stmt_comp(loc, std::move(body))) }); + stm.list.insert(stm.list.begin() + begin, stmt_switch::make(loc, std::move(test), stmt_comp::make(loc, std::move(body)))); } auto decompiler::find_location_reference(stmt_list const& stm, usize begin, usize end, std::string const& loc) -> bool @@ -1874,15 +1900,15 @@ auto decompiler::find_location_reference(stmt_list const& stm, usize begin, usiz { auto const& entry = stm.list.at(i); - if (entry == node::asm_jmp_cond && entry.as_cond->value == loc) + if (entry->is() && entry->as().value == loc) { return true; } - else if (entry == node::asm_jmp && entry.as_jump->value == loc) + else if (entry->is() && entry->as().value == loc) { return true; } - else if (entry == node::asm_dev && entry.as_asm_dev->value == loc) + else if (entry->is() && entry->as().value == loc) { return true; } @@ -1900,7 +1926,7 @@ auto decompiler::find_location_index(stmt_list const& stm, std::string const& lo for (auto const& entry : stm.list) { - if (entry.label() == loc) + if (entry->label() == loc) return index; index++; @@ -1914,56 +1940,36 @@ auto decompiler::last_location_index(stmt_list const& stm, usize index) -> bool return (index == stm.list.size() - 1); } -auto decompiler::lvalues_match(stmt_assign const& stm1, stmt_assign const& stm2) -> bool +auto decompiler::lvalues_match(stmt_expr const& stm1, stmt_expr const& stm2) -> bool { expr* lvalue1 {}; expr* lvalue2 {}; - switch (stm1.value.kind()) + switch (stm1.value->kind()) { case node::expr_increment: - lvalue1 = &stm1.value.as_increment->lvalue; + lvalue1 = stm1.value->as().lvalue.get(); break; case node::expr_decrement: - lvalue1 = &stm1.value.as_decrement->lvalue; + lvalue1 = stm1.value->as().lvalue.get(); break; - case node::expr_assign_equal: - case node::expr_assign_add: - case node::expr_assign_sub: - case node::expr_assign_mul: - case node::expr_assign_div: - case node::expr_assign_mod: - case node::expr_assign_shift_left: - case node::expr_assign_shift_right: - case node::expr_assign_bitwise_or: - case node::expr_assign_bitwise_and: - case node::expr_assign_bitwise_exor: - lvalue1 = &stm1.value.as_assign->lvalue; + case node::expr_assign: + lvalue1 = stm1.value->as().lvalue.get(); break; default: break; } - switch (stm2.value.kind()) + switch (stm2.value->kind()) { case node::expr_increment: - lvalue2 = &stm2.value.as_increment->lvalue; + lvalue2 = stm2.value->as().lvalue.get(); break; case node::expr_decrement: - lvalue2 = &stm2.value.as_decrement->lvalue; + lvalue2 = stm2.value->as().lvalue.get(); break; - case node::expr_assign_equal: - case node::expr_assign_add: - case node::expr_assign_sub: - case node::expr_assign_mul: - case node::expr_assign_div: - case node::expr_assign_mod: - case node::expr_assign_shift_left: - case node::expr_assign_shift_right: - case node::expr_assign_bitwise_or: - case node::expr_assign_bitwise_and: - case node::expr_assign_bitwise_exor: - lvalue2 = &stm2.value.as_assign->lvalue; + case node::expr_assign: + lvalue2 = stm2.value->as().lvalue.get(); break; default: break; @@ -1999,64 +2005,58 @@ auto decompiler::process_stmt(stmt& stm) -> void switch (stm.kind()) { case node::stmt_list: - process_stmt_list(*stm.as_list); + process_stmt_list(stm.as()); break; - case node::stmt_comp: - process_stmt_comp(*stm.as_comp); + case node::stmt_comp: + process_stmt_comp(stm.as()); break; case node::stmt_dev: - process_stmt_dev(*stm.as_dev); + process_stmt_dev(stm.as()); break; case node::stmt_expr: - process_stmt_expr(*stm.as_expr); - break; - case node::stmt_call: - process_stmt_call(*stm.as_call); - break; - case node::stmt_assign: - process_stmt_assign(*stm.as_assign); + process_stmt_expr(stm.as()); break; case node::stmt_endon: - process_stmt_endon(*stm.as_endon); + process_stmt_endon(stm.as()); break; case node::stmt_notify: - process_stmt_notify(*stm.as_notify); - break; - case node::stmt_realwait: - process_stmt_realwait(*stm.as_realwait); + process_stmt_notify(stm.as()); break; case node::stmt_wait: - process_stmt_wait(*stm.as_wait); + process_stmt_wait(stm.as()); break; case node::stmt_waittill: - process_stmt_waittill(*stm.as_waittill); + process_stmt_waittill(stm.as()); break; case node::stmt_waittillmatch: - process_stmt_waittillmatch(*stm.as_waittillmatch); + process_stmt_waittillmatch(stm.as()); + break; + case node::stmt_waitrealtime: + process_stmt_waitrealtime(stm.as()); break; case node::stmt_if: - process_stmt_if(*stm.as_if); + process_stmt_if(stm.as()); break; case node::stmt_ifelse: - process_stmt_ifelse(*stm.as_ifelse); + process_stmt_ifelse(stm.as()); break; case node::stmt_while: - process_stmt_while(*stm.as_while); + process_stmt_while(stm.as()); break; case node::stmt_dowhile: - process_stmt_dowhile(*stm.as_dowhile); + process_stmt_dowhile(stm.as()); break; case node::stmt_for: - process_stmt_for(*stm.as_for); + process_stmt_for(stm.as()); break; case node::stmt_foreach: - process_stmt_foreach(*stm.as_foreach); + process_stmt_foreach(stm.as()); break; case node::stmt_switch: - process_stmt_switch(*stm.as_switch); + process_stmt_switch(stm.as()); break; case node::stmt_return: - process_stmt_return(*stm.as_return); + process_stmt_return(stm.as()); break; default: break; @@ -2067,7 +2067,7 @@ auto decompiler::process_stmt_list(stmt_list& stm) -> void { for (auto& entry : stm.list) { - process_stmt(entry); + process_stmt(*entry); } } @@ -2083,69 +2083,22 @@ auto decompiler::process_stmt_dev(stmt_dev& stm) -> void auto decompiler::process_stmt_expr(stmt_expr& stm) -> void { - switch (stm.value.kind()) + switch (stm.value->kind()) { case node::expr_increment: - process_expr_increment(*stm.value.as_increment); + process_expr_increment(stm.value->as()); break; case node::expr_decrement: - process_expr_decrement(*stm.value.as_decrement); + process_expr_decrement(stm.value->as()); break; - case node::expr_assign_equal: - case node::expr_assign_add: - case node::expr_assign_sub: - case node::expr_assign_mul: - case node::expr_assign_div: - case node::expr_assign_mod: - case node::expr_assign_shift_left: - case node::expr_assign_shift_right: - case node::expr_assign_bitwise_or: - case node::expr_assign_bitwise_and: - case node::expr_assign_bitwise_exor: - process_expr_assign(stm.value.as_assign); + case node::expr_assign: + process_expr_assign(*reinterpret_cast(&stm.value)); break; - default: - break; - } -} - -auto decompiler::process_stmt_call(stmt_call& stm) -> void -{ - switch (stm.value.kind()) - { case node::expr_call: - process_expr_call(*stm.value.as_call); + process_expr_call(stm.value->as()); break; case node::expr_method: - process_expr_method(*stm.value.as_method); - break; - default: - break; - } -} - -auto decompiler::process_stmt_assign(stmt_assign& stm) -> void -{ - switch (stm.value.kind()) - { - case node::expr_increment: - process_expr_increment(*stm.value.as_increment); - break; - case node::expr_decrement: - process_expr_decrement(*stm.value.as_decrement); - break; - case node::expr_assign_equal: - case node::expr_assign_add: - case node::expr_assign_sub: - case node::expr_assign_mul: - case node::expr_assign_div: - case node::expr_assign_mod: - case node::expr_assign_shift_left: - case node::expr_assign_shift_right: - case node::expr_assign_bitwise_or: - case node::expr_assign_bitwise_and: - case node::expr_assign_bitwise_exor: - process_expr_assign(stm.value.as_assign); + process_expr_method(stm.value->as()); break; default: break; @@ -2165,11 +2118,6 @@ void decompiler::process_stmt_notify(stmt_notify& stm) process_expr(stm.obj); } -auto decompiler::process_stmt_realwait(stmt_realwait& stm) -> void -{ - process_expr(stm.time); -} - auto decompiler::process_stmt_wait(stmt_wait& stm) -> void { process_expr(stm.time); @@ -2193,77 +2141,82 @@ auto decompiler::process_stmt_waittillmatch(stmt_waittillmatch& stm) -> void process_expr(stm.obj); } +auto decompiler::process_stmt_waitrealtime(stmt_waitrealtime& stm) -> void +{ + process_expr(stm.time); +} + auto decompiler::process_stmt_if(stmt_if& stm) -> void { process_expr(stm.test); - process_stmt(stm.body); + process_stmt(*stm.body); - if (stm.body.as_comp->block->list.size() == 1 && !stm.body.as_comp->block->list[0].as_node->is_special_stmt_dev()) + if (stm.body->as().block->list.size() == 1 && !stm.body->as().block->list[0]->is_special_stmt_dev()) { - stm.body = std::move(stm.body.as_comp->block->list.back()); + stm.body = std::move(stm.body->as().block->list.back()); } } auto decompiler::process_stmt_ifelse(stmt_ifelse& stm) -> void { process_expr(stm.test); - process_stmt(stm.stmt_if); - process_stmt(stm.stmt_else); + process_stmt(*stm.stmt_if); + process_stmt(*stm.stmt_else); - if (stm.stmt_if.as_comp->block->list.size() == 1 && !stm.stmt_if.as_comp->block->list[0].as_node->is_special_stmt_dev()) + if (stm.stmt_if->as().block->list.size() == 1 && !stm.stmt_if->as().block->list[0]->is_special_stmt_dev()) { - stm.stmt_if = std::move(stm.stmt_if.as_comp->block->list.back()); + stm.stmt_if = std::move(stm.stmt_if->as().block->list.back()); } - if (stm.stmt_else.as_comp->block->list.size() == 1 && !stm.stmt_else.as_comp->block->list[0].as_node->is_special_stmt_dev_noif()) + if (stm.stmt_else->as().block->list.size() == 1 && !stm.stmt_else->as().block->list[0]->is_special_stmt_dev_noif()) { - stm.stmt_else = std::move(stm.stmt_else.as_comp->block->list.back()); + stm.stmt_else = std::move(stm.stmt_else->as().block->list.back()); } } auto decompiler::process_stmt_while(stmt_while& stm) -> void { - if (stm.test == node::expr_integer && stm.test.as_integer->value == "1") + if (stm.test->is() && stm.test->as().value == "1") { - stm.test = expr{ make_expr_true(stm.test.loc()) }; + stm.test = expr_true::make(stm.test->loc()); } process_expr(stm.test); - process_stmt(stm.body); + process_stmt(*stm.body); - if (stm.body.as_comp->block->list.size() == 1 && !stm.body.as_comp->block->list[0].as_node->is_special_stmt_dev()) + if (stm.body->as().block->list.size() == 1 && !stm.body->as().block->list[0]->is_special_stmt_dev()) { - stm.body = std::move(stm.body.as_comp->block->list.back()); + stm.body = std::move(stm.body->as().block->list.back()); } } auto decompiler::process_stmt_dowhile(stmt_dowhile& stm) -> void { - if (stm.test == node::expr_integer && stm.test.as_integer->value == "1") + if (stm.test->is() && stm.test->as().value == "1") { - stm.test = expr{ make_expr_true(stm.test.loc()) }; + stm.test = expr_true::make(stm.test->loc()); } process_expr(stm.test); - process_stmt(stm.body); + process_stmt(*stm.body); - if (stm.body.as_comp->block->list.size() == 1 && !stm.body.as_comp->block->list[0].as_node->is_special_stmt_dev()) + if (stm.body->as().block->list.size() == 1 && !stm.body->as().block->list[0]->is_special_stmt_dev()) { - stm.body = std::move(stm.body.as_comp->block->list.back()); + stm.body = std::move(stm.body->as().block->list.back()); } } auto decompiler::process_stmt_for(stmt_for& stm) -> void { - process_stmt(stm.init); + process_stmt(*stm.init); process_expr(stm.test); - process_stmt(stm.body); - process_stmt(stm.iter); + process_stmt(*stm.body); + process_stmt(*stm.iter); - if (stm.body.as_comp->block->list.size() == 1 && !stm.body.as_comp->block->list[0].as_node->is_special_stmt_dev()) + if (stm.body->as().block->list.size() == 1 && !stm.body->as().block->list[0]->is_special_stmt_dev()) { - stm.body = std::move(stm.body.as_comp->block->list.back()); + stm.body = std::move(stm.body->as().block->list.back()); } } @@ -2274,14 +2227,14 @@ auto decompiler::process_stmt_foreach(stmt_foreach& stm) -> void process_expr(stm.key); process_expr(stm.value); - if ((ctx_->props() & props::version2) && !stm.use_key) - vars_.insert(stm.key.as_identifier->value); + if ((ctx_->props() & props::foreach) && !stm.use_key) + vars_.insert(stm.key->as().value); - process_stmt(stm.body); + process_stmt(*stm.body); - if ((ctx_->props() & props::version2) && !stm.use_key) + if ((ctx_->props() & props::foreach) && !stm.use_key) { - auto const it = vars_.find(stm.key.as_identifier->value); + auto const it = vars_.find(stm.key->as().value); if (it != vars_.end()) vars_.erase(it); @@ -2289,9 +2242,9 @@ auto decompiler::process_stmt_foreach(stmt_foreach& stm) -> void stm.use_key = true; } - if (stm.body.as_comp->block->list.size() == 1 && !stm.body.as_comp->block->list[0].as_node->is_special_stmt_dev()) + if (stm.body->as().block->list.size() == 1 && !stm.body->as().block->list[0]->is_special_stmt_dev()) { - stm.body = std::move(stm.body.as_comp->block->list.back()); + stm.body = std::move(stm.body->as().block->list.back()); } } @@ -2301,204 +2254,126 @@ auto decompiler::process_stmt_switch(stmt_switch& stm) -> void for (auto& entry : stm.body->block->list) { - if (entry == node::stmt_case) + if (entry->is()) { - process_stmt_list(*entry.as_case->body); + process_stmt_list(*entry->as().body); } - else if (entry == node::stmt_default) + else if (entry->is()) { - process_stmt_list(*entry.as_default->body); + process_stmt_list(*entry->as().body); } } } auto decompiler::process_stmt_return(stmt_return& stm) -> void { - if (stm.value != node::null) + if (!stm.value->is()) { - if (retbool_ && stm.value == node::expr_integer) - stm.value = stm.value.as_integer->value == "1" ? expr{ make_expr_true(stm.loc()) } : expr{ make_expr_false(stm.loc()) }; + if (retbool_ && stm.value->is()) + stm.value = stm.value->as().value == "1" ? expr::ptr{ expr_true::make(stm.loc()) } : expr::ptr{ expr_false::make(stm.loc()) }; else process_expr(stm.value); } } -auto decompiler::process_expr(expr& exp) -> void +auto decompiler::process_expr(expr::ptr& exp) -> void { - switch (exp.kind()) + switch (exp->kind()) { case node::expr_ternary: - process_expr_ternary(*exp.as_ternary); + process_expr_ternary(exp->as()); break; - case node::expr_and: - process_expr_and(*exp.as_and); - break; - case node::expr_or: - process_expr_or(*exp.as_or); - break; - case node::expr_super_equal: - case node::expr_super_not_equal: - case node::expr_equality: - case node::expr_inequality: - case node::expr_less: - case node::expr_greater: - case node::expr_less_equal: - case node::expr_greater_equal: - case node::expr_bitwise_or: - case node::expr_bitwise_and: - case node::expr_bitwise_exor: - case node::expr_shift_left: - case node::expr_shift_right: - case node::expr_add: - case node::expr_sub: - case node::expr_mul: - case node::expr_div: - case node::expr_mod: - process_expr_binary(*exp.as_binary); + case node::expr_binary: + process_expr_binary(exp->as()); break; case node::expr_complement: - process_expr_complement(*exp.as_complement); + process_expr_complement(exp->as()); break; case node::expr_not: - process_expr_not(*exp.as_not); + process_expr_not(exp->as()); break; case node::expr_call: - process_expr_call(*exp.as_call); + process_expr_call(exp->as()); break; case node::expr_method: - process_expr_method(*exp.as_method); + process_expr_method(exp->as()); break; case node::expr_getnextarraykey: - process_expr(exp.as_getnextarraykey->arg2); - process_expr(exp.as_getnextarraykey->arg1); + process_expr(exp->as().arg2); + process_expr(exp->as().arg1); break; case node::expr_getfirstarraykey: - process_expr(exp.as_getfirstarraykey->arg); + process_expr(exp->as().arg); break; case node::expr_getdvarcoloralpha: - process_expr(exp.as_getdvarcoloralpha->arg); + process_expr(exp->as().arg); break; case node::expr_getdvarcolorblue: - process_expr(exp.as_getdvarcolorblue->arg); + process_expr(exp->as().arg); break; case node::expr_getdvarcolorgreen: - process_expr(exp.as_getdvarcolorgreen->arg); + process_expr(exp->as().arg); break; case node::expr_getdvarcolorred: - process_expr(exp.as_getdvarcolorred->arg); + process_expr(exp->as().arg); break; case node::expr_getdvarvector: - process_expr(exp.as_getdvarvector->arg); + process_expr(exp->as().arg); break; case node::expr_getdvarfloat: - process_expr(exp.as_getdvarfloat->arg); + process_expr(exp->as().arg); break; case node::expr_getdvarint: - process_expr(exp.as_getdvarint->arg); + process_expr(exp->as().arg); break; case node::expr_getdvar: - process_expr(exp.as_getdvar->arg); + process_expr(exp->as().arg); break; case node::expr_abs: - process_expr(exp.as_abs->arg); + process_expr(exp->as().arg); break; case node::expr_vectortoangles: - process_expr(exp.as_vectortoangles->arg); + process_expr(exp->as().arg); break; case node::expr_angleclamp180: - process_expr(exp.as_angleclamp180->arg); + process_expr(exp->as().arg); break; case node::expr_anglestoforward: - process_expr(exp.as_anglestoforward->arg); + process_expr(exp->as().arg); break; case node::expr_anglestoright: - process_expr(exp.as_anglestoright->arg); + process_expr(exp->as().arg); break; case node::expr_anglestoup: - process_expr(exp.as_anglestoup->arg); + process_expr(exp->as().arg); break; case node::expr_vectorscale: - process_expr(exp.as_vectorscale->arg2); - process_expr(exp.as_vectorscale->arg1); + process_expr(exp->as().arg2); + process_expr(exp->as().arg1); break; case node::expr_isdefined: - process_expr(exp.as_isdefined->value); + process_expr(exp->as().value); break; case node::expr_array: - process_expr_array(*exp.as_array); + process_expr_array(exp->as()); break; case node::expr_field: - process_expr_field(*exp.as_field); + process_expr_field(exp->as()); break; case node::expr_size: - process_expr_size(*exp.as_size); + process_expr_size(exp->as()); break; case node::expr_vector: - process_expr_vector(*exp.as_vector); + process_expr_vector(exp->as()); break; case node::expr_identifier: - process_expr_identifier(*exp.as_identifier); + process_expr_identifier(exp->as()); break; default: break; } } -auto decompiler::process_expr_assign(expr_assign::ptr& exp) -> void -{ - process_expr(exp->rvalue); - process_expr(exp->lvalue); - - if (exp->kind() == node::expr_assign_equal) - { - switch (exp->rvalue.kind()) - { - case node::expr_bitwise_or: - if (exp->lvalue == exp->rvalue.as_bitwise_or->lvalue) - exp = make_expr_assign_bitwise_or(exp->loc(), std::move(exp->lvalue), std::move(exp->rvalue.as_bitwise_or->rvalue)); - break; - case node::expr_bitwise_and: - if (exp->lvalue == exp->rvalue.as_bitwise_and->lvalue) - exp = make_expr_assign_bitwise_and(exp->loc(), std::move(exp->lvalue), std::move(exp->rvalue.as_bitwise_and->rvalue)); - break; - case node::expr_bitwise_exor: - if (exp->lvalue == exp->rvalue.as_bitwise_exor->lvalue) - exp = make_expr_assign_bitwise_exor(exp->loc(), std::move(exp->lvalue), std::move(exp->rvalue.as_bitwise_exor->rvalue)); - break; - case node::expr_shift_left: - if (exp->lvalue == exp->rvalue.as_shift_left->lvalue) - exp = make_expr_assign_shift_left(exp->loc(), std::move(exp->lvalue), std::move(exp->rvalue.as_shift_left->rvalue)); - break; - case node::expr_shift_right: - if (exp->lvalue == exp->rvalue.as_shift_right->lvalue) - exp = make_expr_assign_shift_right(exp->loc(), std::move(exp->lvalue), std::move(exp->rvalue.as_shift_right->rvalue)); - break; - case node::expr_add: - if (exp->lvalue == exp->rvalue.as_add->lvalue) - exp = make_expr_assign_add(exp->loc(), std::move(exp->lvalue), std::move(exp->rvalue.as_add->rvalue)); - break; - case node::expr_sub: - if (exp->lvalue == exp->rvalue.as_sub->lvalue) - exp = make_expr_assign_sub(exp->loc(), std::move(exp->lvalue), std::move(exp->rvalue.as_sub->rvalue)); - break; - case node::expr_mul: - if (exp->lvalue == exp->rvalue.as_mul->lvalue) - exp = make_expr_assign_mul(exp->loc(), std::move(exp->lvalue), std::move(exp->rvalue.as_mul->rvalue)); - break; - case node::expr_div: - if (exp->lvalue == exp->rvalue.as_div->lvalue) - exp = make_expr_assign_div(exp->loc(), std::move(exp->lvalue), std::move(exp->rvalue.as_div->rvalue)); - break; - case node::expr_mod: - if (exp->lvalue == exp->rvalue.as_mod->lvalue) - exp = make_expr_assign_mod(exp->loc(), std::move(exp->lvalue), std::move(exp->rvalue.as_mod->rvalue)); - break; - default: - break; - } - } -} - auto decompiler::process_expr_increment(expr_increment& exp) -> void { process_expr(exp.lvalue); @@ -2509,6 +2384,61 @@ auto decompiler::process_expr_decrement(expr_decrement& exp) -> void process_expr(exp.lvalue); } +auto decompiler::process_expr_assign(expr_assign::ptr& exp) -> void +{ + process_expr(exp->rvalue); + process_expr(exp->lvalue); + + if (exp->oper != expr_assign::op::eq) + return; + + if (exp->rvalue->kind() != node::expr_binary) + return; + + auto& rval = exp->rvalue->as(); + + if (exp->lvalue != rval.lvalue) + return; + + switch (rval.oper) + { + case expr_binary::op::add: + exp->oper = expr_assign::op::add; + break; + case expr_binary::op::sub: + exp->oper = expr_assign::op::sub; + break; + case expr_binary::op::mul: + exp->oper = expr_assign::op::mul; + break; + case expr_binary::op::div: + exp->oper = expr_assign::op::div; + break; + case expr_binary::op::mod: + exp->oper = expr_assign::op::mod; + break; + case expr_binary::op::shl: + exp->oper = expr_assign::op::shl; + break; + case expr_binary::op::shr: + exp->oper = expr_assign::op::shr; + break; + case expr_binary::op::bwor: + exp->oper = expr_assign::op::bwor; + break; + case expr_binary::op::bwand: + exp->oper = expr_assign::op::bwand; + break; + case expr_binary::op::bwexor: + exp->oper = expr_assign::op::bwexor; + break; + default: + return; + } + + exp->rvalue = std::move(rval.rvalue); +} + auto decompiler::process_expr_ternary(expr_ternary& exp) -> void { process_expr(exp.test); @@ -2521,54 +2451,28 @@ auto decompiler::process_expr_binary(expr_binary& exp) -> void process_expr(exp.lvalue); process_expr(exp.rvalue); - auto prec = exp.lvalue.as_node->precedence(); + auto prec = exp.lvalue->precedence(); if (prec && prec < exp.precedence()) { - exp.lvalue = expr{ make_expr_paren(exp.loc(), std::move(exp.lvalue)) }; + exp.lvalue = expr_paren::make(exp.loc(), std::move(exp.lvalue)); } - prec = exp.rvalue.as_node->precedence(); + prec = exp.rvalue->precedence(); - if ((prec && prec < exp.precedence()) || (prec == exp.precedence() && exp.kind() == exp.rvalue.as_node->kind())) + if ((prec && prec < exp.precedence()) || (prec == exp.precedence() && exp.kind() == exp.rvalue->kind())) { - exp.rvalue = expr{ make_expr_paren(exp.loc(), std::move(exp.rvalue)) }; + exp.rvalue = expr_paren::make(exp.loc(), std::move(exp.rvalue)); } } -auto decompiler::process_expr_and(expr_and& exp) -> void -{ - process_expr(exp.lvalue); - process_expr(exp.rvalue); - - auto prec = exp.lvalue.as_node->precedence(); - - if (prec && prec < exp.precedence()) - { - exp.lvalue = expr{ make_expr_paren(exp.loc(), std::move(exp.lvalue)) }; - } - - prec = exp.rvalue.as_node->precedence(); - - if ((prec && prec < exp.precedence()) || (prec == exp.precedence() && exp.kind() == exp.rvalue.kind())) - { - exp.rvalue = expr{ make_expr_paren(exp.loc(), std::move(exp.rvalue)) }; - } -} - -auto decompiler::process_expr_or(expr_or& exp) -> void -{ - process_expr(exp.lvalue); - process_expr(exp.rvalue); -} - auto decompiler::process_expr_complement(expr_complement& exp) -> void { process_expr(exp.rvalue); - if (exp.rvalue.as_node->is_binary()) + if (exp.rvalue->is()) { - exp.rvalue = expr{ make_expr_paren(exp.loc(), std::move(exp.rvalue)) }; + exp.rvalue = expr_paren::make(exp.loc(), std::move(exp.rvalue)); } } @@ -2576,24 +2480,24 @@ auto decompiler::process_expr_not(expr_not& exp) -> void { process_expr(exp.rvalue); - if (exp.rvalue.as_node->is_binary()) + if (exp.rvalue->is()) { - exp.rvalue = expr{ make_expr_paren(exp.loc(), std::move(exp.rvalue)) }; + exp.rvalue = expr_paren::make(exp.loc(), std::move(exp.rvalue)); } } auto decompiler::process_expr_call(expr_call& exp) -> void { - switch (exp.value.kind()) + switch (exp.value->kind()) { case node::expr_member: - process_expr_call_member(*exp.value.as_member); + process_expr_call_member(exp.value->as()); break; case node::expr_pointer: - process_expr_call_pointer(*exp.value.as_pointer); + process_expr_call_pointer(exp.value->as()); break; case node::expr_function: - process_expr_call_function(*exp.value.as_function); + process_expr_call_function(exp.value->as()); break; default: break; @@ -2602,13 +2506,13 @@ auto decompiler::process_expr_call(expr_call& exp) -> void auto decompiler::process_expr_method(expr_method& exp) -> void { - switch (exp.value.kind()) + switch (exp.value->kind()) { case node::expr_pointer: - process_expr_method_pointer(*exp.value.as_pointer, exp.obj); + process_expr_method_pointer(exp.value->as(), exp.obj); break; case node::expr_function: - process_expr_method_function(*exp.value.as_function, exp.obj); + process_expr_method_function(exp.value->as(), exp.obj); break; default: break; @@ -2632,14 +2536,14 @@ auto decompiler::process_expr_call_function(expr_function& exp) -> void process_expr_arguments(*exp.args); } -auto decompiler::process_expr_method_pointer(expr_pointer& exp, expr& obj) -> void +auto decompiler::process_expr_method_pointer(expr_pointer& exp, expr::ptr& obj) -> void { process_expr_arguments(*exp.args); process_expr(obj); process_expr(exp.func); } -auto decompiler::process_expr_method_function(expr_function& exp, expr& obj) -> void +auto decompiler::process_expr_method_function(expr_function& exp, expr::ptr& obj) -> void { process_expr_arguments(*exp.args); process_expr(obj); @@ -2653,28 +2557,31 @@ auto decompiler::process_expr_parameters(expr_parameters& exp) -> void { auto& stmt = func_->body->block->list.at(0); - if (stmt != node::stmt_if || stmt.as_if->test != node::expr_not) + if (!stmt->is() || !stmt->as().test->is()) return; - auto& test = stmt.as_if->test.as_not->rvalue; + auto& test = stmt->as().test->as().rvalue; - if (test != node::expr_isdefined || test.as_isdefined->value != node::expr_identifier) + if (!test->is() || !test->as().value->is()) return; - if (stmt.as_if->body != node::stmt_assign || stmt.as_if->body.as_assign->value != node::expr_assign_equal) + if (!stmt->as().body->is() || !stmt->as().body->as().value->is()) return; - if (test.as_isdefined->value != stmt.as_if->body.as_assign->value.as_assign_equal->lvalue) + if (stmt->as().body->as().value->as().oper != expr_assign::op::eq) + return; + + if (test->as().value != stmt->as().body->as().value->as().lvalue) return; auto index = 0u; for (auto& entry : exp.list) { - if (entry == node::expr_identifier && entry.as_identifier->value == test.as_isdefined->value.as_identifier->value) + if (entry->is() && entry->as().value == test->as().value->as().value) { exp.list.erase(exp.list.begin() + index); - exp.list.insert(exp.list.begin() + index, std::move(stmt.as_if->body.as_assign->value)); + exp.list.insert(exp.list.begin() + index, std::move(stmt->as().body->as().value)); func_->body->block->list.erase(func_->body->block->list.begin()); break; } diff --git a/src/arc/disassembler.cpp b/src/arc/disassembler.cpp index b8d3d81c..b318a24b 100644 --- a/src/arc/disassembler.cpp +++ b/src/arc/disassembler.cpp @@ -4,9 +4,9 @@ // that can be found in the LICENSE file. #include "xsk/stdinc.hpp" +#include "xsk/utils/string.hpp" #include "xsk/arc/disassembler.hpp" #include "xsk/arc/context.hpp" -#include "xsk/utils/string.hpp" namespace xsk::arc { @@ -28,7 +28,7 @@ auto disassembler::disassemble(std::vector const& data) -> assembly::ptr auto disassembler::disassemble(u8 const* data, usize data_size) -> assembly::ptr { script_ = utils::reader{ data, static_cast(data_size), ctx_->endian() == endian::big }; - assembly_ = make_assembly(); + assembly_ = assembly::make(); import_refs_.clear(); string_refs_.clear(); anim_refs_.clear(); @@ -37,7 +37,7 @@ auto disassembler::disassemble(u8 const* data, usize data_size) -> assembly::ptr header_.magic = script_.read(); if (header_.magic != ctx_->magic()) - throw disasm_error("invalid binary script file!"); + throw disasm_error("invalid script file or unsupported game version"); header_.source_crc = script_.read(); header_.include_offset = script_.read(); @@ -45,16 +45,20 @@ auto disassembler::disassemble(u8 const* data, usize data_size) -> assembly::ptr header_.cseg_offset = script_.read(); header_.stringtablefixup_offset = script_.read(); - if (ctx_->props() & props::version2) + if (ctx_->props() & props::devstr) header_.devblock_stringtablefixup_offset = script_.read(); header_.exports_offset = script_.read(); header_.imports_offset = script_.read(); header_.fixup_offset = script_.read(); + + if (ctx_->props() & props::globals) + header_.globalvar_offset = script_.read(); + header_.profile_offset = script_.read(); header_.cseg_size = script_.read(); - if (ctx_->props() & props::version2) + if (ctx_->props() & props::size64) header_.name = script_.read(); else header_.name = script_.read(); @@ -63,9 +67,13 @@ auto disassembler::disassemble(u8 const* data, usize data_size) -> assembly::ptr header_.exports_count = script_.read(); header_.imports_count = script_.read(); header_.fixup_count = script_.read(); + + if (ctx_->props() & props::globals) + header_.globalvar_count = script_.read(); + header_.profile_count = script_.read(); - if (ctx_->props() & props::version2) + if (ctx_->props() & props::devstr) header_.devblock_stringtablefixup_count = script_.read(); header_.include_count = script_.read(); @@ -73,7 +81,7 @@ auto disassembler::disassemble(u8 const* data, usize data_size) -> assembly::ptr header_.flags = script_.read(); auto string_pool = std::map{}; - script_.pos((ctx_->props() & props::version2) ? 72 : 64); + script_.pos((ctx_->props() & props::headerxx) ? header_size_v3 : (ctx_->props() & props::header72) ? header_size_v2 : header_size_v1); while (script_.pos() < header_.include_offset) { @@ -93,10 +101,22 @@ auto disassembler::disassemble(u8 const* data, usize data_size) -> assembly::ptr for (auto i = 0u; i < header_.animtree_count; i++) { auto entry = std::make_shared(); - entry->name = string_pool.at(script_.read()); - auto ref_count = script_.read(); - auto anim_count = script_.read(); - script_.seek(2); + auto ref_count = 0u; + auto anim_count = 0u; + + if (ctx_->props() & props::size64) + { + entry->name = string_pool.at(script_.read()); + ref_count = script_.read(); + anim_count = script_.read(); + } + else + { + entry->name = string_pool.at(script_.read()); + ref_count = script_.read(); + anim_count = script_.read(); + script_.seek(2); + } for (auto j = 0u; j < ref_count; j++) { @@ -107,18 +127,20 @@ auto disassembler::disassemble(u8 const* data, usize data_size) -> assembly::ptr for (auto j = 0u; j < anim_count; j++) { - auto name = ctx_->hash_name(script_.read()); - - if (ctx_->props() & props::version2) - script_.seek(4); - - auto ref = script_.read(); - - if (ctx_->props() & props::version2) - script_.seek(4); - - entry->anims.push_back({ name, ref }); - anim_refs_.insert({ ref, entry }); + if (ctx_->props() & props::size64) + { + auto name = string_pool.at(static_cast(script_.read())); + auto ref = static_cast(script_.read()); + entry->anims.push_back({ name, ref }); + anim_refs_.insert({ ref, entry }); + } + else + { + auto name = string_pool.at(script_.read()); + auto ref = script_.read(); + entry->anims.push_back({ name, ref }); + anim_refs_.insert({ ref, entry }); + } } } @@ -127,11 +149,11 @@ auto disassembler::disassemble(u8 const* data, usize data_size) -> assembly::ptr for (auto i = 0u; i < header_.stringtablefixup_count; i++) { auto entry = std::make_shared(); - entry->name = string_pool.at((ctx_->props() & props::version2) ? script_.read() : script_.read()); + entry->name = string_pool.at((ctx_->props() & props::size64) ? script_.read() : script_.read()); auto count = script_.read(); entry->type = script_.read(); - if (ctx_->props() & props::version2) + if (ctx_->props() & props::size64) script_.seek(2); for (auto j = 0u; j < count; j++) @@ -141,14 +163,14 @@ auto disassembler::disassemble(u8 const* data, usize data_size) -> assembly::ptr } } - if (ctx_->props() & props::version2) + if (ctx_->props() & props::devstr) { script_.pos(header_.devblock_stringtablefixup_offset); for (auto i = 0u; i < header_.devblock_stringtablefixup_count; i++) { auto entry = std::make_shared(); - entry->name = "DEVSTR"; + entry->name = "__devstr__"; script_.seek(4); auto count = script_.read(); entry->type = script_.read(); @@ -162,13 +184,29 @@ auto disassembler::disassemble(u8 const* data, usize data_size) -> assembly::ptr } } + if (ctx_->props() & props::globals) + { + script_.pos(header_.globalvar_offset); + + for (auto i = 0u; i < header_.globalvar_count; i++) + { + auto name = ctx_->hash_name(script_.read()); + auto refs = script_.read(); + + for (auto j = 0u; j < refs; j++) + { + // todo t8 vars + } + } + } + script_.pos(header_.imports_offset); for (auto i = 0u; i < header_.imports_count; i++) { auto entry = std::make_shared(); - if (ctx_->props() & props::version2) + if (ctx_->props() & props::hashids) { entry->name = ctx_->hash_name(script_.read()); entry->space = ctx_->hash_name(script_.read()); @@ -198,7 +236,7 @@ auto disassembler::disassemble(u8 const* data, usize data_size) -> assembly::ptr entry->checksum = script_.read(); entry->offset = script_.read(); - if (ctx_->props() & props::version2) + if (ctx_->props() & props::hashids) { entry->name = ctx_->hash_name(script_.read()); entry->space = ctx_->hash_name(script_.read()); @@ -212,7 +250,7 @@ auto disassembler::disassemble(u8 const* data, usize data_size) -> assembly::ptr entry->params = script_.read(); entry->flags = script_.read(); - if (ctx_->props() & props::version2) + if (ctx_->props() & props::hashids) script_.seek(2); exports_.push_back(entry); @@ -226,15 +264,37 @@ auto disassembler::disassemble(u8 const* data, usize data_size) -> assembly::ptr { entry->size = (exports_[i + 1]->offset - entry->offset); - auto pad_size = (ctx_->props() & props::version2) ? 8 : 4; + auto pad_size = (ctx_->props() & props::size64) ? 8 : 4; auto end_pos = entry->offset + entry->size - pad_size; script_.pos(end_pos); - if ((ctx_->props() & props::version2) && script_.read() == 0) - entry->size -= pad_size; + if ((ctx_->props() & props::size64) && script_.read() == 0) + { + entry->size -= pad_size; + + script_.pos(end_pos - 2); + script_.align(2); + for (auto j = 0; j < 4; j++) + { + auto op = ctx_->opcode_enum(script_.read()); + if (op == opcode::OP_End || op == opcode::OP_Return) break; + script_.seek_neg(4); + } + + entry->size -= end_pos - script_.pos(); + } else if (script_.read() == 0) + { entry->size -= pad_size; + + for (auto j = 1; j < 4; j++) + { + script_.pos(end_pos - j); + if (script_.read() <= 0x01) break; + entry->size--; + } + } } else { @@ -243,7 +303,7 @@ auto disassembler::disassemble(u8 const* data, usize data_size) -> assembly::ptr script_.pos(entry->offset); - func_ = make_function(); + func_ = function::make(); func_->index = entry->offset; func_->size = entry->size; func_->params = entry->params; @@ -265,17 +325,17 @@ auto disassembler::disassemble_function(function& func) -> void while (size > 0) { - auto inst = make_instruction(); + auto inst = instruction::make(); inst->index = script_.pos(); - if (ctx_->props() & props::version2) + if (ctx_->props() & props::size64) { auto index = script_.read(); - if (size < 8 && (index >= 0x2000 || ctx_->opcode_enum(index) == opcode::OP_Invalid)) + if (size < 8 && (index >= 0x4000 || ctx_->opcode_enum(index) == opcode::OP_Invalid)) break; - if ((index & 0x2000) == 0) + if ((index & 0x4000) == 0) inst->opcode = ctx_->opcode_enum(index); else throw disasm_error(utils::string::va("invalid opcode index 0x%X at pos '%04X'!", index, inst->index)); @@ -289,12 +349,12 @@ auto disassembler::disassemble_function(function& func) -> void inst->opcode = ctx_->opcode_enum(index); } - + inst->size = ctx_->opcode_size(inst->opcode); disassemble_instruction(*inst); - if (ctx_->props() & props::version2) + if (ctx_->props() & props::size64) inst->size += script_.align(2); size -= inst->size; @@ -302,20 +362,23 @@ auto disassembler::disassemble_function(function& func) -> void func.instructions.push_back(std::move(inst)); } - for (auto i = func.instructions.size() - 1; i >= 1; i--) + // remove padding garbage ops + auto last_idx = 0; + for (auto i = 1; i <= 4; i++) { - auto& inst = func.instructions.at(i); - auto& last = func.instructions.at(i-1); + if (func.instructions.size() - i <= 0) + break; + + auto& inst = func.instructions.at(func.instructions.size() - i); + + if (inst->opcode == opcode::OP_End || inst->opcode == opcode::OP_Return) + last_idx = i; if (func.labels.contains(inst->index)) break; - - if ((inst->opcode == opcode::OP_End || inst->opcode == opcode::OP_Return) - && (last->opcode != opcode::OP_End && last->opcode != opcode::OP_Return)) - break; - - func.instructions.pop_back(); } + + while (last_idx-- > 1) func.instructions.pop_back(); } auto disassembler::disassemble_instruction(instruction& inst) -> void @@ -456,7 +519,7 @@ auto disassembler::disassemble_instruction(instruction& inst) -> void break; case opcode::OP_GetHash: inst.size += script_.align(4); - inst.data.push_back(ctx_->dvar_name(script_.read())); + inst.data.push_back(ctx_->hash_name(script_.read())); break; case opcode::OP_ScriptFunctionCallClass: case opcode::OP_ScriptThreadCallClass: @@ -526,9 +589,9 @@ auto disassembler::disassemble_instruction(instruction& inst) -> void auto disassembler::disassemble_name(instruction& inst) -> void { - inst.size += script_.align((ctx_->props() & props::version2) ? 4 : 2); + inst.size += script_.align((ctx_->props() & props::hashids) ? 4 : 2); - if (ctx_->props() & props::version2) + if (ctx_->props() & props::hashids) { inst.data.push_back(ctx_->hash_name(script_.read())); } @@ -553,11 +616,11 @@ auto disassembler::disassemble_params(instruction& inst) -> void for (auto i = 0u; i < count; i++) { - if (ctx_->props() & props::version2) + if (ctx_->props() & props::hashids) { inst.size += script_.align(4) + 5; inst.data.push_back(ctx_->hash_name(script_.read())); - script_.seek(1); + inst.data.push_back(fmt::format("{}", script_.read())); } else { @@ -569,8 +632,8 @@ auto disassembler::disassemble_params(instruction& inst) -> void auto disassembler::disassemble_import(instruction& inst) -> void { - inst.size += script_.align((ctx_->props() & props::version2) ? 8 : 4); - script_.seek((ctx_->props() & props::version2) ? 8 : 4); + inst.size += script_.align((ctx_->props() & props::size64) ? 8 : 4); + script_.seek((ctx_->props() & props::size64) ? 8 : 4); auto const itr = import_refs_.find(inst.index); @@ -586,14 +649,14 @@ auto disassembler::disassemble_import(instruction& inst) -> void auto disassembler::disassemble_string(instruction& inst) -> void { - inst.size += script_.align((ctx_->props() & props::version2) ? 4 : 2); + inst.size += script_.align((ctx_->props() & props::size64) ? 4 : 2); auto const itr = string_refs_.find(script_.pos()); if (itr != string_refs_.end()) { inst.data.push_back(itr->second->name); - script_.seek((ctx_->props() & props::version2) ? 4 : 2); + script_.seek((ctx_->props() & props::size64) ? 4 : 2); return; } @@ -612,7 +675,7 @@ auto disassembler::disassemble_animtree(instruction& inst) -> void auto disassembler::disassemble_animation(instruction& inst) -> void { - inst.size += script_.align((ctx_->props() & props::version2) ? 8 : 4); + inst.size += script_.align((ctx_->props() & props::size64) ? 8 : 4); auto const ref = script_.pos(); auto const itr = anim_refs_.find(ref); @@ -626,7 +689,7 @@ auto disassembler::disassemble_animation(instruction& inst) -> void if (anim.ref == ref) { inst.data.push_back(anim.name); - script_.seek((ctx_->props() & props::version2) ? 8 : 4); + script_.seek((ctx_->props() & props::size64) ? 8 : 4); return; } } @@ -641,7 +704,7 @@ auto disassembler::disassemble_jump(instruction& inst) -> void auto addr = u32{}; - if (ctx_->props() & props::version2) + if (ctx_->props() & props::size64) addr = ((script_.read() + 1) & ~(1)) + script_.pos(); else addr = script_.read() + script_.pos(); @@ -695,17 +758,16 @@ auto disassembler::disassemble_end_switch(instruction& inst) -> void for (auto i = 0u; i < count; i++) { - if (ctx_->props() & props::version2) + if (ctx_->props() & props::size64) { const auto value = script_.read(); + const auto str = string_refs_.find(script_.pos() - 4); - const auto itr = string_refs_.find(script_.pos() - 4); - - if (itr != string_refs_.end()) + if (str != string_refs_.end()) { type = switch_type::string; inst.data.push_back("case"); - inst.data.push_back(itr->second->name); + inst.data.push_back(str->second->name); } else if (value == 0 && i == count - 1) { diff --git a/src/arc/engine/t6_dvar.cpp b/src/arc/engine/t6_hash.cpp similarity index 99% rename from src/arc/engine/t6_dvar.cpp rename to src/arc/engine/t6_hash.cpp index 4883030f..41c26926 100644 --- a/src/arc/engine/t6_dvar.cpp +++ b/src/arc/engine/t6_hash.cpp @@ -8,7 +8,7 @@ namespace xsk::arc::t6 { -extern std::array, dvar_count> const dvar_list +extern std::array, hash_count> const hash_list {{ { 0x146F2C73, "ClickToContinue" }, { 0x209FFF3B, "FriendXuidToJoinOnBoot" }, diff --git a/src/arc/engine/t6.cpp b/src/arc/engine/t6_pc.cpp similarity index 67% rename from src/arc/engine/t6.cpp rename to src/arc/engine/t6_pc.cpp index 4bbd6485..bc0b5c74 100644 --- a/src/arc/engine/t6.cpp +++ b/src/arc/engine/t6_pc.cpp @@ -3,19 +3,24 @@ // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "xsk/arc/engine/t6.hpp" +#include "xsk/arc/engine/t6_pc.hpp" namespace xsk::arc::t6 { extern std::array, code_count> const code_list; -extern std::array, dvar_count> const dvar_list; +extern std::array, hash_count> const hash_list; + +} // namespace xsk::arc::t6 + +namespace xsk::arc::t6::pc +{ context::context() : arc::context(props::none, engine::t6, endian::little, system::pc, header_magic) { code_map_.reserve(code_list.size()); code_map_rev_.reserve(code_list.size()); - dvar_map_.reserve(dvar_list.size()); + hash_map_.reserve(hash_list.size()); for (auto const& entry : code_list) { @@ -23,10 +28,10 @@ context::context() : arc::context(props::none, engine::t6, endian::little, syste code_map_rev_.insert({ entry.second, entry.first }); } - for (auto const& entry : dvar_list) + for (auto const& entry : hash_list) { - dvar_map_.insert({ entry.first, entry.second }); + hash_map_.insert({ entry.first, entry.second }); } } -} // namespace xsk::arc::t6 +} // namespace xsk::arc::t6::pc diff --git a/src/arc/engine/t6_ps3.cpp b/src/arc/engine/t6_ps3.cpp new file mode 100644 index 00000000..a764e0c6 --- /dev/null +++ b/src/arc/engine/t6_ps3.cpp @@ -0,0 +1,37 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "xsk/arc/engine/t6_ps3.hpp" + +namespace xsk::arc::t6 +{ + +extern std::array, code_count> const code_list; +extern std::array, hash_count> const hash_list; + +} // namespace xsk::arc::t6 + +namespace xsk::arc::t6::ps3 +{ + +context::context() : arc::context(props::none, engine::t6, endian::big, system::ps3, header_magic) +{ + code_map_.reserve(code_list.size()); + code_map_rev_.reserve(code_list.size()); + hash_map_.reserve(hash_list.size()); + + for (auto const& entry : code_list) + { + code_map_.insert({ entry.first, entry.second }); + code_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : hash_list) + { + hash_map_.insert({ entry.first, entry.second }); + } +} + +} // namespace xsk::arc::t6::ps3 diff --git a/src/arc/engine/t6_wiiu.cpp b/src/arc/engine/t6_wiiu.cpp new file mode 100644 index 00000000..128dfe60 --- /dev/null +++ b/src/arc/engine/t6_wiiu.cpp @@ -0,0 +1,37 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "xsk/arc/engine/t6_wiiu.hpp" + +namespace xsk::arc::t6 +{ + +extern std::array, code_count> const code_list; +extern std::array, hash_count> const hash_list; + +} // namespace xsk::arc::t6 + +namespace xsk::arc::t6::wiiu +{ + +context::context() : arc::context(props::none, engine::t6, endian::big, system::wiiu, header_magic) +{ + code_map_.reserve(code_list.size()); + code_map_rev_.reserve(code_list.size()); + hash_map_.reserve(hash_list.size()); + + for (auto const& entry : code_list) + { + code_map_.insert({ entry.first, entry.second }); + code_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : hash_list) + { + hash_map_.insert({ entry.first, entry.second }); + } +} + +} // namespace xsk::arc::t6::wiiu diff --git a/src/arc/engine/t6_xb2.cpp b/src/arc/engine/t6_xb2.cpp new file mode 100644 index 00000000..77cad788 --- /dev/null +++ b/src/arc/engine/t6_xb2.cpp @@ -0,0 +1,37 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "xsk/arc/engine/t6_xb2.hpp" + +namespace xsk::arc::t6 +{ + +extern std::array, code_count> const code_list; +extern std::array, hash_count> const hash_list; + +} // namespace xsk::arc::t6 + +namespace xsk::arc::t6::xb2 +{ + +context::context() : arc::context(props::none, engine::t6, endian::big, system::xb2, header_magic) +{ + code_map_.reserve(code_list.size()); + code_map_rev_.reserve(code_list.size()); + hash_map_.reserve(hash_list.size()); + + for (auto const& entry : code_list) + { + code_map_.insert({ entry.first, entry.second }); + code_map_rev_.insert({ entry.second, entry.first }); + } + + for (auto const& entry : hash_list) + { + hash_map_.insert({ entry.first, entry.second }); + } +} + +} // namespace xsk::arc::t6::xb2 diff --git a/src/arc/engine/t7.cpp b/src/arc/engine/t7.cpp index 4797f441..3450441f 100644 --- a/src/arc/engine/t7.cpp +++ b/src/arc/engine/t7.cpp @@ -9,15 +9,13 @@ namespace xsk::arc::t7 { extern std::array, code_count> const code_list; -extern std::array, dvar_count> const dvar_list; extern std::array, hash_count> const hash_list; -context::context() : arc::context(props::version2, engine::t7, endian::little, system::pc, header_magic) +context::context() : arc::context(props::header72 | props::size64 | props::hashids | props::devstr | props::spaces | props::refvarg | props::foreach, engine::t7, endian::little, system::pc, header_magic) { code_map_.reserve(code_list.size()); code_map_rev_.reserve(code_list.size()); - dvar_map_.reserve(dvar_list.size()); - hash_map_.reserve(dvar_list.size()); + hash_map_.reserve(hash_list.size()); for (auto const& entry : code_list) { @@ -25,11 +23,6 @@ context::context() : arc::context(props::version2, engine::t7, endian::little, s code_map_rev_.insert({ entry.second, entry.first }); } - for (auto const& entry : dvar_list) - { - dvar_map_.insert({ entry.first, entry.second }); - } - for (auto const& entry : hash_list) { hash_map_.insert({ entry.first, entry.second }); diff --git a/src/arc/engine/t7_code.cpp b/src/arc/engine/t7_code.cpp index 43494fff..e5e1dbf9 100644 --- a/src/arc/engine/t7_code.cpp +++ b/src/arc/engine/t7_code.cpp @@ -8202,6 +8202,8199 @@ extern std::array, code_count> const code_list { 0x1FFD, opcode::OP_LevelEvalFieldVariable }, { 0x1FFE, opcode::OP_Bit_And }, { 0x1FFF, opcode::OP_Equal }, + + { 0x2000, opcode::OP_Invalid }, + { 0x2001, opcode::OP_Invalid }, + { 0x2002, opcode::OP_Invalid }, + { 0x2003, opcode::OP_Invalid }, + { 0x2004, opcode::OP_Invalid }, + { 0x2005, opcode::OP_Invalid }, + { 0x2006, opcode::OP_Invalid }, + { 0x2007, opcode::OP_Invalid }, + { 0x2008, opcode::OP_EvalLocalVariableCachedDebug }, + { 0x2009, opcode::OP_EvalLocalVariableRefCachedDebug }, + { 0x200A, opcode::OP_Invalid }, + { 0x200B, opcode::OP_Invalid }, + { 0x200C, opcode::OP_ClearParams }, + { 0x200D, opcode::OP_CheckClearParams }, + { 0x200E, opcode::OP_PreScriptCall }, + { 0x200F, opcode::OP_CallBuiltin }, + { 0x2010, opcode::OP_End }, + { 0x2011, opcode::OP_Invalid }, + { 0x2012, opcode::OP_New }, + { 0x2013, opcode::OP_JumpOnTrue }, + { 0x2014, opcode::OP_Invalid }, + { 0x2015, opcode::OP_Invalid }, + { 0x2016, opcode::OP_Invalid }, + { 0x2017, opcode::OP_Plus }, + { 0x2018, opcode::OP_Bit_Xor }, + { 0x2019, opcode::OP_Invalid }, + { 0x201A, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x201B, opcode::OP_Invalid }, + { 0x201C, opcode::OP_Jump }, + { 0x201D, opcode::OP_JumpOnFalseExpr }, + { 0x201E, opcode::OP_Bit_Or }, + { 0x201F, opcode::OP_Invalid }, + { 0x2020, opcode::OP_GreaterThan }, + { 0x2021, opcode::OP_Bit_And }, + { 0x2022, opcode::OP_ScriptThreadCallPointer }, + { 0x2023, opcode::OP_Invalid }, + { 0x2024, opcode::OP_Invalid }, + { 0x2025, opcode::OP_Wait }, + { 0x2026, opcode::OP_Invalid }, + { 0x2027, opcode::OP_GetWorldObject }, + { 0x2028, opcode::OP_Invalid }, + { 0x2029, opcode::OP_EndSwitch }, + { 0x202A, opcode::OP_GetAnim }, + { 0x202B, opcode::OP_Minus }, + { 0x202C, opcode::OP_CastFieldObject }, + { 0x202D, opcode::OP_ShiftLeft }, + { 0x202E, opcode::OP_Invalid }, + { 0x202F, opcode::OP_BoolComplement }, + { 0x2030, opcode::OP_WaitTillFrameEnd }, + { 0x2031, opcode::OP_GetWorld }, + { 0x2032, opcode::OP_Invalid }, + { 0x2033, opcode::OP_BoolNot }, + { 0x2034, opcode::OP_SizeOf }, + { 0x2035, opcode::OP_Wait }, + { 0x2036, opcode::OP_LevelEvalFieldVariable }, + { 0x2037, opcode::OP_ProfileStop }, + { 0x2038, opcode::OP_LessThan }, + { 0x2039, opcode::OP_Invalid }, + { 0x203A, opcode::OP_SuperNotEqual }, + { 0x203B, opcode::OP_Invalid }, + { 0x203C, opcode::OP_Multiply }, + { 0x203D, opcode::OP_BoolNot }, + { 0x203E, opcode::OP_Invalid }, + { 0x203F, opcode::OP_Wait }, + { 0x2040, opcode::OP_Invalid }, + { 0x2041, opcode::OP_NotEqual }, + { 0x2042, opcode::OP_Invalid }, + { 0x2043, opcode::OP_GetVector }, + { 0x2044, opcode::OP_Invalid }, + { 0x2045, opcode::OP_ClearFieldVariable }, + { 0x2046, opcode::OP_New }, + { 0x2047, opcode::OP_Invalid }, + { 0x2048, opcode::OP_SafeDecTop }, + { 0x2049, opcode::OP_JumpOnFalse }, + { 0x204A, opcode::OP_Invalid }, + { 0x204B, opcode::OP_ShiftLeft }, + { 0x204C, opcode::OP_Invalid }, + { 0x204D, opcode::OP_Invalid }, + { 0x204E, opcode::OP_ClearArray }, + { 0x204F, opcode::OP_Invalid }, + { 0x2050, opcode::OP_Invalid }, + { 0x2051, opcode::OP_FirstArrayKey }, + { 0x2052, opcode::OP_Invalid }, + { 0x2053, opcode::OP_EndOn }, + { 0x2054, opcode::OP_EvalFieldVariableRef }, + { 0x2055, opcode::OP_Equal }, + { 0x2056, opcode::OP_Invalid }, + { 0x2057, opcode::OP_Invalid }, + { 0x2058, opcode::OP_Invalid }, + { 0x2059, opcode::OP_GetAnim }, + { 0x205A, opcode::OP_Equal }, + { 0x205B, opcode::OP_Bit_And }, + { 0x205C, opcode::OP_ScriptMethodCall }, + { 0x205D, opcode::OP_GetFunction }, + { 0x205E, opcode::OP_EndSwitch }, + { 0x205F, opcode::OP_SafeSetVariableFieldCached }, + { 0x2060, opcode::OP_Invalid }, + { 0x2061, opcode::OP_Invalid }, + { 0x2062, opcode::OP_Bit_Xor }, + { 0x2063, opcode::OP_GreaterThan }, + { 0x2064, opcode::OP_Invalid }, + { 0x2065, opcode::OP_Invalid }, + { 0x2066, opcode::OP_Invalid }, + { 0x2067, opcode::OP_Modulus }, + { 0x2068, opcode::OP_ScriptThreadCallPointer }, + { 0x2069, opcode::OP_Invalid }, + { 0x206A, opcode::OP_Switch }, + { 0x206B, opcode::OP_EvalArray }, + { 0x206C, opcode::OP_GetSelfObject }, + { 0x206D, opcode::OP_SetVariableField }, + { 0x206E, opcode::OP_ClearFieldVariable }, + { 0x206F, opcode::OP_ScriptMethodCall }, + { 0x2070, opcode::OP_ProfileStart }, + { 0x2071, opcode::OP_EndSwitch }, + { 0x2072, opcode::OP_Invalid }, + { 0x2073, opcode::OP_SuperNotEqual }, + { 0x2074, opcode::OP_Invalid }, + { 0x2075, opcode::OP_ScriptMethodCall }, + { 0x2076, opcode::OP_Invalid }, + { 0x2077, opcode::OP_Invalid }, + { 0x2078, opcode::OP_ProfileStop }, + { 0x2079, opcode::OP_DecTop }, + { 0x207A, opcode::OP_GetHash }, + { 0x207B, opcode::OP_EvalLocalVariableRefCached }, + { 0x207C, opcode::OP_GetAnim }, + { 0x207D, opcode::OP_Plus }, + { 0x207E, opcode::OP_GetWorldObject }, + { 0x207F, opcode::OP_Invalid }, + { 0x2080, opcode::OP_FirstArrayKey }, + { 0x2081, opcode::OP_Dec }, + { 0x2082, opcode::OP_Invalid }, + { 0x2083, opcode::OP_Invalid }, + { 0x2084, opcode::OP_Invalid }, + { 0x2085, opcode::OP_Invalid }, + { 0x2086, opcode::OP_Return }, + { 0x2087, opcode::OP_GetAnimObject }, + { 0x2088, opcode::OP_WaitTillMatch }, + { 0x2089, opcode::OP_Modulus }, + { 0x208A, opcode::OP_Invalid }, + { 0x208B, opcode::OP_ProfileStart }, + { 0x208C, opcode::OP_GetIString }, + { 0x208D, opcode::OP_ScriptFunctionCallPointer }, + { 0x208E, opcode::OP_EndOn }, + { 0x208F, opcode::OP_JumpOnFalse }, + { 0x2090, opcode::OP_GetGameRef }, + { 0x2091, opcode::OP_GetFunction }, + { 0x2092, opcode::OP_Invalid }, + { 0x2093, opcode::OP_ClearFieldVariable }, + { 0x2094, opcode::OP_Invalid }, + { 0x2095, opcode::OP_GetClassesObject }, + { 0x2096, opcode::OP_GetSelfObject }, + { 0x2097, opcode::OP_Invalid }, + { 0x2098, opcode::OP_GetByte }, + { 0x2099, opcode::OP_Invalid }, + { 0x209A, opcode::OP_WaitTillFrameEnd }, + { 0x209B, opcode::OP_Invalid }, + { 0x209C, opcode::OP_Minus }, + { 0x209D, opcode::OP_EndOn }, + { 0x209E, opcode::OP_SafeCreateLocalVariables }, + { 0x209F, opcode::OP_LessThan }, + { 0x20A0, opcode::OP_JumpOnTrueExpr }, + { 0x20A1, opcode::OP_GetLevelObject }, + { 0x20A2, opcode::OP_GreaterThan }, + { 0x20A3, opcode::OP_BoolComplement }, + { 0x20A4, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x20A5, opcode::OP_Invalid }, + { 0x20A6, opcode::OP_Invalid }, + { 0x20A7, opcode::OP_Invalid }, + { 0x20A8, opcode::OP_Invalid }, + { 0x20A9, opcode::OP_Invalid }, + { 0x20AA, opcode::OP_Invalid }, + { 0x20AB, opcode::OP_Invalid }, + { 0x20AC, opcode::OP_GetNegUnsignedShort }, + { 0x20AD, opcode::OP_JumpOnFalse }, + { 0x20AE, opcode::OP_Vector }, + { 0x20AF, opcode::OP_LevelEvalFieldVariableRef }, + { 0x20B0, opcode::OP_GetAnim }, + { 0x20B1, opcode::OP_RealWait }, + { 0x20B2, opcode::OP_WaitTillFrameEnd }, + { 0x20B3, opcode::OP_JumpOnFalseExpr }, + { 0x20B4, opcode::OP_Invalid }, + { 0x20B5, opcode::OP_ClearArray }, + { 0x20B6, opcode::OP_EmptyArray }, + { 0x20B7, opcode::OP_Invalid }, + { 0x20B8, opcode::OP_GetVector }, + { 0x20B9, opcode::OP_New }, + { 0x20BA, opcode::OP_ClearArray }, + { 0x20BB, opcode::OP_Invalid }, + { 0x20BC, opcode::OP_EvalLocalVariableCached }, + { 0x20BD, opcode::OP_Invalid }, + { 0x20BE, opcode::OP_EvalFieldVariableRef }, + { 0x20BF, opcode::OP_Invalid }, + { 0x20C0, opcode::OP_GetFloat }, + { 0x20C1, opcode::OP_EvalFieldVariable }, + { 0x20C2, opcode::OP_GetGame }, + { 0x20C3, opcode::OP_Invalid }, + { 0x20C4, opcode::OP_GetAnim }, + { 0x20C5, opcode::OP_FirstArrayKey }, + { 0x20C6, opcode::OP_JumpOnFalse }, + { 0x20C7, opcode::OP_Invalid }, + { 0x20C8, opcode::OP_Invalid }, + { 0x20C9, opcode::OP_GetAnimation }, + { 0x20CA, opcode::OP_Invalid }, + { 0x20CB, opcode::OP_Return }, + { 0x20CC, opcode::OP_ShiftLeft }, + { 0x20CD, opcode::OP_Invalid }, + { 0x20CE, opcode::OP_CastFieldObject }, + { 0x20CF, opcode::OP_Invalid }, + { 0x20D0, opcode::OP_LessThanOrEqualTo }, + { 0x20D1, opcode::OP_Invalid }, + { 0x20D2, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x20D3, opcode::OP_DevblockBegin }, + { 0x20D4, opcode::OP_Invalid }, + { 0x20D5, opcode::OP_Invalid }, + { 0x20D6, opcode::OP_GetZero }, + { 0x20D7, opcode::OP_EmptyArray }, + { 0x20D8, opcode::OP_EvalLocalVariableCached }, + { 0x20D9, opcode::OP_Invalid }, + { 0x20DA, opcode::OP_ScriptMethodCallPointer }, + { 0x20DB, opcode::OP_Invalid }, + { 0x20DC, opcode::OP_Invalid }, + { 0x20DD, opcode::OP_EvalArray }, + { 0x20DE, opcode::OP_LevelEvalFieldVariable }, + { 0x20DF, opcode::OP_GetInteger }, + { 0x20E0, opcode::OP_GetInteger }, + { 0x20E1, opcode::OP_EndOn }, + { 0x20E2, opcode::OP_Invalid }, + { 0x20E3, opcode::OP_ScriptMethodThreadCall }, + { 0x20E4, opcode::OP_Invalid }, + { 0x20E5, opcode::OP_GetUintptr }, + { 0x20E6, opcode::OP_Invalid }, + { 0x20E7, opcode::OP_Invalid }, + { 0x20E8, opcode::OP_GetGame }, + { 0x20E9, opcode::OP_Minus }, + { 0x20EA, opcode::OP_Equal }, + { 0x20EB, opcode::OP_Invalid }, + { 0x20EC, opcode::OP_Invalid }, + { 0x20ED, opcode::OP_Invalid }, + { 0x20EE, opcode::OP_GetSelfObject }, + { 0x20EF, opcode::OP_NextArrayKey }, + { 0x20F0, opcode::OP_Invalid }, + { 0x20F1, opcode::OP_Invalid }, + { 0x20F2, opcode::OP_GetInteger }, + { 0x20F3, opcode::OP_GetInteger }, + { 0x20F4, opcode::OP_Invalid }, + { 0x20F5, opcode::OP_Invalid }, + { 0x20F6, opcode::OP_GetSelfObject }, + { 0x20F7, opcode::OP_EvalFieldVariable }, + { 0x20F8, opcode::OP_ShiftRight }, + { 0x20F9, opcode::OP_GetAnimObject }, + { 0x20FA, opcode::OP_GetClassesObject }, + { 0x20FB, opcode::OP_Invalid }, + { 0x20FC, opcode::OP_SafeDecTop }, + { 0x20FD, opcode::OP_EndOn }, + { 0x20FE, opcode::OP_Bit_Xor }, + { 0x20FF, opcode::OP_GetGame }, + { 0x2100, opcode::OP_Invalid }, + { 0x2101, opcode::OP_Invalid }, + { 0x2102, opcode::OP_Invalid }, + { 0x2103, opcode::OP_NextArrayKey }, + { 0x2104, opcode::OP_GetAnimation }, + { 0x2105, opcode::OP_ProfileStop }, + { 0x2106, opcode::OP_ProfileStop }, + { 0x2107, opcode::OP_Invalid }, + { 0x2108, opcode::OP_ClearArray }, + { 0x2109, opcode::OP_GetUnsignedShort }, + { 0x210A, opcode::OP_EvalLocalVariableRefCached }, + { 0x210B, opcode::OP_Invalid }, + { 0x210C, opcode::OP_Invalid }, + { 0x210D, opcode::OP_NotEqual }, + { 0x210E, opcode::OP_SizeOf }, + { 0x210F, opcode::OP_WaitTill }, + { 0x2110, opcode::OP_Invalid }, + { 0x2111, opcode::OP_Return }, + { 0x2112, opcode::OP_WaitTillMatch }, + { 0x2113, opcode::OP_Invalid }, + { 0x2114, opcode::OP_GetTime }, + { 0x2115, opcode::OP_Invalid }, + { 0x2116, opcode::OP_GetLevelObject }, + { 0x2117, opcode::OP_GetUndefined }, + { 0x2118, opcode::OP_LevelEvalFieldVariable }, + { 0x2119, opcode::OP_GreaterThanOrEqualTo }, + { 0x211A, opcode::OP_Invalid }, + { 0x211B, opcode::OP_Invalid }, + { 0x211C, opcode::OP_Minus }, + { 0x211D, opcode::OP_ClearArray }, + { 0x211E, opcode::OP_SuperNotEqual }, + { 0x211F, opcode::OP_Invalid }, + { 0x2120, opcode::OP_Invalid }, + { 0x2121, opcode::OP_GetAPIFunction }, + { 0x2122, opcode::OP_BoolComplement }, + { 0x2123, opcode::OP_GetHash }, + { 0x2124, opcode::OP_GetLevel }, + { 0x2125, opcode::OP_SelfEvalFieldVariableRef }, + { 0x2126, opcode::OP_GetWorldObject }, + { 0x2127, opcode::OP_Jump }, + { 0x2128, opcode::OP_WaitTill }, + { 0x2129, opcode::OP_Invalid }, + { 0x212A, opcode::OP_Invalid }, + { 0x212B, opcode::OP_Minus }, + { 0x212C, opcode::OP_ShiftRight }, + { 0x212D, opcode::OP_FirstArrayKey }, + { 0x212E, opcode::OP_Invalid }, + { 0x212F, opcode::OP_LessThan }, + { 0x2130, opcode::OP_SizeOf }, + { 0x2131, opcode::OP_Wait }, + { 0x2132, opcode::OP_Invalid }, + { 0x2133, opcode::OP_SelfEvalFieldVariableRef }, + { 0x2134, opcode::OP_Bit_And }, + { 0x2135, opcode::OP_Invalid }, + { 0x2136, opcode::OP_ClearFieldVariable }, + { 0x2137, opcode::OP_EvalFieldVariable }, + { 0x2138, opcode::OP_Invalid }, + { 0x2139, opcode::OP_GetClassesObject }, + { 0x213A, opcode::OP_BoolComplement }, + { 0x213B, opcode::OP_SafeCreateLocalVariables }, + { 0x213C, opcode::OP_Invalid }, + { 0x213D, opcode::OP_Invalid }, + { 0x213E, opcode::OP_Invalid }, + { 0x213F, opcode::OP_Multiply }, + { 0x2140, opcode::OP_GreaterThan }, + { 0x2141, opcode::OP_BoolNot }, + { 0x2142, opcode::OP_Invalid }, + { 0x2143, opcode::OP_Invalid }, + { 0x2144, opcode::OP_Invalid }, + { 0x2145, opcode::OP_Invalid }, + { 0x2146, opcode::OP_ScriptThreadCallPointer }, + { 0x2147, opcode::OP_Invalid }, + { 0x2148, opcode::OP_Invalid }, + { 0x2149, opcode::OP_GetLevelObject }, + { 0x214A, opcode::OP_GetFloat }, + { 0x214B, opcode::OP_Invalid }, + { 0x214C, opcode::OP_GetAnimation }, + { 0x214D, opcode::OP_Invalid }, + { 0x214E, opcode::OP_GetTime }, + { 0x214F, opcode::OP_CallBuiltinMethod }, + { 0x2150, opcode::OP_ScriptThreadCallClass }, + { 0x2151, opcode::OP_Invalid }, + { 0x2152, opcode::OP_WaitTillFrameEnd }, + { 0x2153, opcode::OP_GetClasses }, + { 0x2154, opcode::OP_GetTime }, + { 0x2155, opcode::OP_New }, + { 0x2156, opcode::OP_EvalLocalVariableCached }, + { 0x2157, opcode::OP_Dec }, + { 0x2158, opcode::OP_SelfEvalFieldVariable }, + { 0x2159, opcode::OP_EvalArrayRef }, + { 0x215A, opcode::OP_Invalid }, + { 0x215B, opcode::OP_CastFieldObject }, + { 0x215C, opcode::OP_BoolComplement }, + { 0x215D, opcode::OP_Divide }, + { 0x215E, opcode::OP_Bit_Xor }, + { 0x215F, opcode::OP_SelfEvalFieldVariable }, + { 0x2160, opcode::OP_NextArrayKey }, + { 0x2161, opcode::OP_Invalid }, + { 0x2162, opcode::OP_CallBuiltinMethod }, + { 0x2163, opcode::OP_Switch }, + { 0x2164, opcode::OP_SelfEvalFieldVariable }, + { 0x2165, opcode::OP_Invalid }, + { 0x2166, opcode::OP_EvalFieldVariable }, + { 0x2167, opcode::OP_Bit_Xor }, + { 0x2168, opcode::OP_CallBuiltinMethod }, + { 0x2169, opcode::OP_ShiftRight }, + { 0x216A, opcode::OP_ScriptMethodCallPointer }, + { 0x216B, opcode::OP_Invalid }, + { 0x216C, opcode::OP_Invalid }, + { 0x216D, opcode::OP_GetClassesObject }, + { 0x216E, opcode::OP_Wait }, + { 0x216F, opcode::OP_New }, + { 0x2170, opcode::OP_LessThanOrEqualTo }, + { 0x2171, opcode::OP_Invalid }, + { 0x2172, opcode::OP_LessThan }, + { 0x2173, opcode::OP_Divide }, + { 0x2174, opcode::OP_WaitTillFrameEnd }, + { 0x2175, opcode::OP_Invalid }, + { 0x2176, opcode::OP_Invalid }, + { 0x2177, opcode::OP_Invalid }, + { 0x2178, opcode::OP_GetByte }, + { 0x2179, opcode::OP_SuperNotEqual }, + { 0x217A, opcode::OP_Invalid }, + { 0x217B, opcode::OP_Jump }, + { 0x217C, opcode::OP_ScriptThreadCall }, + { 0x217D, opcode::OP_WaitTillFrameEnd }, + { 0x217E, opcode::OP_JumpOnFalseExpr }, + { 0x217F, opcode::OP_Invalid }, + { 0x2180, opcode::OP_JumpOnTrueExpr }, + { 0x2181, opcode::OP_Dec }, + { 0x2182, opcode::OP_WaitTill }, + { 0x2183, opcode::OP_Bit_Xor }, + { 0x2184, opcode::OP_Invalid }, + { 0x2185, opcode::OP_Invalid }, + { 0x2186, opcode::OP_ScriptMethodCall }, + { 0x2187, opcode::OP_ScriptThreadCall }, + { 0x2188, opcode::OP_GetUintptr }, + { 0x2189, opcode::OP_CallBuiltinMethod }, + { 0x218A, opcode::OP_Invalid }, + { 0x218B, opcode::OP_SuperNotEqual }, + { 0x218C, opcode::OP_Invalid }, + { 0x218D, opcode::OP_Invalid }, + { 0x218E, opcode::OP_LessThan }, + { 0x218F, opcode::OP_JumpOnTrue }, + { 0x2190, opcode::OP_EvalLocalVariableRefCached }, + { 0x2191, opcode::OP_SetVariableField }, + { 0x2192, opcode::OP_New }, + { 0x2193, opcode::OP_RealWait }, + { 0x2194, opcode::OP_Invalid }, + { 0x2195, opcode::OP_GetIString }, + { 0x2196, opcode::OP_Invalid }, + { 0x2197, opcode::OP_ScriptThreadCallClass }, + { 0x2198, opcode::OP_ScriptMethodThreadCall }, + { 0x2199, opcode::OP_EvalArray }, + { 0x219A, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x219B, opcode::OP_ScriptFunctionCallPointer }, + { 0x219C, opcode::OP_Invalid }, + { 0x219D, opcode::OP_Invalid }, + { 0x219E, opcode::OP_SuperEqual }, + { 0x219F, opcode::OP_FirstArrayKey }, + { 0x21A0, opcode::OP_Invalid }, + { 0x21A1, opcode::OP_Invalid }, + { 0x21A2, opcode::OP_Invalid }, + { 0x21A3, opcode::OP_Invalid }, + { 0x21A4, opcode::OP_SafeDecTop }, + { 0x21A5, opcode::OP_GetZero }, + { 0x21A6, opcode::OP_GetWorld }, + { 0x21A7, opcode::OP_EmptyArray }, + { 0x21A8, opcode::OP_SuperEqual }, + { 0x21A9, opcode::OP_EvalLocalVariableCached }, + { 0x21AA, opcode::OP_Invalid }, + { 0x21AB, opcode::OP_CastBool }, + { 0x21AC, opcode::OP_Wait }, + { 0x21AD, opcode::OP_GreaterThan }, + { 0x21AE, opcode::OP_GetSelfObject }, + { 0x21AF, opcode::OP_Invalid }, + { 0x21B0, opcode::OP_ScriptMethodCallPointer }, + { 0x21B1, opcode::OP_JumpOnFalseExpr }, + { 0x21B2, opcode::OP_LevelEvalFieldVariableRef }, + { 0x21B3, opcode::OP_JumpOnTrueExpr }, + { 0x21B4, opcode::OP_LessThanOrEqualTo }, + { 0x21B5, opcode::OP_GetUndefined }, + { 0x21B6, opcode::OP_Invalid }, + { 0x21B7, opcode::OP_SelfEvalFieldVariable }, + { 0x21B8, opcode::OP_JumpOnFalseExpr }, + { 0x21B9, opcode::OP_Invalid }, + { 0x21BA, opcode::OP_JumpOnTrueExpr }, + { 0x21BB, opcode::OP_Switch }, + { 0x21BC, opcode::OP_GetAnimation }, + { 0x21BD, opcode::OP_ScriptThreadCallClass }, + { 0x21BE, opcode::OP_Invalid }, + { 0x21BF, opcode::OP_Jump }, + { 0x21C0, opcode::OP_Invalid }, + { 0x21C1, opcode::OP_Invalid }, + { 0x21C2, opcode::OP_Invalid }, + { 0x21C3, opcode::OP_GetSelfObject }, + { 0x21C4, opcode::OP_ClearFieldVariable }, + { 0x21C5, opcode::OP_GetLevelObject }, + { 0x21C6, opcode::OP_EvalLocalVariableRefCached }, + { 0x21C7, opcode::OP_VectorScale }, + { 0x21C8, opcode::OP_Invalid }, + { 0x21C9, opcode::OP_Invalid }, + { 0x21CA, opcode::OP_GetClassesObject }, + { 0x21CB, opcode::OP_Invalid }, + { 0x21CC, opcode::OP_JumpOnTrue }, + { 0x21CD, opcode::OP_FirstArrayKey }, + { 0x21CE, opcode::OP_GetUnsignedShort }, + { 0x21CF, opcode::OP_Invalid }, + { 0x21D0, opcode::OP_GetIString }, + { 0x21D1, opcode::OP_Invalid }, + { 0x21D2, opcode::OP_GetNegByte }, + { 0x21D3, opcode::OP_Invalid }, + { 0x21D4, opcode::OP_EvalArray }, + { 0x21D5, opcode::OP_Wait }, + { 0x21D6, opcode::OP_GetUintptr }, + { 0x21D7, opcode::OP_GetUintptr }, + { 0x21D8, opcode::OP_ScriptMethodCallPointer }, + { 0x21D9, opcode::OP_CallBuiltinMethod }, + { 0x21DA, opcode::OP_Invalid }, + { 0x21DB, opcode::OP_GetZero }, + { 0x21DC, opcode::OP_WaitTill }, + { 0x21DD, opcode::OP_JumpOnTrueExpr }, + { 0x21DE, opcode::OP_Bit_And }, + { 0x21DF, opcode::OP_GetSelfObject }, + { 0x21E0, opcode::OP_Invalid }, + { 0x21E1, opcode::OP_SelfEvalFieldVariable }, + { 0x21E2, opcode::OP_Inc }, + { 0x21E3, opcode::OP_Invalid }, + { 0x21E4, opcode::OP_Invalid }, + { 0x21E5, opcode::OP_SuperEqual }, + { 0x21E6, opcode::OP_Invalid }, + { 0x21E7, opcode::OP_Equal }, + { 0x21E8, opcode::OP_Notify }, + { 0x21E9, opcode::OP_Jump }, + { 0x21EA, opcode::OP_GetString }, + { 0x21EB, opcode::OP_GetWorldObject }, + { 0x21EC, opcode::OP_EmptyArray }, + { 0x21ED, opcode::OP_VectorScale }, + { 0x21EE, opcode::OP_EvalLocalVariableCached }, + { 0x21EF, opcode::OP_GetIString }, + { 0x21F0, opcode::OP_Invalid }, + { 0x21F1, opcode::OP_GetClassesObject }, + { 0x21F2, opcode::OP_Dec }, + { 0x21F3, opcode::OP_EvalLocalVariableCached }, + { 0x21F4, opcode::OP_GreaterThan }, + { 0x21F5, opcode::OP_Bit_Xor }, + { 0x21F6, opcode::OP_ScriptMethodCallPointer }, + { 0x21F7, opcode::OP_Divide }, + { 0x21F8, opcode::OP_GetUndefined }, + { 0x21F9, opcode::OP_JumpOnTrueExpr }, + { 0x21FA, opcode::OP_GetNegUnsignedShort }, + { 0x21FB, opcode::OP_Invalid }, + { 0x21FC, opcode::OP_SelfEvalFieldVariableRef }, + { 0x21FD, opcode::OP_Invalid }, + { 0x21FE, opcode::OP_GetSelf }, + { 0x21FF, opcode::OP_GreaterThanOrEqualTo }, + { 0x2200, opcode::OP_Switch }, + { 0x2201, opcode::OP_LevelEvalFieldVariable }, + { 0x2202, opcode::OP_GetFloat }, + { 0x2203, opcode::OP_Invalid }, + { 0x2204, opcode::OP_JumpOnTrueExpr }, + { 0x2205, opcode::OP_LevelEvalFieldVariableRef }, + { 0x2206, opcode::OP_ScriptFunctionCall }, + { 0x2207, opcode::OP_Invalid }, + { 0x2208, opcode::OP_SelfEvalFieldVariable }, + { 0x2209, opcode::OP_Wait }, + { 0x220A, opcode::OP_ScriptThreadCallPointer }, + { 0x220B, opcode::OP_Invalid }, + { 0x220C, opcode::OP_Invalid }, + { 0x220D, opcode::OP_IsDefined }, + { 0x220E, opcode::OP_EvalArray }, + { 0x220F, opcode::OP_JumpOnFalse }, + { 0x2210, opcode::OP_Invalid }, + { 0x2211, opcode::OP_Invalid }, + { 0x2212, opcode::OP_Invalid }, + { 0x2213, opcode::OP_Invalid }, + { 0x2214, opcode::OP_Invalid }, + { 0x2215, opcode::OP_EndOn }, + { 0x2216, opcode::OP_Invalid }, + { 0x2217, opcode::OP_Invalid }, + { 0x2218, opcode::OP_Wait }, + { 0x2219, opcode::OP_GetUintptr }, + { 0x221A, opcode::OP_DecTop }, + { 0x221B, opcode::OP_SafeCreateLocalVariables }, + { 0x221C, opcode::OP_GetAnimObject }, + { 0x221D, opcode::OP_Return }, + { 0x221E, opcode::OP_JumpOnTrue }, + { 0x221F, opcode::OP_Invalid }, + { 0x2220, opcode::OP_Invalid }, + { 0x2221, opcode::OP_SelfEvalFieldVariable }, + { 0x2222, opcode::OP_RealWait }, + { 0x2223, opcode::OP_GetHash }, + { 0x2224, opcode::OP_GetLevelObject }, + { 0x2225, opcode::OP_FirstArrayKey }, + { 0x2226, opcode::OP_EvalArray }, + { 0x2227, opcode::OP_Invalid }, + { 0x2228, opcode::OP_Invalid }, + { 0x2229, opcode::OP_GetFloat }, + { 0x222A, opcode::OP_Invalid }, + { 0x222B, opcode::OP_Invalid }, + { 0x222C, opcode::OP_EvalArrayRef }, + { 0x222D, opcode::OP_EvalArray }, + { 0x222E, opcode::OP_Invalid }, + { 0x222F, opcode::OP_GetZero }, + { 0x2230, opcode::OP_ScriptFunctionCallPointer }, + { 0x2231, opcode::OP_Invalid }, + { 0x2232, opcode::OP_GetNegUnsignedShort }, + { 0x2233, opcode::OP_VectorConstant }, + { 0x2234, opcode::OP_JumpOnFalse }, + { 0x2235, opcode::OP_EndOn }, + { 0x2236, opcode::OP_GetLevelObject }, + { 0x2237, opcode::OP_Return }, + { 0x2238, opcode::OP_IsDefined }, + { 0x2239, opcode::OP_Invalid }, + { 0x223A, opcode::OP_Invalid }, + { 0x223B, opcode::OP_Invalid }, + { 0x223C, opcode::OP_Invalid }, + { 0x223D, opcode::OP_JumpOnFalse }, + { 0x223E, opcode::OP_Invalid }, + { 0x223F, opcode::OP_Invalid }, + { 0x2240, opcode::OP_GetSelfObject }, + { 0x2241, opcode::OP_ScriptMethodThreadCall }, + { 0x2242, opcode::OP_Bit_Xor }, + { 0x2243, opcode::OP_LessThanOrEqualTo }, + { 0x2244, opcode::OP_Invalid }, + { 0x2245, opcode::OP_SelfEvalFieldVariable }, + { 0x2246, opcode::OP_Return }, + { 0x2247, opcode::OP_GetWorld }, + { 0x2248, opcode::OP_GetString }, + { 0x2249, opcode::OP_SuperEqual }, + { 0x224A, opcode::OP_VectorConstant }, + { 0x224B, opcode::OP_Switch }, + { 0x224C, opcode::OP_Invalid }, + { 0x224D, opcode::OP_DecTop }, + { 0x224E, opcode::OP_Bit_Xor }, + { 0x224F, opcode::OP_JumpOnTrueExpr }, + { 0x2250, opcode::OP_Notify }, + { 0x2251, opcode::OP_SafeSetVariableFieldCached }, + { 0x2252, opcode::OP_Return }, + { 0x2253, opcode::OP_Invalid }, + { 0x2254, opcode::OP_Invalid }, + { 0x2255, opcode::OP_SizeOf }, + { 0x2256, opcode::OP_Invalid }, + { 0x2257, opcode::OP_Equal }, + { 0x2258, opcode::OP_GetUnsignedShort }, + { 0x2259, opcode::OP_Invalid }, + { 0x225A, opcode::OP_GetInteger }, + { 0x225B, opcode::OP_Invalid }, + { 0x225C, opcode::OP_Invalid }, + { 0x225D, opcode::OP_GetFunction }, + { 0x225E, opcode::OP_SuperNotEqual }, + { 0x225F, opcode::OP_Bit_Xor }, + { 0x2260, opcode::OP_Invalid }, + { 0x2261, opcode::OP_Minus }, + { 0x2262, opcode::OP_BoolNot }, + { 0x2263, opcode::OP_Invalid }, + { 0x2264, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x2265, opcode::OP_Invalid }, + { 0x2266, opcode::OP_Invalid }, + { 0x2267, opcode::OP_BoolComplement }, + { 0x2268, opcode::OP_Modulus }, + { 0x2269, opcode::OP_GetLevel }, + { 0x226A, opcode::OP_Invalid }, + { 0x226B, opcode::OP_Invalid }, + { 0x226C, opcode::OP_Invalid }, + { 0x226D, opcode::OP_VectorScale }, + { 0x226E, opcode::OP_ShiftRight }, + { 0x226F, opcode::OP_Invalid }, + { 0x2270, opcode::OP_Invalid }, + { 0x2271, opcode::OP_Invalid }, + { 0x2272, opcode::OP_Invalid }, + { 0x2273, opcode::OP_JumpOnTrue }, + { 0x2274, opcode::OP_GetInteger }, + { 0x2275, opcode::OP_Invalid }, + { 0x2276, opcode::OP_Invalid }, + { 0x2277, opcode::OP_Invalid }, + { 0x2278, opcode::OP_ScriptThreadCallClass }, + { 0x2279, opcode::OP_SuperEqual }, + { 0x227A, opcode::OP_JumpOnFalse }, + { 0x227B, opcode::OP_GetGameRef }, + { 0x227C, opcode::OP_ShiftRight }, + { 0x227D, opcode::OP_GetClassesObject }, + { 0x227E, opcode::OP_GetGame }, + { 0x227F, opcode::OP_Invalid }, + { 0x2280, opcode::OP_SuperEqual }, + { 0x2281, opcode::OP_GetAPIFunction }, + { 0x2282, opcode::OP_Invalid }, + { 0x2283, opcode::OP_SuperNotEqual }, + { 0x2284, opcode::OP_Invalid }, + { 0x2285, opcode::OP_Invalid }, + { 0x2286, opcode::OP_GetSelfObject }, + { 0x2287, opcode::OP_ClearArray }, + { 0x2288, opcode::OP_SizeOf }, + { 0x2289, opcode::OP_RealWait }, + { 0x228A, opcode::OP_ScriptThreadCall }, + { 0x228B, opcode::OP_Invalid }, + { 0x228C, opcode::OP_GetFloat }, + { 0x228D, opcode::OP_Invalid }, + { 0x228E, opcode::OP_Return }, + { 0x228F, opcode::OP_ShiftRight }, + { 0x2290, opcode::OP_SizeOf }, + { 0x2291, opcode::OP_GetInteger }, + { 0x2292, opcode::OP_GetSelfObject }, + { 0x2293, opcode::OP_GetAnimation }, + { 0x2294, opcode::OP_GetString }, + { 0x2295, opcode::OP_Invalid }, + { 0x2296, opcode::OP_Invalid }, + { 0x2297, opcode::OP_SizeOf }, + { 0x2298, opcode::OP_ScriptThreadCall }, + { 0x2299, opcode::OP_SafeDecTop }, + { 0x229A, opcode::OP_Bit_Xor }, + { 0x229B, opcode::OP_Invalid }, + { 0x229C, opcode::OP_RealWait }, + { 0x229D, opcode::OP_Invalid }, + { 0x229E, opcode::OP_Invalid }, + { 0x229F, opcode::OP_Notify }, + { 0x22A0, opcode::OP_Wait }, + { 0x22A1, opcode::OP_GetZero }, + { 0x22A2, opcode::OP_Invalid }, + { 0x22A3, opcode::OP_JumpOnTrue }, + { 0x22A4, opcode::OP_Invalid }, + { 0x22A5, opcode::OP_Multiply }, + { 0x22A6, opcode::OP_ShiftRight }, + { 0x22A7, opcode::OP_FirstArrayKey }, + { 0x22A8, opcode::OP_GetUndefined }, + { 0x22A9, opcode::OP_EvalArray }, + { 0x22AA, opcode::OP_ScriptMethodThreadCall }, + { 0x22AB, opcode::OP_EndOn }, + { 0x22AC, opcode::OP_Invalid }, + { 0x22AD, opcode::OP_Invalid }, + { 0x22AE, opcode::OP_Invalid }, + { 0x22AF, opcode::OP_Plus }, + { 0x22B0, opcode::OP_Invalid }, + { 0x22B1, opcode::OP_GetSelf }, + { 0x22B2, opcode::OP_JumpOnFalse }, + { 0x22B3, opcode::OP_ScriptThreadCall }, + { 0x22B4, opcode::OP_FirstArrayKey }, + { 0x22B5, opcode::OP_Invalid }, + { 0x22B6, opcode::OP_Invalid }, + { 0x22B7, opcode::OP_ScriptMethodThreadCall }, + { 0x22B8, opcode::OP_SelfEvalFieldVariable }, + { 0x22B9, opcode::OP_CallBuiltinMethod }, + { 0x22BA, opcode::OP_Invalid }, + { 0x22BB, opcode::OP_LessThan }, + { 0x22BC, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x22BD, opcode::OP_Invalid }, + { 0x22BE, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x22BF, opcode::OP_GetClassesObject }, + { 0x22C0, opcode::OP_ScriptThreadCallClass }, + { 0x22C1, opcode::OP_ScriptMethodCallPointer }, + { 0x22C2, opcode::OP_GetLevel }, + { 0x22C3, opcode::OP_CastFieldObject }, + { 0x22C4, opcode::OP_SuperNotEqual }, + { 0x22C5, opcode::OP_GetIString }, + { 0x22C6, opcode::OP_Invalid }, + { 0x22C7, opcode::OP_Vector }, + { 0x22C8, opcode::OP_Invalid }, + { 0x22C9, opcode::OP_WaitTillFrameEnd }, + { 0x22CA, opcode::OP_EvalLocalVariableCached }, + { 0x22CB, opcode::OP_Invalid }, + { 0x22CC, opcode::OP_Invalid }, + { 0x22CD, opcode::OP_Invalid }, + { 0x22CE, opcode::OP_Multiply }, + { 0x22CF, opcode::OP_JumpOnTrueExpr }, + { 0x22D0, opcode::OP_EvalLocalVariableRefCached }, + { 0x22D1, opcode::OP_ProfileStop }, + { 0x22D2, opcode::OP_ClearFieldVariable }, + { 0x22D3, opcode::OP_GetUndefined }, + { 0x22D4, opcode::OP_GetIString }, + { 0x22D5, opcode::OP_WaitTillMatch }, + { 0x22D6, opcode::OP_GetClasses }, + { 0x22D7, opcode::OP_JumpOnTrue }, + { 0x22D8, opcode::OP_NextArrayKey }, + { 0x22D9, opcode::OP_Divide }, + { 0x22DA, opcode::OP_GetLevel }, + { 0x22DB, opcode::OP_EndOn }, + { 0x22DC, opcode::OP_ClearFieldVariable }, + { 0x22DD, opcode::OP_EvalFieldVariableRef }, + { 0x22DE, opcode::OP_Dec }, + { 0x22DF, opcode::OP_GetVector }, + { 0x22E0, opcode::OP_JumpOnFalseExpr }, + { 0x22E1, opcode::OP_GetGame }, + { 0x22E2, opcode::OP_Invalid }, + { 0x22E3, opcode::OP_GetWorldObject }, + { 0x22E4, opcode::OP_Invalid }, + { 0x22E5, opcode::OP_EndOn }, + { 0x22E6, opcode::OP_VectorConstant }, + { 0x22E7, opcode::OP_Invalid }, + { 0x22E8, opcode::OP_SelfEvalFieldVariableRef }, + { 0x22E9, opcode::OP_Invalid }, + { 0x22EA, opcode::OP_ScriptThreadCall }, + { 0x22EB, opcode::OP_New }, + { 0x22EC, opcode::OP_GetAnim }, + { 0x22ED, opcode::OP_Dec }, + { 0x22EE, opcode::OP_LessThan }, + { 0x22EF, opcode::OP_Invalid }, + { 0x22F0, opcode::OP_WaitTillFrameEnd }, + { 0x22F1, opcode::OP_Invalid }, + { 0x22F2, opcode::OP_GetAnim }, + { 0x22F3, opcode::OP_Invalid }, + { 0x22F4, opcode::OP_Invalid }, + { 0x22F5, opcode::OP_Bit_Xor }, + { 0x22F6, opcode::OP_Invalid }, + { 0x22F7, opcode::OP_Invalid }, + { 0x22F8, opcode::OP_LevelEvalFieldVariableRef }, + { 0x22F9, opcode::OP_Minus }, + { 0x22FA, opcode::OP_EvalLocalVariableRefCached }, + { 0x22FB, opcode::OP_LessThan }, + { 0x22FC, opcode::OP_NextArrayKey }, + { 0x22FD, opcode::OP_GetWorld }, + { 0x22FE, opcode::OP_Invalid }, + { 0x22FF, opcode::OP_SafeSetVariableFieldCached }, + { 0x2300, opcode::OP_Invalid }, + { 0x2301, opcode::OP_Bit_And }, + { 0x2302, opcode::OP_EndSwitch }, + { 0x2303, opcode::OP_Invalid }, + { 0x2304, opcode::OP_ScriptMethodCallPointer }, + { 0x2305, opcode::OP_Invalid }, + { 0x2306, opcode::OP_GetIString }, + { 0x2307, opcode::OP_RealWait }, + { 0x2308, opcode::OP_GetString }, + { 0x2309, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x230A, opcode::OP_Invalid }, + { 0x230B, opcode::OP_GetSelfObject }, + { 0x230C, opcode::OP_Invalid }, + { 0x230D, opcode::OP_EvalFieldVariable }, + { 0x230E, opcode::OP_GetNegByte }, + { 0x230F, opcode::OP_GreaterThan }, + { 0x2310, opcode::OP_ShiftRight }, + { 0x2311, opcode::OP_NextArrayKey }, + { 0x2312, opcode::OP_WaitTillFrameEnd }, + { 0x2313, opcode::OP_Invalid }, + { 0x2314, opcode::OP_Invalid }, + { 0x2315, opcode::OP_EvalLocalVariableCached }, + { 0x2316, opcode::OP_Invalid }, + { 0x2317, opcode::OP_SizeOf }, + { 0x2318, opcode::OP_Invalid }, + { 0x2319, opcode::OP_Invalid }, + { 0x231A, opcode::OP_EvalFieldVariable }, + { 0x231B, opcode::OP_GetNegByte }, + { 0x231C, opcode::OP_JumpOnFalse }, + { 0x231D, opcode::OP_SelfEvalFieldVariable }, + { 0x231E, opcode::OP_Invalid }, + { 0x231F, opcode::OP_Invalid }, + { 0x2320, opcode::OP_WaitTill }, + { 0x2321, opcode::OP_GetIString }, + { 0x2322, opcode::OP_SafeDecTop }, + { 0x2323, opcode::OP_GetVector }, + { 0x2324, opcode::OP_GetGame }, + { 0x2325, opcode::OP_Invalid }, + { 0x2326, opcode::OP_ScriptFunctionCall }, + { 0x2327, opcode::OP_ScriptFunctionCallPointer }, + { 0x2328, opcode::OP_GetSelfObject }, + { 0x2329, opcode::OP_Invalid }, + { 0x232A, opcode::OP_VectorConstant }, + { 0x232B, opcode::OP_Invalid }, + { 0x232C, opcode::OP_GetAPIFunction }, + { 0x232D, opcode::OP_Invalid }, + { 0x232E, opcode::OP_ScriptThreadCallPointer }, + { 0x232F, opcode::OP_SafeDecTop }, + { 0x2330, opcode::OP_GetUintptr }, + { 0x2331, opcode::OP_ShiftLeft }, + { 0x2332, opcode::OP_GetUnsignedShort }, + { 0x2333, opcode::OP_Bit_Xor }, + { 0x2334, opcode::OP_EmptyArray }, + { 0x2335, opcode::OP_Invalid }, + { 0x2336, opcode::OP_WaitTillFrameEnd }, + { 0x2337, opcode::OP_BoolNot }, + { 0x2338, opcode::OP_Invalid }, + { 0x2339, opcode::OP_DecTop }, + { 0x233A, opcode::OP_GetWorldObject }, + { 0x233B, opcode::OP_Return }, + { 0x233C, opcode::OP_ProfileStart }, + { 0x233D, opcode::OP_VectorConstant }, + { 0x233E, opcode::OP_Invalid }, + { 0x233F, opcode::OP_GetIString }, + { 0x2340, opcode::OP_ProfileStop }, + { 0x2341, opcode::OP_JumpOnFalseExpr }, + { 0x2342, opcode::OP_Invalid }, + { 0x2343, opcode::OP_Invalid }, + { 0x2344, opcode::OP_Invalid }, + { 0x2345, opcode::OP_Invalid }, + { 0x2346, opcode::OP_SuperNotEqual }, + { 0x2347, opcode::OP_ScriptMethodThreadCall }, + { 0x2348, opcode::OP_ScriptMethodCall }, + { 0x2349, opcode::OP_Invalid }, + { 0x234A, opcode::OP_Invalid }, + { 0x234B, opcode::OP_EvalLocalVariableRefCached }, + { 0x234C, opcode::OP_Invalid }, + { 0x234D, opcode::OP_Invalid }, + { 0x234E, opcode::OP_Invalid }, + { 0x234F, opcode::OP_Invalid }, + { 0x2350, opcode::OP_Invalid }, + { 0x2351, opcode::OP_Invalid }, + { 0x2352, opcode::OP_IsDefined }, + { 0x2353, opcode::OP_VectorScale }, + { 0x2354, opcode::OP_JumpOnTrueExpr }, + { 0x2355, opcode::OP_Invalid }, + { 0x2356, opcode::OP_GetString }, + { 0x2357, opcode::OP_Divide }, + { 0x2358, opcode::OP_Bit_And }, + { 0x2359, opcode::OP_Invalid }, + { 0x235A, opcode::OP_JumpOnFalse }, + { 0x235B, opcode::OP_Invalid }, + { 0x235C, opcode::OP_Invalid }, + { 0x235D, opcode::OP_SuperNotEqual }, + { 0x235E, opcode::OP_Invalid }, + { 0x235F, opcode::OP_LevelEvalFieldVariable }, + { 0x2360, opcode::OP_ScriptThreadCallPointer }, + { 0x2361, opcode::OP_WaitTillFrameEnd }, + { 0x2362, opcode::OP_GetWorldObject }, + { 0x2363, opcode::OP_Invalid }, + { 0x2364, opcode::OP_WaitTillFrameEnd }, + { 0x2365, opcode::OP_Invalid }, + { 0x2366, opcode::OP_Invalid }, + { 0x2367, opcode::OP_Invalid }, + { 0x2368, opcode::OP_Invalid }, + { 0x2369, opcode::OP_EvalArrayRef }, + { 0x236A, opcode::OP_Invalid }, + { 0x236B, opcode::OP_DevblockBegin }, + { 0x236C, opcode::OP_Invalid }, + { 0x236D, opcode::OP_GreaterThan }, + { 0x236E, opcode::OP_GetClassesObject }, + { 0x236F, opcode::OP_Invalid }, + { 0x2370, opcode::OP_Invalid }, + { 0x2371, opcode::OP_New }, + { 0x2372, opcode::OP_GreaterThan }, + { 0x2373, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x2374, opcode::OP_WaitTillMatch }, + { 0x2375, opcode::OP_Invalid }, + { 0x2376, opcode::OP_LessThan }, + { 0x2377, opcode::OP_Invalid }, + { 0x2378, opcode::OP_Return }, + { 0x2379, opcode::OP_Invalid }, + { 0x237A, opcode::OP_GetGame }, + { 0x237B, opcode::OP_GetWorldObject }, + { 0x237C, opcode::OP_Invalid }, + { 0x237D, opcode::OP_Invalid }, + { 0x237E, opcode::OP_Invalid }, + { 0x237F, opcode::OP_ShiftLeft }, + { 0x2380, opcode::OP_GetAPIFunction }, + { 0x2381, opcode::OP_GreaterThan }, + { 0x2382, opcode::OP_EvalLocalVariableCached }, + { 0x2383, opcode::OP_Bit_And }, + { 0x2384, opcode::OP_Invalid }, + { 0x2385, opcode::OP_Switch }, + { 0x2386, opcode::OP_Invalid }, + { 0x2387, opcode::OP_GetSelf }, + { 0x2388, opcode::OP_Invalid }, + { 0x2389, opcode::OP_SelfEvalFieldVariable }, + { 0x238A, opcode::OP_DecTop }, + { 0x238B, opcode::OP_GetClassesObject }, + { 0x238C, opcode::OP_GetZero }, + { 0x238D, opcode::OP_Invalid }, + { 0x238E, opcode::OP_Minus }, + { 0x238F, opcode::OP_GetFloat }, + { 0x2390, opcode::OP_SelfEvalFieldVariableRef }, + { 0x2391, opcode::OP_Invalid }, + { 0x2392, opcode::OP_JumpOnTrue }, + { 0x2393, opcode::OP_Invalid }, + { 0x2394, opcode::OP_GetAnim }, + { 0x2395, opcode::OP_GetClasses }, + { 0x2396, opcode::OP_Invalid }, + { 0x2397, opcode::OP_Bit_Or }, + { 0x2398, opcode::OP_Invalid }, + { 0x2399, opcode::OP_Notify }, + { 0x239A, opcode::OP_ScriptThreadCallPointer }, + { 0x239B, opcode::OP_NotEqual }, + { 0x239C, opcode::OP_Invalid }, + { 0x239D, opcode::OP_Bit_Xor }, + { 0x239E, opcode::OP_ShiftLeft }, + { 0x239F, opcode::OP_WaitTill }, + { 0x23A0, opcode::OP_EmptyArray }, + { 0x23A1, opcode::OP_GreaterThan }, + { 0x23A2, opcode::OP_SuperEqual }, + { 0x23A3, opcode::OP_ShiftRight }, + { 0x23A4, opcode::OP_EvalLocalVariableRefCached }, + { 0x23A5, opcode::OP_EvalLocalVariableCached }, + { 0x23A6, opcode::OP_GetFunction }, + { 0x23A7, opcode::OP_Bit_Xor }, + { 0x23A8, opcode::OP_SelfEvalFieldVariable }, + { 0x23A9, opcode::OP_Invalid }, + { 0x23AA, opcode::OP_ScriptMethodCall }, + { 0x23AB, opcode::OP_GetSelfObject }, + { 0x23AC, opcode::OP_Invalid }, + { 0x23AD, opcode::OP_Invalid }, + { 0x23AE, opcode::OP_GetSelf }, + { 0x23AF, opcode::OP_Invalid }, + { 0x23B0, opcode::OP_GetString }, + { 0x23B1, opcode::OP_NotEqual }, + { 0x23B2, opcode::OP_Invalid }, + { 0x23B3, opcode::OP_Bit_And }, + { 0x23B4, opcode::OP_SelfEvalFieldVariable }, + { 0x23B5, opcode::OP_ScriptThreadCall }, + { 0x23B6, opcode::OP_CastBool }, + { 0x23B7, opcode::OP_GetFloat }, + { 0x23B8, opcode::OP_LessThan }, + { 0x23B9, opcode::OP_Jump }, + { 0x23BA, opcode::OP_SetVariableField }, + { 0x23BB, opcode::OP_EvalArray }, + { 0x23BC, opcode::OP_Invalid }, + { 0x23BD, opcode::OP_EndSwitch }, + { 0x23BE, opcode::OP_Modulus }, + { 0x23BF, opcode::OP_Invalid }, + { 0x23C0, opcode::OP_WaitTill }, + { 0x23C1, opcode::OP_Invalid }, + { 0x23C2, opcode::OP_Invalid }, + { 0x23C3, opcode::OP_Invalid }, + { 0x23C4, opcode::OP_CallBuiltinMethod }, + { 0x23C5, opcode::OP_GetUintptr }, + { 0x23C6, opcode::OP_Modulus }, + { 0x23C7, opcode::OP_LessThan }, + { 0x23C8, opcode::OP_Invalid }, + { 0x23C9, opcode::OP_Invalid }, + { 0x23CA, opcode::OP_GetAnim }, + { 0x23CB, opcode::OP_GetSelfObject }, + { 0x23CC, opcode::OP_GetFloat }, + { 0x23CD, opcode::OP_NextArrayKey }, + { 0x23CE, opcode::OP_Invalid }, + { 0x23CF, opcode::OP_ScriptFunctionCall }, + { 0x23D0, opcode::OP_FirstArrayKey }, + { 0x23D1, opcode::OP_Invalid }, + { 0x23D2, opcode::OP_Invalid }, + { 0x23D3, opcode::OP_ScriptMethodThreadCall }, + { 0x23D4, opcode::OP_ClearArray }, + { 0x23D5, opcode::OP_BoolNot }, + { 0x23D6, opcode::OP_SafeCreateLocalVariables }, + { 0x23D7, opcode::OP_Invalid }, + { 0x23D8, opcode::OP_JumpOnTrue }, + { 0x23D9, opcode::OP_EmptyArray }, + { 0x23DA, opcode::OP_ScriptThreadCallClass }, + { 0x23DB, opcode::OP_CallBuiltinMethod }, + { 0x23DC, opcode::OP_Invalid }, + { 0x23DD, opcode::OP_GetUintptr }, + { 0x23DE, opcode::OP_GetWorld }, + { 0x23DF, opcode::OP_Dec }, + { 0x23E0, opcode::OP_WaitTill }, + { 0x23E1, opcode::OP_NextArrayKey }, + { 0x23E2, opcode::OP_Invalid }, + { 0x23E3, opcode::OP_GetFunction }, + { 0x23E4, opcode::OP_ScriptFunctionCall }, + { 0x23E5, opcode::OP_Invalid }, + { 0x23E6, opcode::OP_Invalid }, + { 0x23E7, opcode::OP_ScriptThreadCallPointer }, + { 0x23E8, opcode::OP_GetAnimObject }, + { 0x23E9, opcode::OP_EvalLocalVariableRefCached }, + { 0x23EA, opcode::OP_Multiply }, + { 0x23EB, opcode::OP_Invalid }, + { 0x23EC, opcode::OP_Invalid }, + { 0x23ED, opcode::OP_Invalid }, + { 0x23EE, opcode::OP_GetLevel }, + { 0x23EF, opcode::OP_ScriptThreadCall }, + { 0x23F0, opcode::OP_Invalid }, + { 0x23F1, opcode::OP_NextArrayKey }, + { 0x23F2, opcode::OP_Invalid }, + { 0x23F3, opcode::OP_Invalid }, + { 0x23F4, opcode::OP_Invalid }, + { 0x23F5, opcode::OP_FirstArrayKey }, + { 0x23F6, opcode::OP_Return }, + { 0x23F7, opcode::OP_Invalid }, + { 0x23F8, opcode::OP_RealWait }, + { 0x23F9, opcode::OP_JumpOnTrue }, + { 0x23FA, opcode::OP_GreaterThanOrEqualTo }, + { 0x23FB, opcode::OP_GetWorldObject }, + { 0x23FC, opcode::OP_Invalid }, + { 0x23FD, opcode::OP_Invalid }, + { 0x23FE, opcode::OP_Invalid }, + { 0x23FF, opcode::OP_ScriptMethodThreadCall }, + { 0x2400, opcode::OP_Invalid }, + { 0x2401, opcode::OP_GetSelf }, + { 0x2402, opcode::OP_Invalid }, + { 0x2403, opcode::OP_EndSwitch }, + { 0x2404, opcode::OP_GetNegUnsignedShort }, + { 0x2405, opcode::OP_DevblockBegin }, + { 0x2406, opcode::OP_Vector }, + { 0x2407, opcode::OP_Invalid }, + { 0x2408, opcode::OP_Invalid }, + { 0x2409, opcode::OP_ClearFieldVariable }, + { 0x240A, opcode::OP_Invalid }, + { 0x240B, opcode::OP_ShiftLeft }, + { 0x240C, opcode::OP_GetLevel }, + { 0x240D, opcode::OP_EvalFieldVariable }, + { 0x240E, opcode::OP_VectorScale }, + { 0x240F, opcode::OP_EvalArrayRef }, + { 0x2410, opcode::OP_GetClasses }, + { 0x2411, opcode::OP_Invalid }, + { 0x2412, opcode::OP_GetFloat }, + { 0x2413, opcode::OP_EvalLocalVariableRefCached }, + { 0x2414, opcode::OP_SizeOf }, + { 0x2415, opcode::OP_ScriptFunctionCallPointer }, + { 0x2416, opcode::OP_Switch }, + { 0x2417, opcode::OP_GetUndefined }, + { 0x2418, opcode::OP_DecTop }, + { 0x2419, opcode::OP_Invalid }, + { 0x241A, opcode::OP_ScriptThreadCallPointer }, + { 0x241B, opcode::OP_GetGame }, + { 0x241C, opcode::OP_Invalid }, + { 0x241D, opcode::OP_Invalid }, + { 0x241E, opcode::OP_ProfileStop }, + { 0x241F, opcode::OP_EvalFieldVariable }, + { 0x2420, opcode::OP_JumpOnTrue }, + { 0x2421, opcode::OP_Modulus }, + { 0x2422, opcode::OP_GreaterThan }, + { 0x2423, opcode::OP_Invalid }, + { 0x2424, opcode::OP_Vector }, + { 0x2425, opcode::OP_Inc }, + { 0x2426, opcode::OP_Invalid }, + { 0x2427, opcode::OP_ShiftLeft }, + { 0x2428, opcode::OP_LessThan }, + { 0x2429, opcode::OP_Invalid }, + { 0x242A, opcode::OP_Invalid }, + { 0x242B, opcode::OP_GetFunction }, + { 0x242C, opcode::OP_EvalLocalVariableCached }, + { 0x242D, opcode::OP_CastFieldObject }, + { 0x242E, opcode::OP_GetUintptr }, + { 0x242F, opcode::OP_Invalid }, + { 0x2430, opcode::OP_Invalid }, + { 0x2431, opcode::OP_CallBuiltinMethod }, + { 0x2432, opcode::OP_ShiftRight }, + { 0x2433, opcode::OP_Invalid }, + { 0x2434, opcode::OP_NotEqual }, + { 0x2435, opcode::OP_Invalid }, + { 0x2436, opcode::OP_Invalid }, + { 0x2437, opcode::OP_EvalArrayRef }, + { 0x2438, opcode::OP_Invalid }, + { 0x2439, opcode::OP_Invalid }, + { 0x243A, opcode::OP_VectorConstant }, + { 0x243B, opcode::OP_EvalArray }, + { 0x243C, opcode::OP_Divide }, + { 0x243D, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x243E, opcode::OP_ProfileStart }, + { 0x243F, opcode::OP_WaitTill }, + { 0x2440, opcode::OP_Invalid }, + { 0x2441, opcode::OP_SetVariableField }, + { 0x2442, opcode::OP_Wait }, + { 0x2443, opcode::OP_ProfileStop }, + { 0x2444, opcode::OP_Invalid }, + { 0x2445, opcode::OP_GetClasses }, + { 0x2446, opcode::OP_Invalid }, + { 0x2447, opcode::OP_BoolNot }, + { 0x2448, opcode::OP_Invalid }, + { 0x2449, opcode::OP_Minus }, + { 0x244A, opcode::OP_Invalid }, + { 0x244B, opcode::OP_Dec }, + { 0x244C, opcode::OP_EvalArray }, + { 0x244D, opcode::OP_CastFieldObject }, + { 0x244E, opcode::OP_Invalid }, + { 0x244F, opcode::OP_DevblockBegin }, + { 0x2450, opcode::OP_EvalFieldVariable }, + { 0x2451, opcode::OP_SuperNotEqual }, + { 0x2452, opcode::OP_Invalid }, + { 0x2453, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x2454, opcode::OP_DevblockBegin }, + { 0x2455, opcode::OP_GetUndefined }, + { 0x2456, opcode::OP_EvalFieldVariable }, + { 0x2457, opcode::OP_EndOn }, + { 0x2458, opcode::OP_ScriptMethodThreadCall }, + { 0x2459, opcode::OP_Plus }, + { 0x245A, opcode::OP_EvalArrayRef }, + { 0x245B, opcode::OP_GetUnsignedShort }, + { 0x245C, opcode::OP_RealWait }, + { 0x245D, opcode::OP_ProfileStop }, + { 0x245E, opcode::OP_GetAnimation }, + { 0x245F, opcode::OP_Multiply }, + { 0x2460, opcode::OP_GetIString }, + { 0x2461, opcode::OP_Invalid }, + { 0x2462, opcode::OP_GetIString }, + { 0x2463, opcode::OP_Modulus }, + { 0x2464, opcode::OP_NextArrayKey }, + { 0x2465, opcode::OP_Invalid }, + { 0x2466, opcode::OP_IsDefined }, + { 0x2467, opcode::OP_Invalid }, + { 0x2468, opcode::OP_Switch }, + { 0x2469, opcode::OP_JumpOnTrue }, + { 0x246A, opcode::OP_EvalFieldVariable }, + { 0x246B, opcode::OP_LevelEvalFieldVariable }, + { 0x246C, opcode::OP_GreaterThanOrEqualTo }, + { 0x246D, opcode::OP_Invalid }, + { 0x246E, opcode::OP_ShiftLeft }, + { 0x246F, opcode::OP_GetNegByte }, + { 0x2470, opcode::OP_Invalid }, + { 0x2471, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x2472, opcode::OP_SizeOf }, + { 0x2473, opcode::OP_Return }, + { 0x2474, opcode::OP_GetUnsignedShort }, + { 0x2475, opcode::OP_GetWorldObject }, + { 0x2476, opcode::OP_Invalid }, + { 0x2477, opcode::OP_EndSwitch }, + { 0x2478, opcode::OP_Return }, + { 0x2479, opcode::OP_Invalid }, + { 0x247A, opcode::OP_LessThan }, + { 0x247B, opcode::OP_SizeOf }, + { 0x247C, opcode::OP_JumpOnFalseExpr }, + { 0x247D, opcode::OP_CastBool }, + { 0x247E, opcode::OP_Invalid }, + { 0x247F, opcode::OP_Invalid }, + { 0x2480, opcode::OP_ScriptThreadCallClass }, + { 0x2481, opcode::OP_DecTop }, + { 0x2482, opcode::OP_Invalid }, + { 0x2483, opcode::OP_CallBuiltinMethod }, + { 0x2484, opcode::OP_LessThanOrEqualTo }, + { 0x2485, opcode::OP_GetFloat }, + { 0x2486, opcode::OP_Invalid }, + { 0x2487, opcode::OP_ScriptFunctionCallPointer }, + { 0x2488, opcode::OP_Invalid }, + { 0x2489, opcode::OP_ProfileStop }, + { 0x248A, opcode::OP_WaitTillFrameEnd }, + { 0x248B, opcode::OP_Invalid }, + { 0x248C, opcode::OP_Plus }, + { 0x248D, opcode::OP_SafeDecTop }, + { 0x248E, opcode::OP_FirstArrayKey }, + { 0x248F, opcode::OP_SetVariableField }, + { 0x2490, opcode::OP_GetSelfObject }, + { 0x2491, opcode::OP_Invalid }, + { 0x2492, opcode::OP_Invalid }, + { 0x2493, opcode::OP_GetIString }, + { 0x2494, opcode::OP_GetZero }, + { 0x2495, opcode::OP_EvalFieldVariable }, + { 0x2496, opcode::OP_Invalid }, + { 0x2497, opcode::OP_GetByte }, + { 0x2498, opcode::OP_SafeSetVariableFieldCached }, + { 0x2499, opcode::OP_BoolNot }, + { 0x249A, opcode::OP_Invalid }, + { 0x249B, opcode::OP_Invalid }, + { 0x249C, opcode::OP_Wait }, + { 0x249D, opcode::OP_Wait }, + { 0x249E, opcode::OP_ScriptMethodThreadCall }, + { 0x249F, opcode::OP_DevblockBegin }, + { 0x24A0, opcode::OP_Invalid }, + { 0x24A1, opcode::OP_ScriptMethodThreadCall }, + { 0x24A2, opcode::OP_Invalid }, + { 0x24A3, opcode::OP_JumpOnTrueExpr }, + { 0x24A4, opcode::OP_Invalid }, + { 0x24A5, opcode::OP_Invalid }, + { 0x24A6, opcode::OP_RealWait }, + { 0x24A7, opcode::OP_GetSelf }, + { 0x24A8, opcode::OP_Vector }, + { 0x24A9, opcode::OP_Vector }, + { 0x24AA, opcode::OP_LessThanOrEqualTo }, + { 0x24AB, opcode::OP_Multiply }, + { 0x24AC, opcode::OP_Wait }, + { 0x24AD, opcode::OP_EvalFieldVariableRef }, + { 0x24AE, opcode::OP_EvalLocalVariableRefCached }, + { 0x24AF, opcode::OP_GreaterThan }, + { 0x24B0, opcode::OP_Notify }, + { 0x24B1, opcode::OP_ScriptMethodCallPointer }, + { 0x24B2, opcode::OP_Invalid }, + { 0x24B3, opcode::OP_Invalid }, + { 0x24B4, opcode::OP_Bit_Xor }, + { 0x24B5, opcode::OP_Multiply }, + { 0x24B6, opcode::OP_GetHash }, + { 0x24B7, opcode::OP_RealWait }, + { 0x24B8, opcode::OP_Invalid }, + { 0x24B9, opcode::OP_Invalid }, + { 0x24BA, opcode::OP_EvalFieldVariable }, + { 0x24BB, opcode::OP_JumpOnTrueExpr }, + { 0x24BC, opcode::OP_EndOn }, + { 0x24BD, opcode::OP_Equal }, + { 0x24BE, opcode::OP_Invalid }, + { 0x24BF, opcode::OP_Wait }, + { 0x24C0, opcode::OP_Invalid }, + { 0x24C1, opcode::OP_Invalid }, + { 0x24C2, opcode::OP_GetZero }, + { 0x24C3, opcode::OP_Invalid }, + { 0x24C4, opcode::OP_GetInteger }, + { 0x24C5, opcode::OP_JumpOnFalseExpr }, + { 0x24C6, opcode::OP_Invalid }, + { 0x24C7, opcode::OP_EvalFieldVariable }, + { 0x24C8, opcode::OP_Invalid }, + { 0x24C9, opcode::OP_Invalid }, + { 0x24CA, opcode::OP_Invalid }, + { 0x24CB, opcode::OP_New }, + { 0x24CC, opcode::OP_New }, + { 0x24CD, opcode::OP_WaitTillMatch }, + { 0x24CE, opcode::OP_GetVector }, + { 0x24CF, opcode::OP_Invalid }, + { 0x24D0, opcode::OP_SetVariableField }, + { 0x24D1, opcode::OP_FirstArrayKey }, + { 0x24D2, opcode::OP_GetSelf }, + { 0x24D3, opcode::OP_Invalid }, + { 0x24D4, opcode::OP_Plus }, + { 0x24D5, opcode::OP_Invalid }, + { 0x24D6, opcode::OP_ClearArray }, + { 0x24D7, opcode::OP_WaitTill }, + { 0x24D8, opcode::OP_LevelEvalFieldVariable }, + { 0x24D9, opcode::OP_Invalid }, + { 0x24DA, opcode::OP_Invalid }, + { 0x24DB, opcode::OP_Invalid }, + { 0x24DC, opcode::OP_Invalid }, + { 0x24DD, opcode::OP_GetZero }, + { 0x24DE, opcode::OP_GetZero }, + { 0x24DF, opcode::OP_Invalid }, + { 0x24E0, opcode::OP_Invalid }, + { 0x24E1, opcode::OP_ScriptFunctionCallPointer }, + { 0x24E2, opcode::OP_EvalLocalVariableCached }, + { 0x24E3, opcode::OP_FirstArrayKey }, + { 0x24E4, opcode::OP_Bit_Or }, + { 0x24E5, opcode::OP_Invalid }, + { 0x24E6, opcode::OP_NextArrayKey }, + { 0x24E7, opcode::OP_Invalid }, + { 0x24E8, opcode::OP_ScriptFunctionCallClass }, + { 0x24E9, opcode::OP_GetSelfObject }, + { 0x24EA, opcode::OP_GetLevelObject }, + { 0x24EB, opcode::OP_JumpOnTrueExpr }, + { 0x24EC, opcode::OP_EndOn }, + { 0x24ED, opcode::OP_GetString }, + { 0x24EE, opcode::OP_Invalid }, + { 0x24EF, opcode::OP_New }, + { 0x24F0, opcode::OP_CastBool }, + { 0x24F1, opcode::OP_Invalid }, + { 0x24F2, opcode::OP_Invalid }, + { 0x24F3, opcode::OP_Invalid }, + { 0x24F4, opcode::OP_GetSelf }, + { 0x24F5, opcode::OP_ScriptThreadCallClass }, + { 0x24F6, opcode::OP_RealWait }, + { 0x24F7, opcode::OP_Invalid }, + { 0x24F8, opcode::OP_ShiftLeft }, + { 0x24F9, opcode::OP_RealWait }, + { 0x24FA, opcode::OP_Invalid }, + { 0x24FB, opcode::OP_WaitTillMatch }, + { 0x24FC, opcode::OP_SafeDecTop }, + { 0x24FD, opcode::OP_EvalArray }, + { 0x24FE, opcode::OP_GetIString }, + { 0x24FF, opcode::OP_Invalid }, + { 0x2500, opcode::OP_Invalid }, + { 0x2501, opcode::OP_EvalFieldVariable }, + { 0x2502, opcode::OP_RealWait }, + { 0x2503, opcode::OP_EvalLocalVariableCached }, + { 0x2504, opcode::OP_ScriptThreadCallClass }, + { 0x2505, opcode::OP_Invalid }, + { 0x2506, opcode::OP_Invalid }, + { 0x2507, opcode::OP_ClearFieldVariable }, + { 0x2508, opcode::OP_Invalid }, + { 0x2509, opcode::OP_GetUnsignedShort }, + { 0x250A, opcode::OP_GetTime }, + { 0x250B, opcode::OP_EmptyArray }, + { 0x250C, opcode::OP_RealWait }, + { 0x250D, opcode::OP_SafeSetVariableFieldCached }, + { 0x250E, opcode::OP_Invalid }, + { 0x250F, opcode::OP_Invalid }, + { 0x2510, opcode::OP_GetClasses }, + { 0x2511, opcode::OP_ClearFieldVariable }, + { 0x2512, opcode::OP_GetSelfObject }, + { 0x2513, opcode::OP_JumpOnFalseExpr }, + { 0x2514, opcode::OP_Invalid }, + { 0x2515, opcode::OP_WaitTillMatch }, + { 0x2516, opcode::OP_EvalFieldVariableRef }, + { 0x2517, opcode::OP_GetAPIFunction }, + { 0x2518, opcode::OP_SelfEvalFieldVariable }, + { 0x2519, opcode::OP_Invalid }, + { 0x251A, opcode::OP_JumpOnTrueExpr }, + { 0x251B, opcode::OP_Invalid }, + { 0x251C, opcode::OP_ShiftLeft }, + { 0x251D, opcode::OP_EndSwitch }, + { 0x251E, opcode::OP_GetLevel }, + { 0x251F, opcode::OP_Bit_Or }, + { 0x2520, opcode::OP_Invalid }, + { 0x2521, opcode::OP_JumpOnTrueExpr }, + { 0x2522, opcode::OP_FirstArrayKey }, + { 0x2523, opcode::OP_CastBool }, + { 0x2524, opcode::OP_Invalid }, + { 0x2525, opcode::OP_Invalid }, + { 0x2526, opcode::OP_Invalid }, + { 0x2527, opcode::OP_ScriptFunctionCall }, + { 0x2528, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x2529, opcode::OP_EvalLocalVariableCached }, + { 0x252A, opcode::OP_SafeDecTop }, + { 0x252B, opcode::OP_ShiftRight }, + { 0x252C, opcode::OP_FirstArrayKey }, + { 0x252D, opcode::OP_SafeCreateLocalVariables }, + { 0x252E, opcode::OP_Invalid }, + { 0x252F, opcode::OP_SafeDecTop }, + { 0x2530, opcode::OP_EmptyArray }, + { 0x2531, opcode::OP_Invalid }, + { 0x2532, opcode::OP_Invalid }, + { 0x2533, opcode::OP_SafeSetVariableFieldCached }, + { 0x2534, opcode::OP_Invalid }, + { 0x2535, opcode::OP_Invalid }, + { 0x2536, opcode::OP_Invalid }, + { 0x2537, opcode::OP_Dec }, + { 0x2538, opcode::OP_Invalid }, + { 0x2539, opcode::OP_GetAnimation }, + { 0x253A, opcode::OP_JumpOnTrueExpr }, + { 0x253B, opcode::OP_Divide }, + { 0x253C, opcode::OP_EndSwitch }, + { 0x253D, opcode::OP_Invalid }, + { 0x253E, opcode::OP_Invalid }, + { 0x253F, opcode::OP_ClearFieldVariable }, + { 0x2540, opcode::OP_VectorScale }, + { 0x2541, opcode::OP_GetWorld }, + { 0x2542, opcode::OP_GetZero }, + { 0x2543, opcode::OP_Invalid }, + { 0x2544, opcode::OP_EvalLocalVariableCached }, + { 0x2545, opcode::OP_BoolNot }, + { 0x2546, opcode::OP_Invalid }, + { 0x2547, opcode::OP_GetAnimObject }, + { 0x2548, opcode::OP_ProfileStop }, + { 0x2549, opcode::OP_Bit_Xor }, + { 0x254A, opcode::OP_Invalid }, + { 0x254B, opcode::OP_ClearFieldVariable }, + { 0x254C, opcode::OP_ProfileStart }, + { 0x254D, opcode::OP_JumpOnFalseExpr }, + { 0x254E, opcode::OP_Invalid }, + { 0x254F, opcode::OP_GetAPIFunction }, + { 0x2550, opcode::OP_WaitTillFrameEnd }, + { 0x2551, opcode::OP_JumpOnTrue }, + { 0x2552, opcode::OP_EvalLocalVariableRefCached }, + { 0x2553, opcode::OP_Bit_And }, + { 0x2554, opcode::OP_Invalid }, + { 0x2555, opcode::OP_GetUnsignedShort }, + { 0x2556, opcode::OP_Invalid }, + { 0x2557, opcode::OP_Invalid }, + { 0x2558, opcode::OP_GetAnim }, + { 0x2559, opcode::OP_GetClasses }, + { 0x255A, opcode::OP_Invalid }, + { 0x255B, opcode::OP_GreaterThan }, + { 0x255C, opcode::OP_GetGameRef }, + { 0x255D, opcode::OP_Invalid }, + { 0x255E, opcode::OP_SuperEqual }, + { 0x255F, opcode::OP_Return }, + { 0x2560, opcode::OP_ScriptMethodCallPointer }, + { 0x2561, opcode::OP_BoolComplement }, + { 0x2562, opcode::OP_GetInteger }, + { 0x2563, opcode::OP_Invalid }, + { 0x2564, opcode::OP_Invalid }, + { 0x2565, opcode::OP_Invalid }, + { 0x2566, opcode::OP_Invalid }, + { 0x2567, opcode::OP_ShiftRight }, + { 0x2568, opcode::OP_Invalid }, + { 0x2569, opcode::OP_NextArrayKey }, + { 0x256A, opcode::OP_Vector }, + { 0x256B, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x256C, opcode::OP_Invalid }, + { 0x256D, opcode::OP_Invalid }, + { 0x256E, opcode::OP_ScriptThreadCallPointer }, + { 0x256F, opcode::OP_Invalid }, + { 0x2570, opcode::OP_GetUnsignedShort }, + { 0x2571, opcode::OP_Invalid }, + { 0x2572, opcode::OP_SizeOf }, + { 0x2573, opcode::OP_ScriptThreadCallPointer }, + { 0x2574, opcode::OP_WaitTillMatch }, + { 0x2575, opcode::OP_GetFloat }, + { 0x2576, opcode::OP_EvalLocalVariableCached }, + { 0x2577, opcode::OP_Invalid }, + { 0x2578, opcode::OP_RealWait }, + { 0x2579, opcode::OP_Invalid }, + { 0x257A, opcode::OP_Return }, + { 0x257B, opcode::OP_Bit_Xor }, + { 0x257C, opcode::OP_Invalid }, + { 0x257D, opcode::OP_Invalid }, + { 0x257E, opcode::OP_Invalid }, + { 0x257F, opcode::OP_LevelEvalFieldVariableRef }, + { 0x2580, opcode::OP_EvalLocalVariableCached }, + { 0x2581, opcode::OP_LessThan }, + { 0x2582, opcode::OP_Multiply }, + { 0x2583, opcode::OP_Invalid }, + { 0x2584, opcode::OP_GetNegByte }, + { 0x2585, opcode::OP_Invalid }, + { 0x2586, opcode::OP_Invalid }, + { 0x2587, opcode::OP_Switch }, + { 0x2588, opcode::OP_ScriptThreadCall }, + { 0x2589, opcode::OP_GetIString }, + { 0x258A, opcode::OP_EndOn }, + { 0x258B, opcode::OP_BoolComplement }, + { 0x258C, opcode::OP_JumpOnTrueExpr }, + { 0x258D, opcode::OP_Invalid }, + { 0x258E, opcode::OP_EvalFieldVariableRef }, + { 0x258F, opcode::OP_ScriptMethodCallPointer }, + { 0x2590, opcode::OP_EvalFieldVariable }, + { 0x2591, opcode::OP_Invalid }, + { 0x2592, opcode::OP_JumpOnFalse }, + { 0x2593, opcode::OP_GetVector }, + { 0x2594, opcode::OP_Invalid }, + { 0x2595, opcode::OP_Invalid }, + { 0x2596, opcode::OP_BoolComplement }, + { 0x2597, opcode::OP_GetTime }, + { 0x2598, opcode::OP_Invalid }, + { 0x2599, opcode::OP_Invalid }, + { 0x259A, opcode::OP_ClearFieldVariable }, + { 0x259B, opcode::OP_FirstArrayKey }, + { 0x259C, opcode::OP_Invalid }, + { 0x259D, opcode::OP_Invalid }, + { 0x259E, opcode::OP_DecTop }, + { 0x259F, opcode::OP_GetZero }, + { 0x25A0, opcode::OP_Invalid }, + { 0x25A1, opcode::OP_ScriptMethodCall }, + { 0x25A2, opcode::OP_EvalFieldVariableRef }, + { 0x25A3, opcode::OP_Jump }, + { 0x25A4, opcode::OP_ScriptFunctionCall }, + { 0x25A5, opcode::OP_GetString }, + { 0x25A6, opcode::OP_ProfileStop }, + { 0x25A7, opcode::OP_LessThan }, + { 0x25A8, opcode::OP_Invalid }, + { 0x25A9, opcode::OP_CastFieldObject }, + { 0x25AA, opcode::OP_Invalid }, + { 0x25AB, opcode::OP_NextArrayKey }, + { 0x25AC, opcode::OP_GetUndefined }, + { 0x25AD, opcode::OP_Invalid }, + { 0x25AE, opcode::OP_Invalid }, + { 0x25AF, opcode::OP_Invalid }, + { 0x25B0, opcode::OP_GetClasses }, + { 0x25B1, opcode::OP_Dec }, + { 0x25B2, opcode::OP_SelfEvalFieldVariable }, + { 0x25B3, opcode::OP_GetWorldObject }, + { 0x25B4, opcode::OP_DecTop }, + { 0x25B5, opcode::OP_Dec }, + { 0x25B6, opcode::OP_GetUndefined }, + { 0x25B7, opcode::OP_Invalid }, + { 0x25B8, opcode::OP_Invalid }, + { 0x25B9, opcode::OP_GetClasses }, + { 0x25BA, opcode::OP_SuperNotEqual }, + { 0x25BB, opcode::OP_Invalid }, + { 0x25BC, opcode::OP_Wait }, + { 0x25BD, opcode::OP_GetHash }, + { 0x25BE, opcode::OP_Invalid }, + { 0x25BF, opcode::OP_GetHash }, + { 0x25C0, opcode::OP_Invalid }, + { 0x25C1, opcode::OP_JumpOnFalseExpr }, + { 0x25C2, opcode::OP_Wait }, + { 0x25C3, opcode::OP_GetAnim }, + { 0x25C4, opcode::OP_WaitTillMatch }, + { 0x25C5, opcode::OP_VectorScale }, + { 0x25C6, opcode::OP_FirstArrayKey }, + { 0x25C7, opcode::OP_ScriptMethodCall }, + { 0x25C8, opcode::OP_Invalid }, + { 0x25C9, opcode::OP_ClearFieldVariable }, + { 0x25CA, opcode::OP_Invalid }, + { 0x25CB, opcode::OP_Invalid }, + { 0x25CC, opcode::OP_Invalid }, + { 0x25CD, opcode::OP_JumpOnTrue }, + { 0x25CE, opcode::OP_Invalid }, + { 0x25CF, opcode::OP_EndSwitch }, + { 0x25D0, opcode::OP_JumpOnTrueExpr }, + { 0x25D1, opcode::OP_Invalid }, + { 0x25D2, opcode::OP_Minus }, + { 0x25D3, opcode::OP_Invalid }, + { 0x25D4, opcode::OP_Invalid }, + { 0x25D5, opcode::OP_GetAnimation }, + { 0x25D6, opcode::OP_GetIString }, + { 0x25D7, opcode::OP_GetNegUnsignedShort }, + { 0x25D8, opcode::OP_Jump }, + { 0x25D9, opcode::OP_Invalid }, + { 0x25DA, opcode::OP_Invalid }, + { 0x25DB, opcode::OP_JumpOnFalse }, + { 0x25DC, opcode::OP_Invalid }, + { 0x25DD, opcode::OP_CallBuiltinMethod }, + { 0x25DE, opcode::OP_JumpOnTrue }, + { 0x25DF, opcode::OP_BoolNot }, + { 0x25E0, opcode::OP_GetString }, + { 0x25E1, opcode::OP_Invalid }, + { 0x25E2, opcode::OP_Invalid }, + { 0x25E3, opcode::OP_GetSelfObject }, + { 0x25E4, opcode::OP_IsDefined }, + { 0x25E5, opcode::OP_JumpOnFalseExpr }, + { 0x25E6, opcode::OP_GetSelfObject }, + { 0x25E7, opcode::OP_Invalid }, + { 0x25E8, opcode::OP_GetNegByte }, + { 0x25E9, opcode::OP_Invalid }, + { 0x25EA, opcode::OP_GetClasses }, + { 0x25EB, opcode::OP_Dec }, + { 0x25EC, opcode::OP_Invalid }, + { 0x25ED, opcode::OP_WaitTill }, + { 0x25EE, opcode::OP_GetUndefined }, + { 0x25EF, opcode::OP_GetFloat }, + { 0x25F0, opcode::OP_EvalFieldVariable }, + { 0x25F1, opcode::OP_Invalid }, + { 0x25F2, opcode::OP_Invalid }, + { 0x25F3, opcode::OP_Invalid }, + { 0x25F4, opcode::OP_Invalid }, + { 0x25F5, opcode::OP_DecTop }, + { 0x25F6, opcode::OP_Notify }, + { 0x25F7, opcode::OP_GetAnim }, + { 0x25F8, opcode::OP_ScriptMethodCall }, + { 0x25F9, opcode::OP_Invalid }, + { 0x25FA, opcode::OP_EvalLocalVariableRefCached }, + { 0x25FB, opcode::OP_SafeDecTop }, + { 0x25FC, opcode::OP_JumpOnTrueExpr }, + { 0x25FD, opcode::OP_Invalid }, + { 0x25FE, opcode::OP_Invalid }, + { 0x25FF, opcode::OP_Equal }, + { 0x2600, opcode::OP_EvalArray }, + { 0x2601, opcode::OP_Invalid }, + { 0x2602, opcode::OP_Invalid }, + { 0x2603, opcode::OP_Invalid }, + { 0x2604, opcode::OP_Invalid }, + { 0x2605, opcode::OP_SetVariableField }, + { 0x2606, opcode::OP_GetWorld }, + { 0x2607, opcode::OP_Plus }, + { 0x2608, opcode::OP_Invalid }, + { 0x2609, opcode::OP_ClearArray }, + { 0x260A, opcode::OP_Invalid }, + { 0x260B, opcode::OP_Invalid }, + { 0x260C, opcode::OP_Invalid }, + { 0x260D, opcode::OP_WaitTillMatch }, + { 0x260E, opcode::OP_ScriptFunctionCall }, + { 0x260F, opcode::OP_LevelEvalFieldVariableRef }, + { 0x2610, opcode::OP_Invalid }, + { 0x2611, opcode::OP_Invalid }, + { 0x2612, opcode::OP_NextArrayKey }, + { 0x2613, opcode::OP_LessThanOrEqualTo }, + { 0x2614, opcode::OP_GreaterThan }, + { 0x2615, opcode::OP_GetGame }, + { 0x2616, opcode::OP_CastBool }, + { 0x2617, opcode::OP_Invalid }, + { 0x2618, opcode::OP_Notify }, + { 0x2619, opcode::OP_GetWorld }, + { 0x261A, opcode::OP_NextArrayKey }, + { 0x261B, opcode::OP_Invalid }, + { 0x261C, opcode::OP_ScriptMethodCall }, + { 0x261D, opcode::OP_LessThanOrEqualTo }, + { 0x261E, opcode::OP_GetGame }, + { 0x261F, opcode::OP_GetFunction }, + { 0x2620, opcode::OP_JumpOnFalseExpr }, + { 0x2621, opcode::OP_VectorConstant }, + { 0x2622, opcode::OP_EvalArray }, + { 0x2623, opcode::OP_Divide }, + { 0x2624, opcode::OP_Invalid }, + { 0x2625, opcode::OP_Invalid }, + { 0x2626, opcode::OP_Invalid }, + { 0x2627, opcode::OP_JumpOnFalseExpr }, + { 0x2628, opcode::OP_Invalid }, + { 0x2629, opcode::OP_Invalid }, + { 0x262A, opcode::OP_WaitTill }, + { 0x262B, opcode::OP_JumpOnFalseExpr }, + { 0x262C, opcode::OP_GetNegByte }, + { 0x262D, opcode::OP_ShiftRight }, + { 0x262E, opcode::OP_SafeSetVariableFieldCached }, + { 0x262F, opcode::OP_Return }, + { 0x2630, opcode::OP_GetLevel }, + { 0x2631, opcode::OP_Invalid }, + { 0x2632, opcode::OP_ScriptMethodCall }, + { 0x2633, opcode::OP_Multiply }, + { 0x2634, opcode::OP_SafeCreateLocalVariables }, + { 0x2635, opcode::OP_ClearArray }, + { 0x2636, opcode::OP_Invalid }, + { 0x2637, opcode::OP_Invalid }, + { 0x2638, opcode::OP_Invalid }, + { 0x2639, opcode::OP_GetClasses }, + { 0x263A, opcode::OP_EvalFieldVariable }, + { 0x263B, opcode::OP_BoolNot }, + { 0x263C, opcode::OP_WaitTillFrameEnd }, + { 0x263D, opcode::OP_Invalid }, + { 0x263E, opcode::OP_SafeSetVariableFieldCached }, + { 0x263F, opcode::OP_SelfEvalFieldVariableRef }, + { 0x2640, opcode::OP_WaitTillMatch }, + { 0x2641, opcode::OP_Invalid }, + { 0x2642, opcode::OP_ScriptFunctionCall }, + { 0x2643, opcode::OP_Invalid }, + { 0x2644, opcode::OP_Invalid }, + { 0x2645, opcode::OP_WaitTillFrameEnd }, + { 0x2646, opcode::OP_EvalFieldVariableRef }, + { 0x2647, opcode::OP_ScriptFunctionCallClass }, + { 0x2648, opcode::OP_GetAnimObject }, + { 0x2649, opcode::OP_Invalid }, + { 0x264A, opcode::OP_Invalid }, + { 0x264B, opcode::OP_GetAnimation }, + { 0x264C, opcode::OP_GetAnimObject }, + { 0x264D, opcode::OP_Switch }, + { 0x264E, opcode::OP_EvalLocalVariableCached }, + { 0x264F, opcode::OP_CallBuiltinMethod }, + { 0x2650, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x2651, opcode::OP_JumpOnFalseExpr }, + { 0x2652, opcode::OP_CastBool }, + { 0x2653, opcode::OP_Multiply }, + { 0x2654, opcode::OP_Invalid }, + { 0x2655, opcode::OP_Invalid }, + { 0x2656, opcode::OP_Multiply }, + { 0x2657, opcode::OP_Invalid }, + { 0x2658, opcode::OP_ScriptMethodThreadCall }, + { 0x2659, opcode::OP_SizeOf }, + { 0x265A, opcode::OP_WaitTillMatch }, + { 0x265B, opcode::OP_GetFloat }, + { 0x265C, opcode::OP_EmptyArray }, + { 0x265D, opcode::OP_ScriptFunctionCallPointer }, + { 0x265E, opcode::OP_GetNegUnsignedShort }, + { 0x265F, opcode::OP_SizeOf }, + { 0x2660, opcode::OP_EvalLocalVariableCached }, + { 0x2661, opcode::OP_LevelEvalFieldVariable }, + { 0x2662, opcode::OP_EvalLocalVariableCached }, + { 0x2663, opcode::OP_ScriptThreadCallClass }, + { 0x2664, opcode::OP_Invalid }, + { 0x2665, opcode::OP_Invalid }, + { 0x2666, opcode::OP_GetFloat }, + { 0x2667, opcode::OP_Invalid }, + { 0x2668, opcode::OP_ScriptMethodCallPointer }, + { 0x2669, opcode::OP_LevelEvalFieldVariable }, + { 0x266A, opcode::OP_ClearFieldVariable }, + { 0x266B, opcode::OP_Invalid }, + { 0x266C, opcode::OP_Invalid }, + { 0x266D, opcode::OP_CastBool }, + { 0x266E, opcode::OP_Invalid }, + { 0x266F, opcode::OP_Invalid }, + { 0x2670, opcode::OP_GetByte }, + { 0x2671, opcode::OP_Invalid }, + { 0x2672, opcode::OP_ScriptFunctionCall }, + { 0x2673, opcode::OP_GetLevel }, + { 0x2674, opcode::OP_Invalid }, + { 0x2675, opcode::OP_GetAnim }, + { 0x2676, opcode::OP_GreaterThan }, + { 0x2677, opcode::OP_JumpOnFalseExpr }, + { 0x2678, opcode::OP_ProfileStart }, + { 0x2679, opcode::OP_SizeOf }, + { 0x267A, opcode::OP_ScriptThreadCallClass }, + { 0x267B, opcode::OP_Invalid }, + { 0x267C, opcode::OP_Invalid }, + { 0x267D, opcode::OP_NotEqual }, + { 0x267E, opcode::OP_Invalid }, + { 0x267F, opcode::OP_Invalid }, + { 0x2680, opcode::OP_Invalid }, + { 0x2681, opcode::OP_Switch }, + { 0x2682, opcode::OP_GetByte }, + { 0x2683, opcode::OP_Invalid }, + { 0x2684, opcode::OP_Invalid }, + { 0x2685, opcode::OP_WaitTillMatch }, + { 0x2686, opcode::OP_NextArrayKey }, + { 0x2687, opcode::OP_Invalid }, + { 0x2688, opcode::OP_BoolNot }, + { 0x2689, opcode::OP_Invalid }, + { 0x268A, opcode::OP_SetVariableField }, + { 0x268B, opcode::OP_GetFloat }, + { 0x268C, opcode::OP_GetGameRef }, + { 0x268D, opcode::OP_FirstArrayKey }, + { 0x268E, opcode::OP_Jump }, + { 0x268F, opcode::OP_EvalLocalVariableRefCached }, + { 0x2690, opcode::OP_ScriptThreadCallClass }, + { 0x2691, opcode::OP_Invalid }, + { 0x2692, opcode::OP_Return }, + { 0x2693, opcode::OP_Invalid }, + { 0x2694, opcode::OP_NextArrayKey }, + { 0x2695, opcode::OP_GetSelf }, + { 0x2696, opcode::OP_VectorScale }, + { 0x2697, opcode::OP_GetLevelObject }, + { 0x2698, opcode::OP_JumpOnFalseExpr }, + { 0x2699, opcode::OP_GetNegUnsignedShort }, + { 0x269A, opcode::OP_Invalid }, + { 0x269B, opcode::OP_Invalid }, + { 0x269C, opcode::OP_GreaterThan }, + { 0x269D, opcode::OP_GetUndefined }, + { 0x269E, opcode::OP_Invalid }, + { 0x269F, opcode::OP_GetAnimation }, + { 0x26A0, opcode::OP_Invalid }, + { 0x26A1, opcode::OP_Invalid }, + { 0x26A2, opcode::OP_GetUndefined }, + { 0x26A3, opcode::OP_Bit_And }, + { 0x26A4, opcode::OP_Invalid }, + { 0x26A5, opcode::OP_Invalid }, + { 0x26A6, opcode::OP_JumpOnTrue }, + { 0x26A7, opcode::OP_SelfEvalFieldVariableRef }, + { 0x26A8, opcode::OP_Invalid }, + { 0x26A9, opcode::OP_NotEqual }, + { 0x26AA, opcode::OP_SuperNotEqual }, + { 0x26AB, opcode::OP_RealWait }, + { 0x26AC, opcode::OP_Invalid }, + { 0x26AD, opcode::OP_GetWorldObject }, + { 0x26AE, opcode::OP_GetAnimObject }, + { 0x26AF, opcode::OP_ScriptMethodCall }, + { 0x26B0, opcode::OP_Invalid }, + { 0x26B1, opcode::OP_Invalid }, + { 0x26B2, opcode::OP_GetAnimation }, + { 0x26B3, opcode::OP_Invalid }, + { 0x26B4, opcode::OP_Invalid }, + { 0x26B5, opcode::OP_GetFloat }, + { 0x26B6, opcode::OP_Invalid }, + { 0x26B7, opcode::OP_GetUndefined }, + { 0x26B8, opcode::OP_GetZero }, + { 0x26B9, opcode::OP_ShiftRight }, + { 0x26BA, opcode::OP_Invalid }, + { 0x26BB, opcode::OP_New }, + { 0x26BC, opcode::OP_CastFieldObject }, + { 0x26BD, opcode::OP_EndSwitch }, + { 0x26BE, opcode::OP_GetZero }, + { 0x26BF, opcode::OP_CastBool }, + { 0x26C0, opcode::OP_WaitTillFrameEnd }, + { 0x26C1, opcode::OP_Bit_And }, + { 0x26C2, opcode::OP_Invalid }, + { 0x26C3, opcode::OP_ScriptMethodCall }, + { 0x26C4, opcode::OP_EmptyArray }, + { 0x26C5, opcode::OP_Invalid }, + { 0x26C6, opcode::OP_SafeDecTop }, + { 0x26C7, opcode::OP_SizeOf }, + { 0x26C8, opcode::OP_Invalid }, + { 0x26C9, opcode::OP_GetClassesObject }, + { 0x26CA, opcode::OP_Invalid }, + { 0x26CB, opcode::OP_Notify }, + { 0x26CC, opcode::OP_GetGameRef }, + { 0x26CD, opcode::OP_Invalid }, + { 0x26CE, opcode::OP_ScriptThreadCallPointer }, + { 0x26CF, opcode::OP_Invalid }, + { 0x26D0, opcode::OP_Wait }, + { 0x26D1, opcode::OP_SuperNotEqual }, + { 0x26D2, opcode::OP_SizeOf }, + { 0x26D3, opcode::OP_GetLevel }, + { 0x26D4, opcode::OP_ScriptThreadCall }, + { 0x26D5, opcode::OP_JumpOnFalseExpr }, + { 0x26D6, opcode::OP_Invalid }, + { 0x26D7, opcode::OP_GetSelfObject }, + { 0x26D8, opcode::OP_Invalid }, + { 0x26D9, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x26DA, opcode::OP_GetSelfObject }, + { 0x26DB, opcode::OP_GetUndefined }, + { 0x26DC, opcode::OP_CastFieldObject }, + { 0x26DD, opcode::OP_GetSelf }, + { 0x26DE, opcode::OP_Divide }, + { 0x26DF, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x26E0, opcode::OP_NextArrayKey }, + { 0x26E1, opcode::OP_Invalid }, + { 0x26E2, opcode::OP_LessThanOrEqualTo }, + { 0x26E3, opcode::OP_Invalid }, + { 0x26E4, opcode::OP_Divide }, + { 0x26E5, opcode::OP_SelfEvalFieldVariable }, + { 0x26E6, opcode::OP_VectorScale }, + { 0x26E7, opcode::OP_JumpOnTrueExpr }, + { 0x26E8, opcode::OP_Invalid }, + { 0x26E9, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x26EA, opcode::OP_Modulus }, + { 0x26EB, opcode::OP_SafeCreateLocalVariables }, + { 0x26EC, opcode::OP_Invalid }, + { 0x26ED, opcode::OP_Invalid }, + { 0x26EE, opcode::OP_ScriptThreadCallClass }, + { 0x26EF, opcode::OP_GetAnimObject }, + { 0x26F0, opcode::OP_DevblockBegin }, + { 0x26F1, opcode::OP_Invalid }, + { 0x26F2, opcode::OP_GetUnsignedShort }, + { 0x26F3, opcode::OP_Minus }, + { 0x26F4, opcode::OP_Invalid }, + { 0x26F5, opcode::OP_Invalid }, + { 0x26F6, opcode::OP_SuperEqual }, + { 0x26F7, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x26F8, opcode::OP_Invalid }, + { 0x26F9, opcode::OP_Invalid }, + { 0x26FA, opcode::OP_DevblockBegin }, + { 0x26FB, opcode::OP_Invalid }, + { 0x26FC, opcode::OP_Invalid }, + { 0x26FD, opcode::OP_Invalid }, + { 0x26FE, opcode::OP_Invalid }, + { 0x26FF, opcode::OP_GetIString }, + { 0x2700, opcode::OP_GetAPIFunction }, + { 0x2701, opcode::OP_Invalid }, + { 0x2702, opcode::OP_EndOn }, + { 0x2703, opcode::OP_Invalid }, + { 0x2704, opcode::OP_GetAnimation }, + { 0x2705, opcode::OP_GetClasses }, + { 0x2706, opcode::OP_BoolComplement }, + { 0x2707, opcode::OP_Invalid }, + { 0x2708, opcode::OP_Invalid }, + { 0x2709, opcode::OP_JumpOnTrue }, + { 0x270A, opcode::OP_GetUndefined }, + { 0x270B, opcode::OP_JumpOnTrue }, + { 0x270C, opcode::OP_GetHash }, + { 0x270D, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x270E, opcode::OP_ShiftLeft }, + { 0x270F, opcode::OP_Invalid }, + { 0x2710, opcode::OP_EvalLocalVariableRefCached }, + { 0x2711, opcode::OP_CastBool }, + { 0x2712, opcode::OP_LessThan }, + { 0x2713, opcode::OP_GetString }, + { 0x2714, opcode::OP_Invalid }, + { 0x2715, opcode::OP_JumpOnFalse }, + { 0x2716, opcode::OP_Invalid }, + { 0x2717, opcode::OP_Equal }, + { 0x2718, opcode::OP_GetIString }, + { 0x2719, opcode::OP_Invalid }, + { 0x271A, opcode::OP_Invalid }, + { 0x271B, opcode::OP_Invalid }, + { 0x271C, opcode::OP_GetInteger }, + { 0x271D, opcode::OP_DecTop }, + { 0x271E, opcode::OP_ShiftRight }, + { 0x271F, opcode::OP_WaitTill }, + { 0x2720, opcode::OP_WaitTill }, + { 0x2721, opcode::OP_GreaterThanOrEqualTo }, + { 0x2722, opcode::OP_GetUndefined }, + { 0x2723, opcode::OP_GetIString }, + { 0x2724, opcode::OP_Invalid }, + { 0x2725, opcode::OP_GreaterThan }, + { 0x2726, opcode::OP_SelfEvalFieldVariableRef }, + { 0x2727, opcode::OP_GetInteger }, + { 0x2728, opcode::OP_BoolNot }, + { 0x2729, opcode::OP_GreaterThan }, + { 0x272A, opcode::OP_Invalid }, + { 0x272B, opcode::OP_LessThanOrEqualTo }, + { 0x272C, opcode::OP_EmptyArray }, + { 0x272D, opcode::OP_SafeCreateLocalVariables }, + { 0x272E, opcode::OP_Invalid }, + { 0x272F, opcode::OP_ScriptFunctionCallClass }, + { 0x2730, opcode::OP_GetAnimation }, + { 0x2731, opcode::OP_Invalid }, + { 0x2732, opcode::OP_CastFieldObject }, + { 0x2733, opcode::OP_ScriptThreadCall }, + { 0x2734, opcode::OP_Return }, + { 0x2735, opcode::OP_CallBuiltinMethod }, + { 0x2736, opcode::OP_Invalid }, + { 0x2737, opcode::OP_GetAnimation }, + { 0x2738, opcode::OP_Invalid }, + { 0x2739, opcode::OP_LessThan }, + { 0x273A, opcode::OP_SuperEqual }, + { 0x273B, opcode::OP_Jump }, + { 0x273C, opcode::OP_JumpOnTrue }, + { 0x273D, opcode::OP_GetHash }, + { 0x273E, opcode::OP_New }, + { 0x273F, opcode::OP_EvalArray }, + { 0x2740, opcode::OP_EndOn }, + { 0x2741, opcode::OP_GetWorld }, + { 0x2742, opcode::OP_JumpOnFalse }, + { 0x2743, opcode::OP_Invalid }, + { 0x2744, opcode::OP_Invalid }, + { 0x2745, opcode::OP_Invalid }, + { 0x2746, opcode::OP_Invalid }, + { 0x2747, opcode::OP_Invalid }, + { 0x2748, opcode::OP_DecTop }, + { 0x2749, opcode::OP_Invalid }, + { 0x274A, opcode::OP_ScriptMethodCall }, + { 0x274B, opcode::OP_Invalid }, + { 0x274C, opcode::OP_Invalid }, + { 0x274D, opcode::OP_Invalid }, + { 0x274E, opcode::OP_Invalid }, + { 0x274F, opcode::OP_CastBool }, + { 0x2750, opcode::OP_GreaterThan }, + { 0x2751, opcode::OP_Invalid }, + { 0x2752, opcode::OP_Invalid }, + { 0x2753, opcode::OP_GetClasses }, + { 0x2754, opcode::OP_IsDefined }, + { 0x2755, opcode::OP_GetLevelObject }, + { 0x2756, opcode::OP_Invalid }, + { 0x2757, opcode::OP_WaitTill }, + { 0x2758, opcode::OP_Invalid }, + { 0x2759, opcode::OP_Multiply }, + { 0x275A, opcode::OP_EvalFieldVariableRef }, + { 0x275B, opcode::OP_Invalid }, + { 0x275C, opcode::OP_Invalid }, + { 0x275D, opcode::OP_Invalid }, + { 0x275E, opcode::OP_EvalLocalVariableRefCached }, + { 0x275F, opcode::OP_Invalid }, + { 0x2760, opcode::OP_BoolNot }, + { 0x2761, opcode::OP_Invalid }, + { 0x2762, opcode::OP_Invalid }, + { 0x2763, opcode::OP_Invalid }, + { 0x2764, opcode::OP_Invalid }, + { 0x2765, opcode::OP_ShiftLeft }, + { 0x2766, opcode::OP_SetVariableField }, + { 0x2767, opcode::OP_GetAnimation }, + { 0x2768, opcode::OP_Invalid }, + { 0x2769, opcode::OP_Invalid }, + { 0x276A, opcode::OP_Invalid }, + { 0x276B, opcode::OP_GetVector }, + { 0x276C, opcode::OP_NextArrayKey }, + { 0x276D, opcode::OP_RealWait }, + { 0x276E, opcode::OP_SelfEvalFieldVariable }, + { 0x276F, opcode::OP_EndOn }, + { 0x2770, opcode::OP_GetWorld }, + { 0x2771, opcode::OP_WaitTill }, + { 0x2772, opcode::OP_Invalid }, + { 0x2773, opcode::OP_CallBuiltinMethod }, + { 0x2774, opcode::OP_Invalid }, + { 0x2775, opcode::OP_VectorScale }, + { 0x2776, opcode::OP_Return }, + { 0x2777, opcode::OP_GetIString }, + { 0x2778, opcode::OP_Invalid }, + { 0x2779, opcode::OP_Multiply }, + { 0x277A, opcode::OP_SafeDecTop }, + { 0x277B, opcode::OP_Invalid }, + { 0x277C, opcode::OP_SelfEvalFieldVariableRef }, + { 0x277D, opcode::OP_SizeOf }, + { 0x277E, opcode::OP_GetGame }, + { 0x277F, opcode::OP_GetHash }, + { 0x2780, opcode::OP_ScriptMethodThreadCall }, + { 0x2781, opcode::OP_GetUintptr }, + { 0x2782, opcode::OP_Return }, + { 0x2783, opcode::OP_Invalid }, + { 0x2784, opcode::OP_Invalid }, + { 0x2785, opcode::OP_Invalid }, + { 0x2786, opcode::OP_New }, + { 0x2787, opcode::OP_NextArrayKey }, + { 0x2788, opcode::OP_Return }, + { 0x2789, opcode::OP_New }, + { 0x278A, opcode::OP_Invalid }, + { 0x278B, opcode::OP_SuperNotEqual }, + { 0x278C, opcode::OP_Invalid }, + { 0x278D, opcode::OP_Invalid }, + { 0x278E, opcode::OP_Inc }, + { 0x278F, opcode::OP_EvalLocalVariableCached }, + { 0x2790, opcode::OP_EvalLocalVariableRefCached }, + { 0x2791, opcode::OP_WaitTillMatch }, + { 0x2792, opcode::OP_Invalid }, + { 0x2793, opcode::OP_GetFloat }, + { 0x2794, opcode::OP_Invalid }, + { 0x2795, opcode::OP_WaitTillMatch }, + { 0x2796, opcode::OP_WaitTillMatch }, + { 0x2797, opcode::OP_Bit_Xor }, + { 0x2798, opcode::OP_Invalid }, + { 0x2799, opcode::OP_WaitTillMatch }, + { 0x279A, opcode::OP_Invalid }, + { 0x279B, opcode::OP_GreaterThanOrEqualTo }, + { 0x279C, opcode::OP_EndOn }, + { 0x279D, opcode::OP_Invalid }, + { 0x279E, opcode::OP_WaitTillMatch }, + { 0x279F, opcode::OP_Modulus }, + { 0x27A0, opcode::OP_EvalArrayRef }, + { 0x27A1, opcode::OP_Invalid }, + { 0x27A2, opcode::OP_New }, + { 0x27A3, opcode::OP_Invalid }, + { 0x27A4, opcode::OP_ShiftLeft }, + { 0x27A5, opcode::OP_Divide }, + { 0x27A6, opcode::OP_Invalid }, + { 0x27A7, opcode::OP_Equal }, + { 0x27A8, opcode::OP_Invalid }, + { 0x27A9, opcode::OP_GreaterThanOrEqualTo }, + { 0x27AA, opcode::OP_Notify }, + { 0x27AB, opcode::OP_GetHash }, + { 0x27AC, opcode::OP_GetHash }, + { 0x27AD, opcode::OP_ScriptMethodThreadCall }, + { 0x27AE, opcode::OP_Invalid }, + { 0x27AF, opcode::OP_GetNegByte }, + { 0x27B0, opcode::OP_GetHash }, + { 0x27B1, opcode::OP_Invalid }, + { 0x27B2, opcode::OP_GreaterThanOrEqualTo }, + { 0x27B3, opcode::OP_Invalid }, + { 0x27B4, opcode::OP_GetUnsignedShort }, + { 0x27B5, opcode::OP_Modulus }, + { 0x27B6, opcode::OP_Invalid }, + { 0x27B7, opcode::OP_SafeSetVariableFieldCached }, + { 0x27B8, opcode::OP_SafeDecTop }, + { 0x27B9, opcode::OP_Invalid }, + { 0x27BA, opcode::OP_Invalid }, + { 0x27BB, opcode::OP_SafeSetVariableFieldCached }, + { 0x27BC, opcode::OP_GetString }, + { 0x27BD, opcode::OP_SuperEqual }, + { 0x27BE, opcode::OP_JumpOnFalseExpr }, + { 0x27BF, opcode::OP_Invalid }, + { 0x27C0, opcode::OP_ScriptMethodCallPointer }, + { 0x27C1, opcode::OP_Bit_Xor }, + { 0x27C2, opcode::OP_GetInteger }, + { 0x27C3, opcode::OP_Invalid }, + { 0x27C4, opcode::OP_WaitTill }, + { 0x27C5, opcode::OP_ClearFieldVariable }, + { 0x27C6, opcode::OP_SafeCreateLocalVariables }, + { 0x27C7, opcode::OP_SelfEvalFieldVariable }, + { 0x27C8, opcode::OP_GetGameRef }, + { 0x27C9, opcode::OP_Invalid }, + { 0x27CA, opcode::OP_Invalid }, + { 0x27CB, opcode::OP_GetClassesObject }, + { 0x27CC, opcode::OP_WaitTillMatch }, + { 0x27CD, opcode::OP_GreaterThanOrEqualTo }, + { 0x27CE, opcode::OP_GetVector }, + { 0x27CF, opcode::OP_EmptyArray }, + { 0x27D0, opcode::OP_Switch }, + { 0x27D1, opcode::OP_GetAPIFunction }, + { 0x27D2, opcode::OP_GetLevelObject }, + { 0x27D3, opcode::OP_Invalid }, + { 0x27D4, opcode::OP_Bit_And }, + { 0x27D5, opcode::OP_ScriptMethodCall }, + { 0x27D6, opcode::OP_DevblockBegin }, + { 0x27D7, opcode::OP_Invalid }, + { 0x27D8, opcode::OP_Multiply }, + { 0x27D9, opcode::OP_DevblockBegin }, + { 0x27DA, opcode::OP_Invalid }, + { 0x27DB, opcode::OP_GetLevel }, + { 0x27DC, opcode::OP_Invalid }, + { 0x27DD, opcode::OP_GetLevel }, + { 0x27DE, opcode::OP_JumpOnTrue }, + { 0x27DF, opcode::OP_ScriptThreadCall }, + { 0x27E0, opcode::OP_Invalid }, + { 0x27E1, opcode::OP_GetSelfObject }, + { 0x27E2, opcode::OP_Invalid }, + { 0x27E3, opcode::OP_Invalid }, + { 0x27E4, opcode::OP_GetZero }, + { 0x27E5, opcode::OP_Invalid }, + { 0x27E6, opcode::OP_VectorScale }, + { 0x27E7, opcode::OP_Invalid }, + { 0x27E8, opcode::OP_Invalid }, + { 0x27E9, opcode::OP_GetWorld }, + { 0x27EA, opcode::OP_EndSwitch }, + { 0x27EB, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x27EC, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x27ED, opcode::OP_Invalid }, + { 0x27EE, opcode::OP_GetClasses }, + { 0x27EF, opcode::OP_Invalid }, + { 0x27F0, opcode::OP_Jump }, + { 0x27F1, opcode::OP_GreaterThan }, + { 0x27F2, opcode::OP_ScriptThreadCallPointer }, + { 0x27F3, opcode::OP_GetSelf }, + { 0x27F4, opcode::OP_Switch }, + { 0x27F5, opcode::OP_FirstArrayKey }, + { 0x27F6, opcode::OP_Invalid }, + { 0x27F7, opcode::OP_Invalid }, + { 0x27F8, opcode::OP_Invalid }, + { 0x27F9, opcode::OP_Equal }, + { 0x27FA, opcode::OP_Invalid }, + { 0x27FB, opcode::OP_JumpOnTrue }, + { 0x27FC, opcode::OP_GetSelfObject }, + { 0x27FD, opcode::OP_GetFloat }, + { 0x27FE, opcode::OP_Invalid }, + { 0x27FF, opcode::OP_Invalid }, + { 0x2800, opcode::OP_GetUintptr }, + { 0x2801, opcode::OP_Invalid }, + { 0x2802, opcode::OP_EvalLocalVariableRefCached }, + { 0x2803, opcode::OP_IsDefined }, + { 0x2804, opcode::OP_GetUnsignedShort }, + { 0x2805, opcode::OP_EndSwitch }, + { 0x2806, opcode::OP_GetFunction }, + { 0x2807, opcode::OP_GreaterThan }, + { 0x2808, opcode::OP_ProfileStop }, + { 0x2809, opcode::OP_Invalid }, + { 0x280A, opcode::OP_GetUndefined }, + { 0x280B, opcode::OP_Invalid }, + { 0x280C, opcode::OP_SafeCreateLocalVariables }, + { 0x280D, opcode::OP_GetUnsignedShort }, + { 0x280E, opcode::OP_Invalid }, + { 0x280F, opcode::OP_Invalid }, + { 0x2810, opcode::OP_DevblockBegin }, + { 0x2811, opcode::OP_Invalid }, + { 0x2812, opcode::OP_Invalid }, + { 0x2813, opcode::OP_Divide }, + { 0x2814, opcode::OP_SafeSetVariableFieldCached }, + { 0x2815, opcode::OP_Bit_Or }, + { 0x2816, opcode::OP_Invalid }, + { 0x2817, opcode::OP_Invalid }, + { 0x2818, opcode::OP_Bit_And }, + { 0x2819, opcode::OP_GetNegByte }, + { 0x281A, opcode::OP_GetFunction }, + { 0x281B, opcode::OP_ShiftLeft }, + { 0x281C, opcode::OP_Invalid }, + { 0x281D, opcode::OP_NextArrayKey }, + { 0x281E, opcode::OP_GetSelfObject }, + { 0x281F, opcode::OP_GetAnimObject }, + { 0x2820, opcode::OP_ScriptThreadCall }, + { 0x2821, opcode::OP_ScriptThreadCallPointer }, + { 0x2822, opcode::OP_Invalid }, + { 0x2823, opcode::OP_Invalid }, + { 0x2824, opcode::OP_EvalFieldVariable }, + { 0x2825, opcode::OP_GetWorld }, + { 0x2826, opcode::OP_JumpOnTrueExpr }, + { 0x2827, opcode::OP_ShiftLeft }, + { 0x2828, opcode::OP_Invalid }, + { 0x2829, opcode::OP_Invalid }, + { 0x282A, opcode::OP_Plus }, + { 0x282B, opcode::OP_Return }, + { 0x282C, opcode::OP_GetClassesObject }, + { 0x282D, opcode::OP_Invalid }, + { 0x282E, opcode::OP_Invalid }, + { 0x282F, opcode::OP_Return }, + { 0x2830, opcode::OP_ScriptThreadCallPointer }, + { 0x2831, opcode::OP_Bit_Xor }, + { 0x2832, opcode::OP_Invalid }, + { 0x2833, opcode::OP_VectorScale }, + { 0x2834, opcode::OP_GetUndefined }, + { 0x2835, opcode::OP_Equal }, + { 0x2836, opcode::OP_SafeCreateLocalVariables }, + { 0x2837, opcode::OP_Invalid }, + { 0x2838, opcode::OP_Bit_And }, + { 0x2839, opcode::OP_GetNegByte }, + { 0x283A, opcode::OP_Bit_And }, + { 0x283B, opcode::OP_Invalid }, + { 0x283C, opcode::OP_EvalLocalVariableCached }, + { 0x283D, opcode::OP_WaitTillFrameEnd }, + { 0x283E, opcode::OP_Invalid }, + { 0x283F, opcode::OP_Invalid }, + { 0x2840, opcode::OP_Invalid }, + { 0x2841, opcode::OP_Invalid }, + { 0x2842, opcode::OP_Invalid }, + { 0x2843, opcode::OP_Vector }, + { 0x2844, opcode::OP_GetFunction }, + { 0x2845, opcode::OP_GetAnim }, + { 0x2846, opcode::OP_NextArrayKey }, + { 0x2847, opcode::OP_Notify }, + { 0x2848, opcode::OP_EvalFieldVariableRef }, + { 0x2849, opcode::OP_ScriptMethodCall }, + { 0x284A, opcode::OP_GetFunction }, + { 0x284B, opcode::OP_GetUintptr }, + { 0x284C, opcode::OP_Switch }, + { 0x284D, opcode::OP_GetAnimation }, + { 0x284E, opcode::OP_Invalid }, + { 0x284F, opcode::OP_SuperNotEqual }, + { 0x2850, opcode::OP_SelfEvalFieldVariable }, + { 0x2851, opcode::OP_New }, + { 0x2852, opcode::OP_NotEqual }, + { 0x2853, opcode::OP_Invalid }, + { 0x2854, opcode::OP_GetWorldObject }, + { 0x2855, opcode::OP_Invalid }, + { 0x2856, opcode::OP_ShiftLeft }, + { 0x2857, opcode::OP_Bit_Xor }, + { 0x2858, opcode::OP_GetAPIFunction }, + { 0x2859, opcode::OP_Invalid }, + { 0x285A, opcode::OP_GetGameRef }, + { 0x285B, opcode::OP_Invalid }, + { 0x285C, opcode::OP_Invalid }, + { 0x285D, opcode::OP_Invalid }, + { 0x285E, opcode::OP_WaitTillFrameEnd }, + { 0x285F, opcode::OP_Invalid }, + { 0x2860, opcode::OP_Inc }, + { 0x2861, opcode::OP_DevblockBegin }, + { 0x2862, opcode::OP_Invalid }, + { 0x2863, opcode::OP_GetZero }, + { 0x2864, opcode::OP_IsDefined }, + { 0x2865, opcode::OP_Invalid }, + { 0x2866, opcode::OP_BoolNot }, + { 0x2867, opcode::OP_Invalid }, + { 0x2868, opcode::OP_Invalid }, + { 0x2869, opcode::OP_EvalArray }, + { 0x286A, opcode::OP_CallBuiltinMethod }, + { 0x286B, opcode::OP_Invalid }, + { 0x286C, opcode::OP_Invalid }, + { 0x286D, opcode::OP_SafeDecTop }, + { 0x286E, opcode::OP_GetLevel }, + { 0x286F, opcode::OP_ProfileStart }, + { 0x2870, opcode::OP_ScriptFunctionCall }, + { 0x2871, opcode::OP_Invalid }, + { 0x2872, opcode::OP_Invalid }, + { 0x2873, opcode::OP_Return }, + { 0x2874, opcode::OP_SelfEvalFieldVariableRef }, + { 0x2875, opcode::OP_WaitTillMatch }, + { 0x2876, opcode::OP_WaitTillFrameEnd }, + { 0x2877, opcode::OP_Invalid }, + { 0x2878, opcode::OP_GetAnimObject }, + { 0x2879, opcode::OP_GetNegUnsignedShort }, + { 0x287A, opcode::OP_Invalid }, + { 0x287B, opcode::OP_Invalid }, + { 0x287C, opcode::OP_GetVector }, + { 0x287D, opcode::OP_LevelEvalFieldVariable }, + { 0x287E, opcode::OP_GetIString }, + { 0x287F, opcode::OP_EmptyArray }, + { 0x2880, opcode::OP_Invalid }, + { 0x2881, opcode::OP_Equal }, + { 0x2882, opcode::OP_GetLevel }, + { 0x2883, opcode::OP_GetAnim }, + { 0x2884, opcode::OP_Invalid }, + { 0x2885, opcode::OP_Equal }, + { 0x2886, opcode::OP_GetGame }, + { 0x2887, opcode::OP_Invalid }, + { 0x2888, opcode::OP_SelfEvalFieldVariableRef }, + { 0x2889, opcode::OP_Invalid }, + { 0x288A, opcode::OP_GetAnimObject }, + { 0x288B, opcode::OP_GetAnim }, + { 0x288C, opcode::OP_Switch }, + { 0x288D, opcode::OP_Minus }, + { 0x288E, opcode::OP_LevelEvalFieldVariable }, + { 0x288F, opcode::OP_SizeOf }, + { 0x2890, opcode::OP_GetString }, + { 0x2891, opcode::OP_Invalid }, + { 0x2892, opcode::OP_New }, + { 0x2893, opcode::OP_EndSwitch }, + { 0x2894, opcode::OP_Invalid }, + { 0x2895, opcode::OP_IsDefined }, + { 0x2896, opcode::OP_GreaterThanOrEqualTo }, + { 0x2897, opcode::OP_GetLevel }, + { 0x2898, opcode::OP_SafeCreateLocalVariables }, + { 0x2899, opcode::OP_Invalid }, + { 0x289A, opcode::OP_WaitTillMatch }, + { 0x289B, opcode::OP_GetAPIFunction }, + { 0x289C, opcode::OP_IsDefined }, + { 0x289D, opcode::OP_Invalid }, + { 0x289E, opcode::OP_Invalid }, + { 0x289F, opcode::OP_Bit_And }, + { 0x28A0, opcode::OP_Minus }, + { 0x28A1, opcode::OP_EmptyArray }, + { 0x28A2, opcode::OP_JumpOnFalse }, + { 0x28A3, opcode::OP_JumpOnFalse }, + { 0x28A4, opcode::OP_Bit_Xor }, + { 0x28A5, opcode::OP_Invalid }, + { 0x28A6, opcode::OP_Invalid }, + { 0x28A7, opcode::OP_GetAnim }, + { 0x28A8, opcode::OP_Invalid }, + { 0x28A9, opcode::OP_Invalid }, + { 0x28AA, opcode::OP_JumpOnTrueExpr }, + { 0x28AB, opcode::OP_GetUnsignedShort }, + { 0x28AC, opcode::OP_Invalid }, + { 0x28AD, opcode::OP_LessThanOrEqualTo }, + { 0x28AE, opcode::OP_Invalid }, + { 0x28AF, opcode::OP_EmptyArray }, + { 0x28B0, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x28B1, opcode::OP_Invalid }, + { 0x28B2, opcode::OP_SelfEvalFieldVariable }, + { 0x28B3, opcode::OP_SelfEvalFieldVariable }, + { 0x28B4, opcode::OP_WaitTillMatch }, + { 0x28B5, opcode::OP_GetByte }, + { 0x28B6, opcode::OP_GreaterThan }, + { 0x28B7, opcode::OP_Inc }, + { 0x28B8, opcode::OP_GetSelfObject }, + { 0x28B9, opcode::OP_Invalid }, + { 0x28BA, opcode::OP_Invalid }, + { 0x28BB, opcode::OP_SetVariableField }, + { 0x28BC, opcode::OP_Invalid }, + { 0x28BD, opcode::OP_FirstArrayKey }, + { 0x28BE, opcode::OP_Invalid }, + { 0x28BF, opcode::OP_ScriptFunctionCall }, + { 0x28C0, opcode::OP_LessThan }, + { 0x28C1, opcode::OP_GetClassesObject }, + { 0x28C2, opcode::OP_JumpOnFalseExpr }, + { 0x28C3, opcode::OP_CallBuiltinMethod }, + { 0x28C4, opcode::OP_GetClasses }, + { 0x28C5, opcode::OP_GetUintptr }, + { 0x28C6, opcode::OP_Invalid }, + { 0x28C7, opcode::OP_WaitTillMatch }, + { 0x28C8, opcode::OP_Invalid }, + { 0x28C9, opcode::OP_NotEqual }, + { 0x28CA, opcode::OP_SizeOf }, + { 0x28CB, opcode::OP_Invalid }, + { 0x28CC, opcode::OP_GetSelf }, + { 0x28CD, opcode::OP_Invalid }, + { 0x28CE, opcode::OP_VectorConstant }, + { 0x28CF, opcode::OP_SelfEvalFieldVariableRef }, + { 0x28D0, opcode::OP_RealWait }, + { 0x28D1, opcode::OP_ScriptMethodCallPointer }, + { 0x28D2, opcode::OP_LessThan }, + { 0x28D3, opcode::OP_Invalid }, + { 0x28D4, opcode::OP_Invalid }, + { 0x28D5, opcode::OP_Invalid }, + { 0x28D6, opcode::OP_VectorConstant }, + { 0x28D7, opcode::OP_ScriptThreadCallPointer }, + { 0x28D8, opcode::OP_GetLevelObject }, + { 0x28D9, opcode::OP_EvalArray }, + { 0x28DA, opcode::OP_EvalFieldVariable }, + { 0x28DB, opcode::OP_ScriptThreadCall }, + { 0x28DC, opcode::OP_Invalid }, + { 0x28DD, opcode::OP_ProfileStop }, + { 0x28DE, opcode::OP_Bit_Xor }, + { 0x28DF, opcode::OP_GetString }, + { 0x28E0, opcode::OP_JumpOnTrue }, + { 0x28E1, opcode::OP_BoolNot }, + { 0x28E2, opcode::OP_Invalid }, + { 0x28E3, opcode::OP_ScriptFunctionCall }, + { 0x28E4, opcode::OP_Invalid }, + { 0x28E5, opcode::OP_Invalid }, + { 0x28E6, opcode::OP_BoolComplement }, + { 0x28E7, opcode::OP_GetVector }, + { 0x28E8, opcode::OP_ShiftLeft }, + { 0x28E9, opcode::OP_LessThanOrEqualTo }, + { 0x28EA, opcode::OP_LessThan }, + { 0x28EB, opcode::OP_Invalid }, + { 0x28EC, opcode::OP_Dec }, + { 0x28ED, opcode::OP_Jump }, + { 0x28EE, opcode::OP_WaitTill }, + { 0x28EF, opcode::OP_GetIString }, + { 0x28F0, opcode::OP_Invalid }, + { 0x28F1, opcode::OP_BoolNot }, + { 0x28F2, opcode::OP_Invalid }, + { 0x28F3, opcode::OP_LevelEvalFieldVariable }, + { 0x28F4, opcode::OP_Invalid }, + { 0x28F5, opcode::OP_BoolComplement }, + { 0x28F6, opcode::OP_VectorScale }, + { 0x28F7, opcode::OP_New }, + { 0x28F8, opcode::OP_GetAPIFunction }, + { 0x28F9, opcode::OP_GreaterThan }, + { 0x28FA, opcode::OP_VectorScale }, + { 0x28FB, opcode::OP_GetWorldObject }, + { 0x28FC, opcode::OP_Invalid }, + { 0x28FD, opcode::OP_Invalid }, + { 0x28FE, opcode::OP_LessThanOrEqualTo }, + { 0x28FF, opcode::OP_New }, + { 0x2900, opcode::OP_VectorConstant }, + { 0x2901, opcode::OP_ScriptFunctionCallPointer }, + { 0x2902, opcode::OP_GetWorld }, + { 0x2903, opcode::OP_IsDefined }, + { 0x2904, opcode::OP_WaitTill }, + { 0x2905, opcode::OP_VectorConstant }, + { 0x2906, opcode::OP_ScriptFunctionCallClass }, + { 0x2907, opcode::OP_Plus }, + { 0x2908, opcode::OP_LessThanOrEqualTo }, + { 0x2909, opcode::OP_GetSelfObject }, + { 0x290A, opcode::OP_JumpOnFalse }, + { 0x290B, opcode::OP_ScriptThreadCallClass }, + { 0x290C, opcode::OP_Invalid }, + { 0x290D, opcode::OP_Notify }, + { 0x290E, opcode::OP_Invalid }, + { 0x290F, opcode::OP_SafeSetVariableFieldCached }, + { 0x2910, opcode::OP_ScriptThreadCall }, + { 0x2911, opcode::OP_Invalid }, + { 0x2912, opcode::OP_Invalid }, + { 0x2913, opcode::OP_GetIString }, + { 0x2914, opcode::OP_Invalid }, + { 0x2915, opcode::OP_GetAnimation }, + { 0x2916, opcode::OP_LessThan }, + { 0x2917, opcode::OP_JumpOnTrue }, + { 0x2918, opcode::OP_Bit_Or }, + { 0x2919, opcode::OP_Invalid }, + { 0x291A, opcode::OP_Invalid }, + { 0x291B, opcode::OP_SizeOf }, + { 0x291C, opcode::OP_Inc }, + { 0x291D, opcode::OP_Invalid }, + { 0x291E, opcode::OP_Invalid }, + { 0x291F, opcode::OP_Invalid }, + { 0x2920, opcode::OP_New }, + { 0x2921, opcode::OP_Invalid }, + { 0x2922, opcode::OP_GetWorld }, + { 0x2923, opcode::OP_BoolComplement }, + { 0x2924, opcode::OP_Invalid }, + { 0x2925, opcode::OP_Wait }, + { 0x2926, opcode::OP_Invalid }, + { 0x2927, opcode::OP_Invalid }, + { 0x2928, opcode::OP_Equal }, + { 0x2929, opcode::OP_GetAnim }, + { 0x292A, opcode::OP_CallBuiltinMethod }, + { 0x292B, opcode::OP_EvalLocalVariableCached }, + { 0x292C, opcode::OP_EvalLocalVariableCached }, + { 0x292D, opcode::OP_ShiftLeft }, + { 0x292E, opcode::OP_NextArrayKey }, + { 0x292F, opcode::OP_Switch }, + { 0x2930, opcode::OP_Invalid }, + { 0x2931, opcode::OP_GetVector }, + { 0x2932, opcode::OP_Invalid }, + { 0x2933, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x2934, opcode::OP_JumpOnTrue }, + { 0x2935, opcode::OP_EvalFieldVariableRef }, + { 0x2936, opcode::OP_Invalid }, + { 0x2937, opcode::OP_GetAnimObject }, + { 0x2938, opcode::OP_New }, + { 0x2939, opcode::OP_ScriptFunctionCall }, + { 0x293A, opcode::OP_New }, + { 0x293B, opcode::OP_WaitTill }, + { 0x293C, opcode::OP_Invalid }, + { 0x293D, opcode::OP_SizeOf }, + { 0x293E, opcode::OP_GreaterThanOrEqualTo }, + { 0x293F, opcode::OP_Invalid }, + { 0x2940, opcode::OP_Invalid }, + { 0x2941, opcode::OP_Dec }, + { 0x2942, opcode::OP_ScriptMethodCall }, + { 0x2943, opcode::OP_Invalid }, + { 0x2944, opcode::OP_GetGame }, + { 0x2945, opcode::OP_Invalid }, + { 0x2946, opcode::OP_Invalid }, + { 0x2947, opcode::OP_Vector }, + { 0x2948, opcode::OP_SetVariableField }, + { 0x2949, opcode::OP_ScriptThreadCallPointer }, + { 0x294A, opcode::OP_GetHash }, + { 0x294B, opcode::OP_EvalFieldVariableRef }, + { 0x294C, opcode::OP_ScriptFunctionCallPointer }, + { 0x294D, opcode::OP_Invalid }, + { 0x294E, opcode::OP_LevelEvalFieldVariableRef }, + { 0x294F, opcode::OP_Invalid }, + { 0x2950, opcode::OP_GetWorldObject }, + { 0x2951, opcode::OP_Invalid }, + { 0x2952, opcode::OP_Invalid }, + { 0x2953, opcode::OP_Invalid }, + { 0x2954, opcode::OP_EvalFieldVariable }, + { 0x2955, opcode::OP_Invalid }, + { 0x2956, opcode::OP_GetTime }, + { 0x2957, opcode::OP_EvalFieldVariable }, + { 0x2958, opcode::OP_Invalid }, + { 0x2959, opcode::OP_GetFloat }, + { 0x295A, opcode::OP_SetVariableField }, + { 0x295B, opcode::OP_Bit_Or }, + { 0x295C, opcode::OP_EvalArray }, + { 0x295D, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x295E, opcode::OP_VectorScale }, + { 0x295F, opcode::OP_ScriptMethodCall }, + { 0x2960, opcode::OP_Divide }, + { 0x2961, opcode::OP_NextArrayKey }, + { 0x2962, opcode::OP_Invalid }, + { 0x2963, opcode::OP_EvalArray }, + { 0x2964, opcode::OP_Invalid }, + { 0x2965, opcode::OP_Invalid }, + { 0x2966, opcode::OP_Bit_And }, + { 0x2967, opcode::OP_Equal }, + { 0x2968, opcode::OP_Invalid }, + { 0x2969, opcode::OP_SafeSetVariableFieldCached }, + { 0x296A, opcode::OP_Minus }, + { 0x296B, opcode::OP_FirstArrayKey }, + { 0x296C, opcode::OP_Invalid }, + { 0x296D, opcode::OP_Plus }, + { 0x296E, opcode::OP_GetLevel }, + { 0x296F, opcode::OP_GetAPIFunction }, + { 0x2970, opcode::OP_ProfileStart }, + { 0x2971, opcode::OP_Invalid }, + { 0x2972, opcode::OP_WaitTillFrameEnd }, + { 0x2973, opcode::OP_BoolComplement }, + { 0x2974, opcode::OP_Invalid }, + { 0x2975, opcode::OP_Invalid }, + { 0x2976, opcode::OP_Notify }, + { 0x2977, opcode::OP_Invalid }, + { 0x2978, opcode::OP_GetHash }, + { 0x2979, opcode::OP_GetAnimObject }, + { 0x297A, opcode::OP_ScriptThreadCall }, + { 0x297B, opcode::OP_Invalid }, + { 0x297C, opcode::OP_Invalid }, + { 0x297D, opcode::OP_Bit_And }, + { 0x297E, opcode::OP_EvalFieldVariableRef }, + { 0x297F, opcode::OP_JumpOnTrueExpr }, + { 0x2980, opcode::OP_Bit_Xor }, + { 0x2981, opcode::OP_Invalid }, + { 0x2982, opcode::OP_GetSelfObject }, + { 0x2983, opcode::OP_Invalid }, + { 0x2984, opcode::OP_Invalid }, + { 0x2985, opcode::OP_GetFunction }, + { 0x2986, opcode::OP_GetAnimObject }, + { 0x2987, opcode::OP_GetUnsignedShort }, + { 0x2988, opcode::OP_Invalid }, + { 0x2989, opcode::OP_Invalid }, + { 0x298A, opcode::OP_ScriptFunctionCall }, + { 0x298B, opcode::OP_EvalLocalVariableCached }, + { 0x298C, opcode::OP_Invalid }, + { 0x298D, opcode::OP_ScriptMethodThreadCall }, + { 0x298E, opcode::OP_Invalid }, + { 0x298F, opcode::OP_Invalid }, + { 0x2990, opcode::OP_EvalArray }, + { 0x2991, opcode::OP_GetNegUnsignedShort }, + { 0x2992, opcode::OP_EvalArray }, + { 0x2993, opcode::OP_Invalid }, + { 0x2994, opcode::OP_Invalid }, + { 0x2995, opcode::OP_Invalid }, + { 0x2996, opcode::OP_Invalid }, + { 0x2997, opcode::OP_GetUintptr }, + { 0x2998, opcode::OP_GetGameRef }, + { 0x2999, opcode::OP_Invalid }, + { 0x299A, opcode::OP_EvalFieldVariableRef }, + { 0x299B, opcode::OP_JumpOnFalse }, + { 0x299C, opcode::OP_GetIString }, + { 0x299D, opcode::OP_Jump }, + { 0x299E, opcode::OP_GetZero }, + { 0x299F, opcode::OP_GreaterThanOrEqualTo }, + { 0x29A0, opcode::OP_Invalid }, + { 0x29A1, opcode::OP_Invalid }, + { 0x29A2, opcode::OP_Invalid }, + { 0x29A3, opcode::OP_Invalid }, + { 0x29A4, opcode::OP_Invalid }, + { 0x29A5, opcode::OP_GetWorldObject }, + { 0x29A6, opcode::OP_LevelEvalFieldVariable }, + { 0x29A7, opcode::OP_WaitTillMatch }, + { 0x29A8, opcode::OP_GetString }, + { 0x29A9, opcode::OP_Invalid }, + { 0x29AA, opcode::OP_Invalid }, + { 0x29AB, opcode::OP_IsDefined }, + { 0x29AC, opcode::OP_EvalArray }, + { 0x29AD, opcode::OP_GetNegByte }, + { 0x29AE, opcode::OP_GetGame }, + { 0x29AF, opcode::OP_WaitTillMatch }, + { 0x29B0, opcode::OP_Invalid }, + { 0x29B1, opcode::OP_Wait }, + { 0x29B2, opcode::OP_Invalid }, + { 0x29B3, opcode::OP_Invalid }, + { 0x29B4, opcode::OP_EndSwitch }, + { 0x29B5, opcode::OP_GetString }, + { 0x29B6, opcode::OP_Wait }, + { 0x29B7, opcode::OP_Minus }, + { 0x29B8, opcode::OP_Invalid }, + { 0x29B9, opcode::OP_Invalid }, + { 0x29BA, opcode::OP_GetLevel }, + { 0x29BB, opcode::OP_ScriptThreadCallClass }, + { 0x29BC, opcode::OP_Minus }, + { 0x29BD, opcode::OP_BoolNot }, + { 0x29BE, opcode::OP_Invalid }, + { 0x29BF, opcode::OP_EvalFieldVariableRef }, + { 0x29C0, opcode::OP_ScriptMethodCallPointer }, + { 0x29C1, opcode::OP_Wait }, + { 0x29C2, opcode::OP_RealWait }, + { 0x29C3, opcode::OP_EvalFieldVariableRef }, + { 0x29C4, opcode::OP_Invalid }, + { 0x29C5, opcode::OP_LessThanOrEqualTo }, + { 0x29C6, opcode::OP_SelfEvalFieldVariable }, + { 0x29C7, opcode::OP_Invalid }, + { 0x29C8, opcode::OP_ScriptMethodCall }, + { 0x29C9, opcode::OP_Invalid }, + { 0x29CA, opcode::OP_WaitTillFrameEnd }, + { 0x29CB, opcode::OP_EmptyArray }, + { 0x29CC, opcode::OP_GreaterThan }, + { 0x29CD, opcode::OP_Bit_And }, + { 0x29CE, opcode::OP_EvalArray }, + { 0x29CF, opcode::OP_ProfileStop }, + { 0x29D0, opcode::OP_Invalid }, + { 0x29D1, opcode::OP_Notify }, + { 0x29D2, opcode::OP_VectorConstant }, + { 0x29D3, opcode::OP_ClearFieldVariable }, + { 0x29D4, opcode::OP_Plus }, + { 0x29D5, opcode::OP_Invalid }, + { 0x29D6, opcode::OP_SafeDecTop }, + { 0x29D7, opcode::OP_VectorConstant }, + { 0x29D8, opcode::OP_Invalid }, + { 0x29D9, opcode::OP_EvalLocalVariableRefCached }, + { 0x29DA, opcode::OP_GetAnimObject }, + { 0x29DB, opcode::OP_SafeCreateLocalVariables }, + { 0x29DC, opcode::OP_GetSelf }, + { 0x29DD, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x29DE, opcode::OP_GetClassesObject }, + { 0x29DF, opcode::OP_Invalid }, + { 0x29E0, opcode::OP_SelfEvalFieldVariableRef }, + { 0x29E1, opcode::OP_Invalid }, + { 0x29E2, opcode::OP_Invalid }, + { 0x29E3, opcode::OP_GetByte }, + { 0x29E4, opcode::OP_GreaterThan }, + { 0x29E5, opcode::OP_ScriptFunctionCall }, + { 0x29E6, opcode::OP_Inc }, + { 0x29E7, opcode::OP_EndSwitch }, + { 0x29E8, opcode::OP_SizeOf }, + { 0x29E9, opcode::OP_Invalid }, + { 0x29EA, opcode::OP_Invalid }, + { 0x29EB, opcode::OP_Invalid }, + { 0x29EC, opcode::OP_LessThan }, + { 0x29ED, opcode::OP_Invalid }, + { 0x29EE, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x29EF, opcode::OP_Invalid }, + { 0x29F0, opcode::OP_Invalid }, + { 0x29F1, opcode::OP_ScriptThreadCallPointer }, + { 0x29F2, opcode::OP_WaitTillFrameEnd }, + { 0x29F3, opcode::OP_Invalid }, + { 0x29F4, opcode::OP_SelfEvalFieldVariableRef }, + { 0x29F5, opcode::OP_ScriptFunctionCall }, + { 0x29F6, opcode::OP_SelfEvalFieldVariable }, + { 0x29F7, opcode::OP_Invalid }, + { 0x29F8, opcode::OP_ClearArray }, + { 0x29F9, opcode::OP_CallBuiltinMethod }, + { 0x29FA, opcode::OP_Invalid }, + { 0x29FB, opcode::OP_LevelEvalFieldVariable }, + { 0x29FC, opcode::OP_GetZero }, + { 0x29FD, opcode::OP_Invalid }, + { 0x29FE, opcode::OP_Invalid }, + { 0x29FF, opcode::OP_Invalid }, + { 0x2A00, opcode::OP_Invalid }, + { 0x2A01, opcode::OP_Invalid }, + { 0x2A02, opcode::OP_CallBuiltinMethod }, + { 0x2A03, opcode::OP_Invalid }, + { 0x2A04, opcode::OP_Invalid }, + { 0x2A05, opcode::OP_GetUndefined }, + { 0x2A06, opcode::OP_EvalLocalVariableRefCached }, + { 0x2A07, opcode::OP_Invalid }, + { 0x2A08, opcode::OP_RealWait }, + { 0x2A09, opcode::OP_SelfEvalFieldVariable }, + { 0x2A0A, opcode::OP_GreaterThan }, + { 0x2A0B, opcode::OP_Invalid }, + { 0x2A0C, opcode::OP_Invalid }, + { 0x2A0D, opcode::OP_JumpOnFalseExpr }, + { 0x2A0E, opcode::OP_Invalid }, + { 0x2A0F, opcode::OP_Invalid }, + { 0x2A10, opcode::OP_GetAnim }, + { 0x2A11, opcode::OP_ScriptFunctionCallPointer }, + { 0x2A12, opcode::OP_FirstArrayKey }, + { 0x2A13, opcode::OP_ScriptFunctionCallPointer }, + { 0x2A14, opcode::OP_Invalid }, + { 0x2A15, opcode::OP_GetFloat }, + { 0x2A16, opcode::OP_Invalid }, + { 0x2A17, opcode::OP_Invalid }, + { 0x2A18, opcode::OP_Invalid }, + { 0x2A19, opcode::OP_ClearFieldVariable }, + { 0x2A1A, opcode::OP_Invalid }, + { 0x2A1B, opcode::OP_WaitTillFrameEnd }, + { 0x2A1C, opcode::OP_VectorConstant }, + { 0x2A1D, opcode::OP_LessThan }, + { 0x2A1E, opcode::OP_Bit_And }, + { 0x2A1F, opcode::OP_ShiftRight }, + { 0x2A20, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x2A21, opcode::OP_Invalid }, + { 0x2A22, opcode::OP_Invalid }, + { 0x2A23, opcode::OP_BoolNot }, + { 0x2A24, opcode::OP_JumpOnTrue }, + { 0x2A25, opcode::OP_SizeOf }, + { 0x2A26, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x2A27, opcode::OP_GetSelf }, + { 0x2A28, opcode::OP_Invalid }, + { 0x2A29, opcode::OP_Invalid }, + { 0x2A2A, opcode::OP_GetClasses }, + { 0x2A2B, opcode::OP_Notify }, + { 0x2A2C, opcode::OP_ClearFieldVariable }, + { 0x2A2D, opcode::OP_JumpOnFalse }, + { 0x2A2E, opcode::OP_ShiftRight }, + { 0x2A2F, opcode::OP_Invalid }, + { 0x2A30, opcode::OP_Bit_And }, + { 0x2A31, opcode::OP_LessThan }, + { 0x2A32, opcode::OP_GetSelf }, + { 0x2A33, opcode::OP_EvalFieldVariableRef }, + { 0x2A34, opcode::OP_GetUnsignedShort }, + { 0x2A35, opcode::OP_EvalLocalVariableRefCached }, + { 0x2A36, opcode::OP_IsDefined }, + { 0x2A37, opcode::OP_GetAPIFunction }, + { 0x2A38, opcode::OP_JumpOnTrue }, + { 0x2A39, opcode::OP_GetGame }, + { 0x2A3A, opcode::OP_Invalid }, + { 0x2A3B, opcode::OP_Invalid }, + { 0x2A3C, opcode::OP_EndSwitch }, + { 0x2A3D, opcode::OP_GetUndefined }, + { 0x2A3E, opcode::OP_Wait }, + { 0x2A3F, opcode::OP_Invalid }, + { 0x2A40, opcode::OP_WaitTill }, + { 0x2A41, opcode::OP_Inc }, + { 0x2A42, opcode::OP_Bit_Xor }, + { 0x2A43, opcode::OP_GetAnim }, + { 0x2A44, opcode::OP_Invalid }, + { 0x2A45, opcode::OP_GetWorld }, + { 0x2A46, opcode::OP_GetInteger }, + { 0x2A47, opcode::OP_EndOn }, + { 0x2A48, opcode::OP_SafeDecTop }, + { 0x2A49, opcode::OP_WaitTill }, + { 0x2A4A, opcode::OP_GetAnimation }, + { 0x2A4B, opcode::OP_EndSwitch }, + { 0x2A4C, opcode::OP_Wait }, + { 0x2A4D, opcode::OP_Modulus }, + { 0x2A4E, opcode::OP_RealWait }, + { 0x2A4F, opcode::OP_Invalid }, + { 0x2A50, opcode::OP_SelfEvalFieldVariableRef }, + { 0x2A51, opcode::OP_Invalid }, + { 0x2A52, opcode::OP_FirstArrayKey }, + { 0x2A53, opcode::OP_Bit_Xor }, + { 0x2A54, opcode::OP_Invalid }, + { 0x2A55, opcode::OP_GetSelfObject }, + { 0x2A56, opcode::OP_GetUintptr }, + { 0x2A57, opcode::OP_GetSelfObject }, + { 0x2A58, opcode::OP_WaitTillMatch }, + { 0x2A59, opcode::OP_EvalLocalVariableCached }, + { 0x2A5A, opcode::OP_Invalid }, + { 0x2A5B, opcode::OP_CastBool }, + { 0x2A5C, opcode::OP_FirstArrayKey }, + { 0x2A5D, opcode::OP_GetString }, + { 0x2A5E, opcode::OP_Notify }, + { 0x2A5F, opcode::OP_LessThanOrEqualTo }, + { 0x2A60, opcode::OP_EvalFieldVariable }, + { 0x2A61, opcode::OP_Invalid }, + { 0x2A62, opcode::OP_Invalid }, + { 0x2A63, opcode::OP_Invalid }, + { 0x2A64, opcode::OP_Invalid }, + { 0x2A65, opcode::OP_Invalid }, + { 0x2A66, opcode::OP_GreaterThan }, + { 0x2A67, opcode::OP_SafeCreateLocalVariables }, + { 0x2A68, opcode::OP_Invalid }, + { 0x2A69, opcode::OP_EvalLocalVariableRefCached }, + { 0x2A6A, opcode::OP_GetLevel }, + { 0x2A6B, opcode::OP_Dec }, + { 0x2A6C, opcode::OP_Invalid }, + { 0x2A6D, opcode::OP_Invalid }, + { 0x2A6E, opcode::OP_ScriptThreadCallPointer }, + { 0x2A6F, opcode::OP_Invalid }, + { 0x2A70, opcode::OP_SuperEqual }, + { 0x2A71, opcode::OP_GetLevelObject }, + { 0x2A72, opcode::OP_Invalid }, + { 0x2A73, opcode::OP_SelfEvalFieldVariableRef }, + { 0x2A74, opcode::OP_Invalid }, + { 0x2A75, opcode::OP_EvalLocalVariableCached }, + { 0x2A76, opcode::OP_Invalid }, + { 0x2A77, opcode::OP_Invalid }, + { 0x2A78, opcode::OP_GetGame }, + { 0x2A79, opcode::OP_Invalid }, + { 0x2A7A, opcode::OP_GetTime }, + { 0x2A7B, opcode::OP_Equal }, + { 0x2A7C, opcode::OP_Invalid }, + { 0x2A7D, opcode::OP_Invalid }, + { 0x2A7E, opcode::OP_Invalid }, + { 0x2A7F, opcode::OP_Switch }, + { 0x2A80, opcode::OP_Invalid }, + { 0x2A81, opcode::OP_Invalid }, + { 0x2A82, opcode::OP_Bit_Xor }, + { 0x2A83, opcode::OP_Invalid }, + { 0x2A84, opcode::OP_Invalid }, + { 0x2A85, opcode::OP_Invalid }, + { 0x2A86, opcode::OP_GetInteger }, + { 0x2A87, opcode::OP_DevblockBegin }, + { 0x2A88, opcode::OP_GetFloat }, + { 0x2A89, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x2A8A, opcode::OP_Invalid }, + { 0x2A8B, opcode::OP_Invalid }, + { 0x2A8C, opcode::OP_Invalid }, + { 0x2A8D, opcode::OP_Invalid }, + { 0x2A8E, opcode::OP_EndOn }, + { 0x2A8F, opcode::OP_Invalid }, + { 0x2A90, opcode::OP_GreaterThanOrEqualTo }, + { 0x2A91, opcode::OP_Invalid }, + { 0x2A92, opcode::OP_Multiply }, + { 0x2A93, opcode::OP_EvalArrayRef }, + { 0x2A94, opcode::OP_Invalid }, + { 0x2A95, opcode::OP_CastBool }, + { 0x2A96, opcode::OP_DevblockBegin }, + { 0x2A97, opcode::OP_Invalid }, + { 0x2A98, opcode::OP_Invalid }, + { 0x2A99, opcode::OP_LessThanOrEqualTo }, + { 0x2A9A, opcode::OP_SelfEvalFieldVariable }, + { 0x2A9B, opcode::OP_Invalid }, + { 0x2A9C, opcode::OP_EvalLocalVariableCached }, + { 0x2A9D, opcode::OP_Invalid }, + { 0x2A9E, opcode::OP_Invalid }, + { 0x2A9F, opcode::OP_GetGame }, + { 0x2AA0, opcode::OP_Return }, + { 0x2AA1, opcode::OP_Invalid }, + { 0x2AA2, opcode::OP_SelfEvalFieldVariable }, + { 0x2AA3, opcode::OP_Bit_And }, + { 0x2AA4, opcode::OP_Invalid }, + { 0x2AA5, opcode::OP_SuperNotEqual }, + { 0x2AA6, opcode::OP_Multiply }, + { 0x2AA7, opcode::OP_EndSwitch }, + { 0x2AA8, opcode::OP_Invalid }, + { 0x2AA9, opcode::OP_SelfEvalFieldVariable }, + { 0x2AAA, opcode::OP_Invalid }, + { 0x2AAB, opcode::OP_Invalid }, + { 0x2AAC, opcode::OP_LevelEvalFieldVariable }, + { 0x2AAD, opcode::OP_ShiftRight }, + { 0x2AAE, opcode::OP_GetNegByte }, + { 0x2AAF, opcode::OP_Invalid }, + { 0x2AB0, opcode::OP_Invalid }, + { 0x2AB1, opcode::OP_GetLevel }, + { 0x2AB2, opcode::OP_Bit_Xor }, + { 0x2AB3, opcode::OP_EvalLocalVariableRefCached }, + { 0x2AB4, opcode::OP_JumpOnFalse }, + { 0x2AB5, opcode::OP_Inc }, + { 0x2AB6, opcode::OP_GetGame }, + { 0x2AB7, opcode::OP_GetUnsignedShort }, + { 0x2AB8, opcode::OP_SuperNotEqual }, + { 0x2AB9, opcode::OP_LevelEvalFieldVariable }, + { 0x2ABA, opcode::OP_GetSelf }, + { 0x2ABB, opcode::OP_Invalid }, + { 0x2ABC, opcode::OP_GetIString }, + { 0x2ABD, opcode::OP_Invalid }, + { 0x2ABE, opcode::OP_Invalid }, + { 0x2ABF, opcode::OP_Invalid }, + { 0x2AC0, opcode::OP_GetUnsignedShort }, + { 0x2AC1, opcode::OP_Invalid }, + { 0x2AC2, opcode::OP_Bit_And }, + { 0x2AC3, opcode::OP_Inc }, + { 0x2AC4, opcode::OP_BoolNot }, + { 0x2AC5, opcode::OP_NotEqual }, + { 0x2AC6, opcode::OP_GetUnsignedShort }, + { 0x2AC7, opcode::OP_GetVector }, + { 0x2AC8, opcode::OP_GetUndefined }, + { 0x2AC9, opcode::OP_Invalid }, + { 0x2ACA, opcode::OP_CastFieldObject }, + { 0x2ACB, opcode::OP_ScriptFunctionCall }, + { 0x2ACC, opcode::OP_Invalid }, + { 0x2ACD, opcode::OP_LevelEvalFieldVariable }, + { 0x2ACE, opcode::OP_FirstArrayKey }, + { 0x2ACF, opcode::OP_Invalid }, + { 0x2AD0, opcode::OP_Invalid }, + { 0x2AD1, opcode::OP_GetUndefined }, + { 0x2AD2, opcode::OP_Invalid }, + { 0x2AD3, opcode::OP_SafeDecTop }, + { 0x2AD4, opcode::OP_GetUndefined }, + { 0x2AD5, opcode::OP_Invalid }, + { 0x2AD6, opcode::OP_EvalArrayRef }, + { 0x2AD7, opcode::OP_Bit_Xor }, + { 0x2AD8, opcode::OP_EvalLocalVariableRefCached }, + { 0x2AD9, opcode::OP_SafeDecTop }, + { 0x2ADA, opcode::OP_Invalid }, + { 0x2ADB, opcode::OP_GreaterThan }, + { 0x2ADC, opcode::OP_GetSelf }, + { 0x2ADD, opcode::OP_Invalid }, + { 0x2ADE, opcode::OP_Invalid }, + { 0x2ADF, opcode::OP_Invalid }, + { 0x2AE0, opcode::OP_ShiftLeft }, + { 0x2AE1, opcode::OP_GetClassesObject }, + { 0x2AE2, opcode::OP_GetVector }, + { 0x2AE3, opcode::OP_Invalid }, + { 0x2AE4, opcode::OP_Bit_Xor }, + { 0x2AE5, opcode::OP_Invalid }, + { 0x2AE6, opcode::OP_Invalid }, + { 0x2AE7, opcode::OP_JumpOnFalseExpr }, + { 0x2AE8, opcode::OP_GreaterThan }, + { 0x2AE9, opcode::OP_GetAnim }, + { 0x2AEA, opcode::OP_Minus }, + { 0x2AEB, opcode::OP_GetString }, + { 0x2AEC, opcode::OP_Invalid }, + { 0x2AED, opcode::OP_EvalLocalVariableRefCached }, + { 0x2AEE, opcode::OP_EmptyArray }, + { 0x2AEF, opcode::OP_Modulus }, + { 0x2AF0, opcode::OP_GetWorldObject }, + { 0x2AF1, opcode::OP_GetAnimation }, + { 0x2AF2, opcode::OP_Invalid }, + { 0x2AF3, opcode::OP_GetGame }, + { 0x2AF4, opcode::OP_GetAnimation }, + { 0x2AF5, opcode::OP_Invalid }, + { 0x2AF6, opcode::OP_Return }, + { 0x2AF7, opcode::OP_Minus }, + { 0x2AF8, opcode::OP_Invalid }, + { 0x2AF9, opcode::OP_Invalid }, + { 0x2AFA, opcode::OP_EmptyArray }, + { 0x2AFB, opcode::OP_Invalid }, + { 0x2AFC, opcode::OP_JumpOnTrue }, + { 0x2AFD, opcode::OP_Invalid }, + { 0x2AFE, opcode::OP_GetWorldObject }, + { 0x2AFF, opcode::OP_BoolComplement }, + { 0x2B00, opcode::OP_Invalid }, + { 0x2B01, opcode::OP_Invalid }, + { 0x2B02, opcode::OP_Invalid }, + { 0x2B03, opcode::OP_Divide }, + { 0x2B04, opcode::OP_Invalid }, + { 0x2B05, opcode::OP_SafeDecTop }, + { 0x2B06, opcode::OP_Invalid }, + { 0x2B07, opcode::OP_Invalid }, + { 0x2B08, opcode::OP_ProfileStart }, + { 0x2B09, opcode::OP_ScriptFunctionCallPointer }, + { 0x2B0A, opcode::OP_EvalArrayRef }, + { 0x2B0B, opcode::OP_ScriptThreadCall }, + { 0x2B0C, opcode::OP_New }, + { 0x2B0D, opcode::OP_GetFunction }, + { 0x2B0E, opcode::OP_Invalid }, + { 0x2B0F, opcode::OP_GetAnimation }, + { 0x2B10, opcode::OP_Invalid }, + { 0x2B11, opcode::OP_Invalid }, + { 0x2B12, opcode::OP_Invalid }, + { 0x2B13, opcode::OP_SafeCreateLocalVariables }, + { 0x2B14, opcode::OP_GetClassesObject }, + { 0x2B15, opcode::OP_Invalid }, + { 0x2B16, opcode::OP_Return }, + { 0x2B17, opcode::OP_GetVector }, + { 0x2B18, opcode::OP_Invalid }, + { 0x2B19, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x2B1A, opcode::OP_NotEqual }, + { 0x2B1B, opcode::OP_Jump }, + { 0x2B1C, opcode::OP_Divide }, + { 0x2B1D, opcode::OP_ScriptMethodThreadCall }, + { 0x2B1E, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x2B1F, opcode::OP_Invalid }, + { 0x2B20, opcode::OP_Invalid }, + { 0x2B21, opcode::OP_Invalid }, + { 0x2B22, opcode::OP_EndSwitch }, + { 0x2B23, opcode::OP_GetUndefined }, + { 0x2B24, opcode::OP_Invalid }, + { 0x2B25, opcode::OP_GetLevelObject }, + { 0x2B26, opcode::OP_Modulus }, + { 0x2B27, opcode::OP_GetString }, + { 0x2B28, opcode::OP_Invalid }, + { 0x2B29, opcode::OP_RealWait }, + { 0x2B2A, opcode::OP_Invalid }, + { 0x2B2B, opcode::OP_Invalid }, + { 0x2B2C, opcode::OP_JumpOnFalseExpr }, + { 0x2B2D, opcode::OP_GreaterThanOrEqualTo }, + { 0x2B2E, opcode::OP_EvalLocalVariableRefCached }, + { 0x2B2F, opcode::OP_GetWorldObject }, + { 0x2B30, opcode::OP_GetIString }, + { 0x2B31, opcode::OP_SelfEvalFieldVariable }, + { 0x2B32, opcode::OP_CastFieldObject }, + { 0x2B33, opcode::OP_GetVector }, + { 0x2B34, opcode::OP_Invalid }, + { 0x2B35, opcode::OP_Switch }, + { 0x2B36, opcode::OP_Invalid }, + { 0x2B37, opcode::OP_LessThanOrEqualTo }, + { 0x2B38, opcode::OP_GetAPIFunction }, + { 0x2B39, opcode::OP_GetWorld }, + { 0x2B3A, opcode::OP_EmptyArray }, + { 0x2B3B, opcode::OP_GetTime }, + { 0x2B3C, opcode::OP_Vector }, + { 0x2B3D, opcode::OP_VectorScale }, + { 0x2B3E, opcode::OP_SelfEvalFieldVariable }, + { 0x2B3F, opcode::OP_GetVector }, + { 0x2B40, opcode::OP_JumpOnTrueExpr }, + { 0x2B41, opcode::OP_Invalid }, + { 0x2B42, opcode::OP_SafeCreateLocalVariables }, + { 0x2B43, opcode::OP_SelfEvalFieldVariable }, + { 0x2B44, opcode::OP_JumpOnFalseExpr }, + { 0x2B45, opcode::OP_WaitTillFrameEnd }, + { 0x2B46, opcode::OP_JumpOnFalseExpr }, + { 0x2B47, opcode::OP_BoolComplement }, + { 0x2B48, opcode::OP_EmptyArray }, + { 0x2B49, opcode::OP_DevblockBegin }, + { 0x2B4A, opcode::OP_SafeDecTop }, + { 0x2B4B, opcode::OP_Invalid }, + { 0x2B4C, opcode::OP_GetWorld }, + { 0x2B4D, opcode::OP_GetNegByte }, + { 0x2B4E, opcode::OP_Plus }, + { 0x2B4F, opcode::OP_Invalid }, + { 0x2B50, opcode::OP_Notify }, + { 0x2B51, opcode::OP_EvalLocalVariableRefCached }, + { 0x2B52, opcode::OP_GetGame }, + { 0x2B53, opcode::OP_Invalid }, + { 0x2B54, opcode::OP_GetFloat }, + { 0x2B55, opcode::OP_EvalLocalVariableCached }, + { 0x2B56, opcode::OP_Invalid }, + { 0x2B57, opcode::OP_SafeSetVariableFieldCached }, + { 0x2B58, opcode::OP_WaitTill }, + { 0x2B59, opcode::OP_LevelEvalFieldVariable }, + { 0x2B5A, opcode::OP_ShiftRight }, + { 0x2B5B, opcode::OP_SuperNotEqual }, + { 0x2B5C, opcode::OP_EmptyArray }, + { 0x2B5D, opcode::OP_Wait }, + { 0x2B5E, opcode::OP_Modulus }, + { 0x2B5F, opcode::OP_BoolNot }, + { 0x2B60, opcode::OP_GetWorldObject }, + { 0x2B61, opcode::OP_GetNegByte }, + { 0x2B62, opcode::OP_GetFloat }, + { 0x2B63, opcode::OP_ScriptFunctionCallClass }, + { 0x2B64, opcode::OP_SafeDecTop }, + { 0x2B65, opcode::OP_EndOn }, + { 0x2B66, opcode::OP_Invalid }, + { 0x2B67, opcode::OP_GetAnimation }, + { 0x2B68, opcode::OP_IsDefined }, + { 0x2B69, opcode::OP_Invalid }, + { 0x2B6A, opcode::OP_Invalid }, + { 0x2B6B, opcode::OP_CallBuiltinMethod }, + { 0x2B6C, opcode::OP_GetHash }, + { 0x2B6D, opcode::OP_Invalid }, + { 0x2B6E, opcode::OP_GetString }, + { 0x2B6F, opcode::OP_GetFloat }, + { 0x2B70, opcode::OP_SuperEqual }, + { 0x2B71, opcode::OP_GetIString }, + { 0x2B72, opcode::OP_EmptyArray }, + { 0x2B73, opcode::OP_Invalid }, + { 0x2B74, opcode::OP_IsDefined }, + { 0x2B75, opcode::OP_ScriptThreadCallPointer }, + { 0x2B76, opcode::OP_SafeSetVariableFieldCached }, + { 0x2B77, opcode::OP_GetUintptr }, + { 0x2B78, opcode::OP_Invalid }, + { 0x2B79, opcode::OP_Invalid }, + { 0x2B7A, opcode::OP_Switch }, + { 0x2B7B, opcode::OP_DevblockBegin }, + { 0x2B7C, opcode::OP_GetNegUnsignedShort }, + { 0x2B7D, opcode::OP_GetGame }, + { 0x2B7E, opcode::OP_GetIString }, + { 0x2B7F, opcode::OP_Invalid }, + { 0x2B80, opcode::OP_GetFloat }, + { 0x2B81, opcode::OP_Invalid }, + { 0x2B82, opcode::OP_Invalid }, + { 0x2B83, opcode::OP_Bit_And }, + { 0x2B84, opcode::OP_Invalid }, + { 0x2B85, opcode::OP_GetHash }, + { 0x2B86, opcode::OP_Invalid }, + { 0x2B87, opcode::OP_ClearArray }, + { 0x2B88, opcode::OP_GetFunction }, + { 0x2B89, opcode::OP_ScriptThreadCall }, + { 0x2B8A, opcode::OP_Invalid }, + { 0x2B8B, opcode::OP_Invalid }, + { 0x2B8C, opcode::OP_ScriptMethodCallPointer }, + { 0x2B8D, opcode::OP_FirstArrayKey }, + { 0x2B8E, opcode::OP_Invalid }, + { 0x2B8F, opcode::OP_GreaterThan }, + { 0x2B90, opcode::OP_ClearFieldVariable }, + { 0x2B91, opcode::OP_Minus }, + { 0x2B92, opcode::OP_Jump }, + { 0x2B93, opcode::OP_GetTime }, + { 0x2B94, opcode::OP_Invalid }, + { 0x2B95, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x2B96, opcode::OP_EvalArrayRef }, + { 0x2B97, opcode::OP_Invalid }, + { 0x2B98, opcode::OP_Equal }, + { 0x2B99, opcode::OP_Invalid }, + { 0x2B9A, opcode::OP_EndOn }, + { 0x2B9B, opcode::OP_Invalid }, + { 0x2B9C, opcode::OP_Invalid }, + { 0x2B9D, opcode::OP_Modulus }, + { 0x2B9E, opcode::OP_Invalid }, + { 0x2B9F, opcode::OP_GetWorld }, + { 0x2BA0, opcode::OP_WaitTill }, + { 0x2BA1, opcode::OP_Invalid }, + { 0x2BA2, opcode::OP_Invalid }, + { 0x2BA3, opcode::OP_Multiply }, + { 0x2BA4, opcode::OP_Invalid }, + { 0x2BA5, opcode::OP_NotEqual }, + { 0x2BA6, opcode::OP_Invalid }, + { 0x2BA7, opcode::OP_Invalid }, + { 0x2BA8, opcode::OP_Invalid }, + { 0x2BA9, opcode::OP_SafeSetVariableFieldCached }, + { 0x2BAA, opcode::OP_GetUndefined }, + { 0x2BAB, opcode::OP_Invalid }, + { 0x2BAC, opcode::OP_EndSwitch }, + { 0x2BAD, opcode::OP_GetUndefined }, + { 0x2BAE, opcode::OP_New }, + { 0x2BAF, opcode::OP_JumpOnTrueExpr }, + { 0x2BB0, opcode::OP_LevelEvalFieldVariable }, + { 0x2BB1, opcode::OP_Bit_Xor }, + { 0x2BB2, opcode::OP_Notify }, + { 0x2BB3, opcode::OP_GetGame }, + { 0x2BB4, opcode::OP_GetFloat }, + { 0x2BB5, opcode::OP_Minus }, + { 0x2BB6, opcode::OP_GetClassesObject }, + { 0x2BB7, opcode::OP_Jump }, + { 0x2BB8, opcode::OP_Invalid }, + { 0x2BB9, opcode::OP_Invalid }, + { 0x2BBA, opcode::OP_Invalid }, + { 0x2BBB, opcode::OP_Invalid }, + { 0x2BBC, opcode::OP_New }, + { 0x2BBD, opcode::OP_EvalArrayRef }, + { 0x2BBE, opcode::OP_ScriptMethodThreadCall }, + { 0x2BBF, opcode::OP_Invalid }, + { 0x2BC0, opcode::OP_Invalid }, + { 0x2BC1, opcode::OP_ProfileStop }, + { 0x2BC2, opcode::OP_GetUintptr }, + { 0x2BC3, opcode::OP_Invalid }, + { 0x2BC4, opcode::OP_ScriptFunctionCallPointer }, + { 0x2BC5, opcode::OP_Invalid }, + { 0x2BC6, opcode::OP_Invalid }, + { 0x2BC7, opcode::OP_GetHash }, + { 0x2BC8, opcode::OP_GetVector }, + { 0x2BC9, opcode::OP_Invalid }, + { 0x2BCA, opcode::OP_Invalid }, + { 0x2BCB, opcode::OP_EvalFieldVariable }, + { 0x2BCC, opcode::OP_DevblockBegin }, + { 0x2BCD, opcode::OP_Invalid }, + { 0x2BCE, opcode::OP_GetZero }, + { 0x2BCF, opcode::OP_Divide }, + { 0x2BD0, opcode::OP_ScriptThreadCallPointer }, + { 0x2BD1, opcode::OP_DecTop }, + { 0x2BD2, opcode::OP_GetVector }, + { 0x2BD3, opcode::OP_Switch }, + { 0x2BD4, opcode::OP_Invalid }, + { 0x2BD5, opcode::OP_ScriptFunctionCallPointer }, + { 0x2BD6, opcode::OP_SafeSetVariableFieldCached }, + { 0x2BD7, opcode::OP_LessThanOrEqualTo }, + { 0x2BD8, opcode::OP_JumpOnTrueExpr }, + { 0x2BD9, opcode::OP_GetWorld }, + { 0x2BDA, opcode::OP_Invalid }, + { 0x2BDB, opcode::OP_Dec }, + { 0x2BDC, opcode::OP_Invalid }, + { 0x2BDD, opcode::OP_Invalid }, + { 0x2BDE, opcode::OP_Invalid }, + { 0x2BDF, opcode::OP_ScriptThreadCallClass }, + { 0x2BE0, opcode::OP_Invalid }, + { 0x2BE1, opcode::OP_ScriptFunctionCallClass }, + { 0x2BE2, opcode::OP_Invalid }, + { 0x2BE3, opcode::OP_GetTime }, + { 0x2BE4, opcode::OP_ScriptMethodCallPointer }, + { 0x2BE5, opcode::OP_DevblockBegin }, + { 0x2BE6, opcode::OP_Jump }, + { 0x2BE7, opcode::OP_Invalid }, + { 0x2BE8, opcode::OP_GetWorldObject }, + { 0x2BE9, opcode::OP_Invalid }, + { 0x2BEA, opcode::OP_Invalid }, + { 0x2BEB, opcode::OP_Invalid }, + { 0x2BEC, opcode::OP_GreaterThan }, + { 0x2BED, opcode::OP_Jump }, + { 0x2BEE, opcode::OP_Invalid }, + { 0x2BEF, opcode::OP_Invalid }, + { 0x2BF0, opcode::OP_JumpOnTrueExpr }, + { 0x2BF1, opcode::OP_Invalid }, + { 0x2BF2, opcode::OP_NextArrayKey }, + { 0x2BF3, opcode::OP_CallBuiltinMethod }, + { 0x2BF4, opcode::OP_GetTime }, + { 0x2BF5, opcode::OP_Invalid }, + { 0x2BF6, opcode::OP_SelfEvalFieldVariable }, + { 0x2BF7, opcode::OP_SizeOf }, + { 0x2BF8, opcode::OP_EvalArrayRef }, + { 0x2BF9, opcode::OP_EndSwitch }, + { 0x2BFA, opcode::OP_Invalid }, + { 0x2BFB, opcode::OP_GetClasses }, + { 0x2BFC, opcode::OP_ScriptMethodCallPointer }, + { 0x2BFD, opcode::OP_Invalid }, + { 0x2BFE, opcode::OP_Vector }, + { 0x2BFF, opcode::OP_LessThanOrEqualTo }, + { 0x2C00, opcode::OP_ClearArray }, + { 0x2C01, opcode::OP_LevelEvalFieldVariable }, + { 0x2C02, opcode::OP_GetAnim }, + { 0x2C03, opcode::OP_Invalid }, + { 0x2C04, opcode::OP_Invalid }, + { 0x2C05, opcode::OP_EvalLocalVariableRefCached }, + { 0x2C06, opcode::OP_Invalid }, + { 0x2C07, opcode::OP_Multiply }, + { 0x2C08, opcode::OP_Invalid }, + { 0x2C09, opcode::OP_Invalid }, + { 0x2C0A, opcode::OP_JumpOnFalse }, + { 0x2C0B, opcode::OP_Invalid }, + { 0x2C0C, opcode::OP_FirstArrayKey }, + { 0x2C0D, opcode::OP_EvalFieldVariable }, + { 0x2C0E, opcode::OP_Invalid }, + { 0x2C0F, opcode::OP_GetFloat }, + { 0x2C10, opcode::OP_Invalid }, + { 0x2C11, opcode::OP_CastBool }, + { 0x2C12, opcode::OP_ShiftRight }, + { 0x2C13, opcode::OP_Bit_Or }, + { 0x2C14, opcode::OP_GetHash }, + { 0x2C15, opcode::OP_DevblockBegin }, + { 0x2C16, opcode::OP_LessThan }, + { 0x2C17, opcode::OP_Invalid }, + { 0x2C18, opcode::OP_Invalid }, + { 0x2C19, opcode::OP_Invalid }, + { 0x2C1A, opcode::OP_Vector }, + { 0x2C1B, opcode::OP_EvalFieldVariable }, + { 0x2C1C, opcode::OP_GetClasses }, + { 0x2C1D, opcode::OP_Invalid }, + { 0x2C1E, opcode::OP_JumpOnTrueExpr }, + { 0x2C1F, opcode::OP_Invalid }, + { 0x2C20, opcode::OP_EvalLocalVariableCached }, + { 0x2C21, opcode::OP_EvalArray }, + { 0x2C22, opcode::OP_GetClassesObject }, + { 0x2C23, opcode::OP_BoolNot }, + { 0x2C24, opcode::OP_Invalid }, + { 0x2C25, opcode::OP_Invalid }, + { 0x2C26, opcode::OP_GetInteger }, + { 0x2C27, opcode::OP_Invalid }, + { 0x2C28, opcode::OP_Invalid }, + { 0x2C29, opcode::OP_ScriptFunctionCall }, + { 0x2C2A, opcode::OP_GetTime }, + { 0x2C2B, opcode::OP_Invalid }, + { 0x2C2C, opcode::OP_CallBuiltinMethod }, + { 0x2C2D, opcode::OP_Plus }, + { 0x2C2E, opcode::OP_Invalid }, + { 0x2C2F, opcode::OP_Bit_Xor }, + { 0x2C30, opcode::OP_Invalid }, + { 0x2C31, opcode::OP_FirstArrayKey }, + { 0x2C32, opcode::OP_Invalid }, + { 0x2C33, opcode::OP_Invalid }, + { 0x2C34, opcode::OP_Invalid }, + { 0x2C35, opcode::OP_EndOn }, + { 0x2C36, opcode::OP_GetNegByte }, + { 0x2C37, opcode::OP_GetGame }, + { 0x2C38, opcode::OP_WaitTillMatch }, + { 0x2C39, opcode::OP_Notify }, + { 0x2C3A, opcode::OP_Invalid }, + { 0x2C3B, opcode::OP_GetInteger }, + { 0x2C3C, opcode::OP_Invalid }, + { 0x2C3D, opcode::OP_ProfileStop }, + { 0x2C3E, opcode::OP_GetInteger }, + { 0x2C3F, opcode::OP_FirstArrayKey }, + { 0x2C40, opcode::OP_Invalid }, + { 0x2C41, opcode::OP_Bit_And }, + { 0x2C42, opcode::OP_Invalid }, + { 0x2C43, opcode::OP_Invalid }, + { 0x2C44, opcode::OP_BoolComplement }, + { 0x2C45, opcode::OP_Invalid }, + { 0x2C46, opcode::OP_Invalid }, + { 0x2C47, opcode::OP_Invalid }, + { 0x2C48, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x2C49, opcode::OP_EndOn }, + { 0x2C4A, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x2C4B, opcode::OP_GreaterThan }, + { 0x2C4C, opcode::OP_Return }, + { 0x2C4D, opcode::OP_Invalid }, + { 0x2C4E, opcode::OP_GetUndefined }, + { 0x2C4F, opcode::OP_GetAPIFunction }, + { 0x2C50, opcode::OP_Invalid }, + { 0x2C51, opcode::OP_Invalid }, + { 0x2C52, opcode::OP_Invalid }, + { 0x2C53, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x2C54, opcode::OP_GetWorld }, + { 0x2C55, opcode::OP_GetClasses }, + { 0x2C56, opcode::OP_WaitTillFrameEnd }, + { 0x2C57, opcode::OP_NotEqual }, + { 0x2C58, opcode::OP_Notify }, + { 0x2C59, opcode::OP_JumpOnTrueExpr }, + { 0x2C5A, opcode::OP_Invalid }, + { 0x2C5B, opcode::OP_LessThanOrEqualTo }, + { 0x2C5C, opcode::OP_Return }, + { 0x2C5D, opcode::OP_Invalid }, + { 0x2C5E, opcode::OP_GetFloat }, + { 0x2C5F, opcode::OP_Equal }, + { 0x2C60, opcode::OP_Invalid }, + { 0x2C61, opcode::OP_GetAPIFunction }, + { 0x2C62, opcode::OP_RealWait }, + { 0x2C63, opcode::OP_GetAnim }, + { 0x2C64, opcode::OP_Switch }, + { 0x2C65, opcode::OP_Invalid }, + { 0x2C66, opcode::OP_Invalid }, + { 0x2C67, opcode::OP_DevblockBegin }, + { 0x2C68, opcode::OP_NotEqual }, + { 0x2C69, opcode::OP_Vector }, + { 0x2C6A, opcode::OP_JumpOnTrueExpr }, + { 0x2C6B, opcode::OP_Invalid }, + { 0x2C6C, opcode::OP_Switch }, + { 0x2C6D, opcode::OP_GetZero }, + { 0x2C6E, opcode::OP_Invalid }, + { 0x2C6F, opcode::OP_Invalid }, + { 0x2C70, opcode::OP_DevblockBegin }, + { 0x2C71, opcode::OP_ScriptMethodThreadCall }, + { 0x2C72, opcode::OP_ScriptMethodCall }, + { 0x2C73, opcode::OP_GetClasses }, + { 0x2C74, opcode::OP_Invalid }, + { 0x2C75, opcode::OP_Invalid }, + { 0x2C76, opcode::OP_LevelEvalFieldVariable }, + { 0x2C77, opcode::OP_ScriptThreadCallPointer }, + { 0x2C78, opcode::OP_Bit_And }, + { 0x2C79, opcode::OP_Invalid }, + { 0x2C7A, opcode::OP_Invalid }, + { 0x2C7B, opcode::OP_GetVector }, + { 0x2C7C, opcode::OP_Invalid }, + { 0x2C7D, opcode::OP_GetSelf }, + { 0x2C7E, opcode::OP_ClearArray }, + { 0x2C7F, opcode::OP_EvalFieldVariable }, + { 0x2C80, opcode::OP_SetVariableField }, + { 0x2C81, opcode::OP_GetString }, + { 0x2C82, opcode::OP_EvalArray }, + { 0x2C83, opcode::OP_SuperNotEqual }, + { 0x2C84, opcode::OP_WaitTillFrameEnd }, + { 0x2C85, opcode::OP_Switch }, + { 0x2C86, opcode::OP_Invalid }, + { 0x2C87, opcode::OP_NextArrayKey }, + { 0x2C88, opcode::OP_SelfEvalFieldVariable }, + { 0x2C89, opcode::OP_Invalid }, + { 0x2C8A, opcode::OP_SuperEqual }, + { 0x2C8B, opcode::OP_BoolNot }, + { 0x2C8C, opcode::OP_GetHash }, + { 0x2C8D, opcode::OP_GreaterThanOrEqualTo }, + { 0x2C8E, opcode::OP_SafeSetVariableFieldCached }, + { 0x2C8F, opcode::OP_SafeCreateLocalVariables }, + { 0x2C90, opcode::OP_EndOn }, + { 0x2C91, opcode::OP_Invalid }, + { 0x2C92, opcode::OP_Minus }, + { 0x2C93, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x2C94, opcode::OP_Invalid }, + { 0x2C95, opcode::OP_EndSwitch }, + { 0x2C96, opcode::OP_Invalid }, + { 0x2C97, opcode::OP_Invalid }, + { 0x2C98, opcode::OP_GetAnimObject }, + { 0x2C99, opcode::OP_Invalid }, + { 0x2C9A, opcode::OP_Invalid }, + { 0x2C9B, opcode::OP_ProfileStart }, + { 0x2C9C, opcode::OP_CallBuiltinMethod }, + { 0x2C9D, opcode::OP_Invalid }, + { 0x2C9E, opcode::OP_JumpOnFalseExpr }, + { 0x2C9F, opcode::OP_GetLevel }, + { 0x2CA0, opcode::OP_GetNegUnsignedShort }, + { 0x2CA1, opcode::OP_Invalid }, + { 0x2CA2, opcode::OP_DecTop }, + { 0x2CA3, opcode::OP_SuperEqual }, + { 0x2CA4, opcode::OP_Invalid }, + { 0x2CA5, opcode::OP_GetSelf }, + { 0x2CA6, opcode::OP_Bit_Xor }, + { 0x2CA7, opcode::OP_Invalid }, + { 0x2CA8, opcode::OP_GetAnimObject }, + { 0x2CA9, opcode::OP_SafeDecTop }, + { 0x2CAA, opcode::OP_VectorScale }, + { 0x2CAB, opcode::OP_Multiply }, + { 0x2CAC, opcode::OP_Multiply }, + { 0x2CAD, opcode::OP_EndOn }, + { 0x2CAE, opcode::OP_Invalid }, + { 0x2CAF, opcode::OP_Bit_Xor }, + { 0x2CB0, opcode::OP_Invalid }, + { 0x2CB1, opcode::OP_GreaterThanOrEqualTo }, + { 0x2CB2, opcode::OP_ScriptThreadCallClass }, + { 0x2CB3, opcode::OP_EvalArrayRef }, + { 0x2CB4, opcode::OP_Invalid }, + { 0x2CB5, opcode::OP_Invalid }, + { 0x2CB6, opcode::OP_Invalid }, + { 0x2CB7, opcode::OP_Bit_And }, + { 0x2CB8, opcode::OP_Return }, + { 0x2CB9, opcode::OP_GetIString }, + { 0x2CBA, opcode::OP_Invalid }, + { 0x2CBB, opcode::OP_Invalid }, + { 0x2CBC, opcode::OP_Invalid }, + { 0x2CBD, opcode::OP_RealWait }, + { 0x2CBE, opcode::OP_GetVector }, + { 0x2CBF, opcode::OP_Invalid }, + { 0x2CC0, opcode::OP_GetGame }, + { 0x2CC1, opcode::OP_Multiply }, + { 0x2CC2, opcode::OP_Invalid }, + { 0x2CC3, opcode::OP_GetLevelObject }, + { 0x2CC4, opcode::OP_Invalid }, + { 0x2CC5, opcode::OP_Dec }, + { 0x2CC6, opcode::OP_Invalid }, + { 0x2CC7, opcode::OP_SelfEvalFieldVariableRef }, + { 0x2CC8, opcode::OP_SuperEqual }, + { 0x2CC9, opcode::OP_DecTop }, + { 0x2CCA, opcode::OP_Invalid }, + { 0x2CCB, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x2CCC, opcode::OP_JumpOnTrue }, + { 0x2CCD, opcode::OP_DevblockBegin }, + { 0x2CCE, opcode::OP_Invalid }, + { 0x2CCF, opcode::OP_EvalLocalVariableCached }, + { 0x2CD0, opcode::OP_Invalid }, + { 0x2CD1, opcode::OP_VectorScale }, + { 0x2CD2, opcode::OP_EvalArray }, + { 0x2CD3, opcode::OP_EvalLocalVariableCached }, + { 0x2CD4, opcode::OP_Invalid }, + { 0x2CD5, opcode::OP_GetGameRef }, + { 0x2CD6, opcode::OP_Invalid }, + { 0x2CD7, opcode::OP_ScriptFunctionCall }, + { 0x2CD8, opcode::OP_Equal }, + { 0x2CD9, opcode::OP_Invalid }, + { 0x2CDA, opcode::OP_ScriptThreadCallClass }, + { 0x2CDB, opcode::OP_Minus }, + { 0x2CDC, opcode::OP_ProfileStop }, + { 0x2CDD, opcode::OP_Invalid }, + { 0x2CDE, opcode::OP_Invalid }, + { 0x2CDF, opcode::OP_GetUnsignedShort }, + { 0x2CE0, opcode::OP_Bit_Xor }, + { 0x2CE1, opcode::OP_GreaterThanOrEqualTo }, + { 0x2CE2, opcode::OP_Jump }, + { 0x2CE3, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x2CE4, opcode::OP_Invalid }, + { 0x2CE5, opcode::OP_GetWorldObject }, + { 0x2CE6, opcode::OP_EvalLocalVariableCached }, + { 0x2CE7, opcode::OP_ClearFieldVariable }, + { 0x2CE8, opcode::OP_Bit_Xor }, + { 0x2CE9, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x2CEA, opcode::OP_ShiftLeft }, + { 0x2CEB, opcode::OP_GetWorld }, + { 0x2CEC, opcode::OP_JumpOnTrue }, + { 0x2CED, opcode::OP_JumpOnFalseExpr }, + { 0x2CEE, opcode::OP_Notify }, + { 0x2CEF, opcode::OP_GetGameRef }, + { 0x2CF0, opcode::OP_CallBuiltinMethod }, + { 0x2CF1, opcode::OP_Invalid }, + { 0x2CF2, opcode::OP_Switch }, + { 0x2CF3, opcode::OP_SuperEqual }, + { 0x2CF4, opcode::OP_Vector }, + { 0x2CF5, opcode::OP_Invalid }, + { 0x2CF6, opcode::OP_GetLevel }, + { 0x2CF7, opcode::OP_GetZero }, + { 0x2CF8, opcode::OP_EvalLocalVariableCached }, + { 0x2CF9, opcode::OP_DevblockBegin }, + { 0x2CFA, opcode::OP_SafeSetVariableFieldCached }, + { 0x2CFB, opcode::OP_Invalid }, + { 0x2CFC, opcode::OP_Invalid }, + { 0x2CFD, opcode::OP_Invalid }, + { 0x2CFE, opcode::OP_GetSelf }, + { 0x2CFF, opcode::OP_VectorConstant }, + { 0x2D00, opcode::OP_Invalid }, + { 0x2D01, opcode::OP_Invalid }, + { 0x2D02, opcode::OP_SafeCreateLocalVariables }, + { 0x2D03, opcode::OP_LevelEvalFieldVariable }, + { 0x2D04, opcode::OP_Invalid }, + { 0x2D05, opcode::OP_ScriptThreadCallClass }, + { 0x2D06, opcode::OP_GetClasses }, + { 0x2D07, opcode::OP_GreaterThan }, + { 0x2D08, opcode::OP_GetNegUnsignedShort }, + { 0x2D09, opcode::OP_Invalid }, + { 0x2D0A, opcode::OP_GetByte }, + { 0x2D0B, opcode::OP_Invalid }, + { 0x2D0C, opcode::OP_GetSelfObject }, + { 0x2D0D, opcode::OP_SelfEvalFieldVariableRef }, + { 0x2D0E, opcode::OP_Invalid }, + { 0x2D0F, opcode::OP_Invalid }, + { 0x2D10, opcode::OP_JumpOnTrueExpr }, + { 0x2D11, opcode::OP_ScriptFunctionCallClass }, + { 0x2D12, opcode::OP_ProfileStop }, + { 0x2D13, opcode::OP_ClearFieldVariable }, + { 0x2D14, opcode::OP_Invalid }, + { 0x2D15, opcode::OP_LessThanOrEqualTo }, + { 0x2D16, opcode::OP_GetAnimObject }, + { 0x2D17, opcode::OP_Invalid }, + { 0x2D18, opcode::OP_Return }, + { 0x2D19, opcode::OP_SuperEqual }, + { 0x2D1A, opcode::OP_ProfileStop }, + { 0x2D1B, opcode::OP_EmptyArray }, + { 0x2D1C, opcode::OP_Invalid }, + { 0x2D1D, opcode::OP_VectorScale }, + { 0x2D1E, opcode::OP_NotEqual }, + { 0x2D1F, opcode::OP_ShiftRight }, + { 0x2D20, opcode::OP_Invalid }, + { 0x2D21, opcode::OP_EvalLocalVariableRefCached }, + { 0x2D22, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x2D23, opcode::OP_Invalid }, + { 0x2D24, opcode::OP_SafeCreateLocalVariables }, + { 0x2D25, opcode::OP_LevelEvalFieldVariableRef }, + { 0x2D26, opcode::OP_JumpOnTrueExpr }, + { 0x2D27, opcode::OP_EvalArray }, + { 0x2D28, opcode::OP_SafeSetVariableFieldCached }, + { 0x2D29, opcode::OP_SafeDecTop }, + { 0x2D2A, opcode::OP_SafeDecTop }, + { 0x2D2B, opcode::OP_Invalid }, + { 0x2D2C, opcode::OP_Invalid }, + { 0x2D2D, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x2D2E, opcode::OP_ShiftRight }, + { 0x2D2F, opcode::OP_Invalid }, + { 0x2D30, opcode::OP_ProfileStart }, + { 0x2D31, opcode::OP_GetUnsignedShort }, + { 0x2D32, opcode::OP_Jump }, + { 0x2D33, opcode::OP_NotEqual }, + { 0x2D34, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x2D35, opcode::OP_Minus }, + { 0x2D36, opcode::OP_ScriptMethodCall }, + { 0x2D37, opcode::OP_EvalLocalVariableCached }, + { 0x2D38, opcode::OP_ClearFieldVariable }, + { 0x2D39, opcode::OP_Invalid }, + { 0x2D3A, opcode::OP_LessThan }, + { 0x2D3B, opcode::OP_Invalid }, + { 0x2D3C, opcode::OP_Invalid }, + { 0x2D3D, opcode::OP_GetVector }, + { 0x2D3E, opcode::OP_NextArrayKey }, + { 0x2D3F, opcode::OP_Invalid }, + { 0x2D40, opcode::OP_Switch }, + { 0x2D41, opcode::OP_Invalid }, + { 0x2D42, opcode::OP_Minus }, + { 0x2D43, opcode::OP_NextArrayKey }, + { 0x2D44, opcode::OP_Minus }, + { 0x2D45, opcode::OP_ProfileStart }, + { 0x2D46, opcode::OP_Invalid }, + { 0x2D47, opcode::OP_Invalid }, + { 0x2D48, opcode::OP_SuperNotEqual }, + { 0x2D49, opcode::OP_EvalArray }, + { 0x2D4A, opcode::OP_ShiftLeft }, + { 0x2D4B, opcode::OP_GetSelfObject }, + { 0x2D4C, opcode::OP_IsDefined }, + { 0x2D4D, opcode::OP_WaitTillFrameEnd }, + { 0x2D4E, opcode::OP_Invalid }, + { 0x2D4F, opcode::OP_Invalid }, + { 0x2D50, opcode::OP_JumpOnTrueExpr }, + { 0x2D51, opcode::OP_CastFieldObject }, + { 0x2D52, opcode::OP_GetHash }, + { 0x2D53, opcode::OP_WaitTillMatch }, + { 0x2D54, opcode::OP_Invalid }, + { 0x2D55, opcode::OP_Invalid }, + { 0x2D56, opcode::OP_ScriptMethodThreadCall }, + { 0x2D57, opcode::OP_ClearArray }, + { 0x2D58, opcode::OP_GetWorldObject }, + { 0x2D59, opcode::OP_LessThanOrEqualTo }, + { 0x2D5A, opcode::OP_FirstArrayKey }, + { 0x2D5B, opcode::OP_Invalid }, + { 0x2D5C, opcode::OP_JumpOnTrueExpr }, + { 0x2D5D, opcode::OP_SuperNotEqual }, + { 0x2D5E, opcode::OP_SetVariableField }, + { 0x2D5F, opcode::OP_LevelEvalFieldVariableRef }, + { 0x2D60, opcode::OP_Return }, + { 0x2D61, opcode::OP_WaitTillFrameEnd }, + { 0x2D62, opcode::OP_Invalid }, + { 0x2D63, opcode::OP_Invalid }, + { 0x2D64, opcode::OP_Invalid }, + { 0x2D65, opcode::OP_Invalid }, + { 0x2D66, opcode::OP_Inc }, + { 0x2D67, opcode::OP_ShiftRight }, + { 0x2D68, opcode::OP_Invalid }, + { 0x2D69, opcode::OP_ShiftLeft }, + { 0x2D6A, opcode::OP_Invalid }, + { 0x2D6B, opcode::OP_ScriptMethodCall }, + { 0x2D6C, opcode::OP_Invalid }, + { 0x2D6D, opcode::OP_BoolComplement }, + { 0x2D6E, opcode::OP_Invalid }, + { 0x2D6F, opcode::OP_ShiftLeft }, + { 0x2D70, opcode::OP_GetAnimObject }, + { 0x2D71, opcode::OP_ScriptThreadCall }, + { 0x2D72, opcode::OP_GetZero }, + { 0x2D73, opcode::OP_SelfEvalFieldVariable }, + { 0x2D74, opcode::OP_Multiply }, + { 0x2D75, opcode::OP_GetGame }, + { 0x2D76, opcode::OP_GetVector }, + { 0x2D77, opcode::OP_ClearFieldVariable }, + { 0x2D78, opcode::OP_ScriptThreadCallClass }, + { 0x2D79, opcode::OP_FirstArrayKey }, + { 0x2D7A, opcode::OP_Invalid }, + { 0x2D7B, opcode::OP_GetSelfObject }, + { 0x2D7C, opcode::OP_GetLevelObject }, + { 0x2D7D, opcode::OP_Wait }, + { 0x2D7E, opcode::OP_DevblockBegin }, + { 0x2D7F, opcode::OP_JumpOnFalse }, + { 0x2D80, opcode::OP_EvalArray }, + { 0x2D81, opcode::OP_CallBuiltinMethod }, + { 0x2D82, opcode::OP_Invalid }, + { 0x2D83, opcode::OP_GetIString }, + { 0x2D84, opcode::OP_Invalid }, + { 0x2D85, opcode::OP_GetAnimation }, + { 0x2D86, opcode::OP_ClearArray }, + { 0x2D87, opcode::OP_Invalid }, + { 0x2D88, opcode::OP_SafeSetVariableFieldCached }, + { 0x2D89, opcode::OP_ClearArray }, + { 0x2D8A, opcode::OP_Bit_Or }, + { 0x2D8B, opcode::OP_Invalid }, + { 0x2D8C, opcode::OP_Invalid }, + { 0x2D8D, opcode::OP_Invalid }, + { 0x2D8E, opcode::OP_Invalid }, + { 0x2D8F, opcode::OP_Invalid }, + { 0x2D90, opcode::OP_LessThanOrEqualTo }, + { 0x2D91, opcode::OP_Invalid }, + { 0x2D92, opcode::OP_GetTime }, + { 0x2D93, opcode::OP_BoolNot }, + { 0x2D94, opcode::OP_Divide }, + { 0x2D95, opcode::OP_GetSelfObject }, + { 0x2D96, opcode::OP_IsDefined }, + { 0x2D97, opcode::OP_EndSwitch }, + { 0x2D98, opcode::OP_Bit_And }, + { 0x2D99, opcode::OP_Invalid }, + { 0x2D9A, opcode::OP_Invalid }, + { 0x2D9B, opcode::OP_GetTime }, + { 0x2D9C, opcode::OP_Invalid }, + { 0x2D9D, opcode::OP_Invalid }, + { 0x2D9E, opcode::OP_GetLevel }, + { 0x2D9F, opcode::OP_JumpOnFalse }, + { 0x2DA0, opcode::OP_VectorConstant }, + { 0x2DA1, opcode::OP_WaitTillMatch }, + { 0x2DA2, opcode::OP_Invalid }, + { 0x2DA3, opcode::OP_ProfileStart }, + { 0x2DA4, opcode::OP_Invalid }, + { 0x2DA5, opcode::OP_Invalid }, + { 0x2DA6, opcode::OP_New }, + { 0x2DA7, opcode::OP_New }, + { 0x2DA8, opcode::OP_Dec }, + { 0x2DA9, opcode::OP_IsDefined }, + { 0x2DAA, opcode::OP_Invalid }, + { 0x2DAB, opcode::OP_CallBuiltinMethod }, + { 0x2DAC, opcode::OP_IsDefined }, + { 0x2DAD, opcode::OP_WaitTillMatch }, + { 0x2DAE, opcode::OP_Wait }, + { 0x2DAF, opcode::OP_Switch }, + { 0x2DB0, opcode::OP_SafeDecTop }, + { 0x2DB1, opcode::OP_Invalid }, + { 0x2DB2, opcode::OP_Invalid }, + { 0x2DB3, opcode::OP_Wait }, + { 0x2DB4, opcode::OP_LessThan }, + { 0x2DB5, opcode::OP_Invalid }, + { 0x2DB6, opcode::OP_CallBuiltinMethod }, + { 0x2DB7, opcode::OP_ScriptMethodCallPointer }, + { 0x2DB8, opcode::OP_EndOn }, + { 0x2DB9, opcode::OP_ScriptThreadCallPointer }, + { 0x2DBA, opcode::OP_SizeOf }, + { 0x2DBB, opcode::OP_Invalid }, + { 0x2DBC, opcode::OP_GetFunction }, + { 0x2DBD, opcode::OP_GreaterThan }, + { 0x2DBE, opcode::OP_EvalLocalVariableCached }, + { 0x2DBF, opcode::OP_Invalid }, + { 0x2DC0, opcode::OP_SafeCreateLocalVariables }, + { 0x2DC1, opcode::OP_Invalid }, + { 0x2DC2, opcode::OP_EmptyArray }, + { 0x2DC3, opcode::OP_ScriptThreadCallPointer }, + { 0x2DC4, opcode::OP_Wait }, + { 0x2DC5, opcode::OP_Invalid }, + { 0x2DC6, opcode::OP_ScriptMethodCall }, + { 0x2DC7, opcode::OP_SafeDecTop }, + { 0x2DC8, opcode::OP_Invalid }, + { 0x2DC9, opcode::OP_Invalid }, + { 0x2DCA, opcode::OP_Invalid }, + { 0x2DCB, opcode::OP_CallBuiltinMethod }, + { 0x2DCC, opcode::OP_VectorScale }, + { 0x2DCD, opcode::OP_GetLevelObject }, + { 0x2DCE, opcode::OP_SizeOf }, + { 0x2DCF, opcode::OP_WaitTill }, + { 0x2DD0, opcode::OP_GetLevel }, + { 0x2DD1, opcode::OP_Bit_Xor }, + { 0x2DD2, opcode::OP_ScriptThreadCallClass }, + { 0x2DD3, opcode::OP_New }, + { 0x2DD4, opcode::OP_SafeDecTop }, + { 0x2DD5, opcode::OP_Invalid }, + { 0x2DD6, opcode::OP_GreaterThanOrEqualTo }, + { 0x2DD7, opcode::OP_Invalid }, + { 0x2DD8, opcode::OP_GetHash }, + { 0x2DD9, opcode::OP_GetString }, + { 0x2DDA, opcode::OP_Invalid }, + { 0x2DDB, opcode::OP_ScriptFunctionCallClass }, + { 0x2DDC, opcode::OP_BoolComplement }, + { 0x2DDD, opcode::OP_Invalid }, + { 0x2DDE, opcode::OP_LessThanOrEqualTo }, + { 0x2DDF, opcode::OP_LevelEvalFieldVariable }, + { 0x2DE0, opcode::OP_SafeCreateLocalVariables }, + { 0x2DE1, opcode::OP_GetWorld }, + { 0x2DE2, opcode::OP_Invalid }, + { 0x2DE3, opcode::OP_GetString }, + { 0x2DE4, opcode::OP_ShiftRight }, + { 0x2DE5, opcode::OP_EvalLocalVariableCached }, + { 0x2DE6, opcode::OP_Bit_Xor }, + { 0x2DE7, opcode::OP_Switch }, + { 0x2DE8, opcode::OP_ScriptThreadCallPointer }, + { 0x2DE9, opcode::OP_GetAnim }, + { 0x2DEA, opcode::OP_GreaterThanOrEqualTo }, + { 0x2DEB, opcode::OP_GetByte }, + { 0x2DEC, opcode::OP_Invalid }, + { 0x2DED, opcode::OP_SafeDecTop }, + { 0x2DEE, opcode::OP_EvalLocalVariableRefCached }, + { 0x2DEF, opcode::OP_GetClasses }, + { 0x2DF0, opcode::OP_Invalid }, + { 0x2DF1, opcode::OP_Invalid }, + { 0x2DF2, opcode::OP_Invalid }, + { 0x2DF3, opcode::OP_Invalid }, + { 0x2DF4, opcode::OP_Invalid }, + { 0x2DF5, opcode::OP_ScriptThreadCallPointer }, + { 0x2DF6, opcode::OP_Invalid }, + { 0x2DF7, opcode::OP_Invalid }, + { 0x2DF8, opcode::OP_GetZero }, + { 0x2DF9, opcode::OP_ProfileStop }, + { 0x2DFA, opcode::OP_LevelEvalFieldVariableRef }, + { 0x2DFB, opcode::OP_Invalid }, + { 0x2DFC, opcode::OP_Invalid }, + { 0x2DFD, opcode::OP_Invalid }, + { 0x2DFE, opcode::OP_WaitTillFrameEnd }, + { 0x2DFF, opcode::OP_Equal }, + { 0x2E00, opcode::OP_GetNegByte }, + { 0x2E01, opcode::OP_ScriptThreadCallClass }, + { 0x2E02, opcode::OP_Invalid }, + { 0x2E03, opcode::OP_Invalid }, + { 0x2E04, opcode::OP_Invalid }, + { 0x2E05, opcode::OP_SuperEqual }, + { 0x2E06, opcode::OP_Jump }, + { 0x2E07, opcode::OP_Notify }, + { 0x2E08, opcode::OP_WaitTillMatch }, + { 0x2E09, opcode::OP_ClearArray }, + { 0x2E0A, opcode::OP_Invalid }, + { 0x2E0B, opcode::OP_Invalid }, + { 0x2E0C, opcode::OP_GetAnimation }, + { 0x2E0D, opcode::OP_GetSelfObject }, + { 0x2E0E, opcode::OP_Invalid }, + { 0x2E0F, opcode::OP_Invalid }, + { 0x2E10, opcode::OP_Bit_Or }, + { 0x2E11, opcode::OP_Invalid }, + { 0x2E12, opcode::OP_GreaterThan }, + { 0x2E13, opcode::OP_Invalid }, + { 0x2E14, opcode::OP_Invalid }, + { 0x2E15, opcode::OP_Invalid }, + { 0x2E16, opcode::OP_Invalid }, + { 0x2E17, opcode::OP_Invalid }, + { 0x2E18, opcode::OP_BoolComplement }, + { 0x2E19, opcode::OP_Invalid }, + { 0x2E1A, opcode::OP_Minus }, + { 0x2E1B, opcode::OP_Invalid }, + { 0x2E1C, opcode::OP_Equal }, + { 0x2E1D, opcode::OP_Invalid }, + { 0x2E1E, opcode::OP_WaitTillFrameEnd }, + { 0x2E1F, opcode::OP_JumpOnTrue }, + { 0x2E20, opcode::OP_Multiply }, + { 0x2E21, opcode::OP_ScriptFunctionCallClass }, + { 0x2E22, opcode::OP_GetUndefined }, + { 0x2E23, opcode::OP_Invalid }, + { 0x2E24, opcode::OP_Invalid }, + { 0x2E25, opcode::OP_ProfileStart }, + { 0x2E26, opcode::OP_SelfEvalFieldVariable }, + { 0x2E27, opcode::OP_ClearFieldVariable }, + { 0x2E28, opcode::OP_Invalid }, + { 0x2E29, opcode::OP_EndOn }, + { 0x2E2A, opcode::OP_Invalid }, + { 0x2E2B, opcode::OP_Invalid }, + { 0x2E2C, opcode::OP_Invalid }, + { 0x2E2D, opcode::OP_Bit_And }, + { 0x2E2E, opcode::OP_ClearFieldVariable }, + { 0x2E2F, opcode::OP_WaitTillMatch }, + { 0x2E30, opcode::OP_GetUintptr }, + { 0x2E31, opcode::OP_JumpOnTrue }, + { 0x2E32, opcode::OP_Notify }, + { 0x2E33, opcode::OP_ClearArray }, + { 0x2E34, opcode::OP_GetFloat }, + { 0x2E35, opcode::OP_GetSelfObject }, + { 0x2E36, opcode::OP_Invalid }, + { 0x2E37, opcode::OP_Invalid }, + { 0x2E38, opcode::OP_GetUintptr }, + { 0x2E39, opcode::OP_ShiftRight }, + { 0x2E3A, opcode::OP_Invalid }, + { 0x2E3B, opcode::OP_GetAnimation }, + { 0x2E3C, opcode::OP_LevelEvalFieldVariableRef }, + { 0x2E3D, opcode::OP_GetHash }, + { 0x2E3E, opcode::OP_Invalid }, + { 0x2E3F, opcode::OP_JumpOnFalse }, + { 0x2E40, opcode::OP_Invalid }, + { 0x2E41, opcode::OP_SafeSetVariableFieldCached }, + { 0x2E42, opcode::OP_ScriptMethodCall }, + { 0x2E43, opcode::OP_GetLevel }, + { 0x2E44, opcode::OP_Invalid }, + { 0x2E45, opcode::OP_Invalid }, + { 0x2E46, opcode::OP_SelfEvalFieldVariableRef }, + { 0x2E47, opcode::OP_Invalid }, + { 0x2E48, opcode::OP_GetLevelObject }, + { 0x2E49, opcode::OP_Invalid }, + { 0x2E4A, opcode::OP_Invalid }, + { 0x2E4B, opcode::OP_Invalid }, + { 0x2E4C, opcode::OP_WaitTillFrameEnd }, + { 0x2E4D, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x2E4E, opcode::OP_JumpOnFalse }, + { 0x2E4F, opcode::OP_Invalid }, + { 0x2E50, opcode::OP_NextArrayKey }, + { 0x2E51, opcode::OP_Invalid }, + { 0x2E52, opcode::OP_NotEqual }, + { 0x2E53, opcode::OP_SuperEqual }, + { 0x2E54, opcode::OP_EndSwitch }, + { 0x2E55, opcode::OP_Invalid }, + { 0x2E56, opcode::OP_NotEqual }, + { 0x2E57, opcode::OP_ScriptFunctionCallPointer }, + { 0x2E58, opcode::OP_BoolNot }, + { 0x2E59, opcode::OP_Invalid }, + { 0x2E5A, opcode::OP_RealWait }, + { 0x2E5B, opcode::OP_ScriptThreadCallClass }, + { 0x2E5C, opcode::OP_Minus }, + { 0x2E5D, opcode::OP_Invalid }, + { 0x2E5E, opcode::OP_NotEqual }, + { 0x2E5F, opcode::OP_EvalFieldVariable }, + { 0x2E60, opcode::OP_GetAnimation }, + { 0x2E61, opcode::OP_NextArrayKey }, + { 0x2E62, opcode::OP_GetWorld }, + { 0x2E63, opcode::OP_GetFloat }, + { 0x2E64, opcode::OP_FirstArrayKey }, + { 0x2E65, opcode::OP_Invalid }, + { 0x2E66, opcode::OP_Plus }, + { 0x2E67, opcode::OP_GetAnim }, + { 0x2E68, opcode::OP_RealWait }, + { 0x2E69, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x2E6A, opcode::OP_GetNegByte }, + { 0x2E6B, opcode::OP_Invalid }, + { 0x2E6C, opcode::OP_Invalid }, + { 0x2E6D, opcode::OP_LevelEvalFieldVariableRef }, + { 0x2E6E, opcode::OP_JumpOnFalse }, + { 0x2E6F, opcode::OP_EvalFieldVariable }, + { 0x2E70, opcode::OP_EvalFieldVariableRef }, + { 0x2E71, opcode::OP_JumpOnFalseExpr }, + { 0x2E72, opcode::OP_Invalid }, + { 0x2E73, opcode::OP_Vector }, + { 0x2E74, opcode::OP_Invalid }, + { 0x2E75, opcode::OP_LevelEvalFieldVariableRef }, + { 0x2E76, opcode::OP_WaitTillMatch }, + { 0x2E77, opcode::OP_Minus }, + { 0x2E78, opcode::OP_Plus }, + { 0x2E79, opcode::OP_GetNegByte }, + { 0x2E7A, opcode::OP_ClearFieldVariable }, + { 0x2E7B, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x2E7C, opcode::OP_Invalid }, + { 0x2E7D, opcode::OP_Invalid }, + { 0x2E7E, opcode::OP_Invalid }, + { 0x2E7F, opcode::OP_Bit_Xor }, + { 0x2E80, opcode::OP_EvalArray }, + { 0x2E81, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x2E82, opcode::OP_Dec }, + { 0x2E83, opcode::OP_GetString }, + { 0x2E84, opcode::OP_Switch }, + { 0x2E85, opcode::OP_Bit_Or }, + { 0x2E86, opcode::OP_Invalid }, + { 0x2E87, opcode::OP_GetUndefined }, + { 0x2E88, opcode::OP_SafeCreateLocalVariables }, + { 0x2E89, opcode::OP_ScriptMethodCall }, + { 0x2E8A, opcode::OP_GetVector }, + { 0x2E8B, opcode::OP_Invalid }, + { 0x2E8C, opcode::OP_GetFunction }, + { 0x2E8D, opcode::OP_GetHash }, + { 0x2E8E, opcode::OP_Invalid }, + { 0x2E8F, opcode::OP_FirstArrayKey }, + { 0x2E90, opcode::OP_RealWait }, + { 0x2E91, opcode::OP_Invalid }, + { 0x2E92, opcode::OP_GetUndefined }, + { 0x2E93, opcode::OP_GetNegUnsignedShort }, + { 0x2E94, opcode::OP_Invalid }, + { 0x2E95, opcode::OP_LessThan }, + { 0x2E96, opcode::OP_EvalLocalVariableRefCached }, + { 0x2E97, opcode::OP_GetAnimObject }, + { 0x2E98, opcode::OP_LessThan }, + { 0x2E99, opcode::OP_BoolComplement }, + { 0x2E9A, opcode::OP_GetString }, + { 0x2E9B, opcode::OP_Invalid }, + { 0x2E9C, opcode::OP_Invalid }, + { 0x2E9D, opcode::OP_ScriptMethodCall }, + { 0x2E9E, opcode::OP_Invalid }, + { 0x2E9F, opcode::OP_LevelEvalFieldVariableRef }, + { 0x2EA0, opcode::OP_GetAnimObject }, + { 0x2EA1, opcode::OP_Modulus }, + { 0x2EA2, opcode::OP_ScriptMethodThreadCall }, + { 0x2EA3, opcode::OP_Invalid }, + { 0x2EA4, opcode::OP_GetLevel }, + { 0x2EA5, opcode::OP_Invalid }, + { 0x2EA6, opcode::OP_EvalLocalVariableRefCached }, + { 0x2EA7, opcode::OP_Invalid }, + { 0x2EA8, opcode::OP_SuperEqual }, + { 0x2EA9, opcode::OP_EvalFieldVariableRef }, + { 0x2EAA, opcode::OP_Invalid }, + { 0x2EAB, opcode::OP_SetVariableField }, + { 0x2EAC, opcode::OP_JumpOnTrue }, + { 0x2EAD, opcode::OP_GetFloat }, + { 0x2EAE, opcode::OP_Invalid }, + { 0x2EAF, opcode::OP_ScriptFunctionCall }, + { 0x2EB0, opcode::OP_Invalid }, + { 0x2EB1, opcode::OP_Invalid }, + { 0x2EB2, opcode::OP_Wait }, + { 0x2EB3, opcode::OP_WaitTill }, + { 0x2EB4, opcode::OP_Invalid }, + { 0x2EB5, opcode::OP_GetString }, + { 0x2EB6, opcode::OP_FirstArrayKey }, + { 0x2EB7, opcode::OP_LevelEvalFieldVariable }, + { 0x2EB8, opcode::OP_SafeSetVariableFieldCached }, + { 0x2EB9, opcode::OP_Invalid }, + { 0x2EBA, opcode::OP_Vector }, + { 0x2EBB, opcode::OP_SafeCreateLocalVariables }, + { 0x2EBC, opcode::OP_New }, + { 0x2EBD, opcode::OP_SafeDecTop }, + { 0x2EBE, opcode::OP_GetUintptr }, + { 0x2EBF, opcode::OP_Multiply }, + { 0x2EC0, opcode::OP_Switch }, + { 0x2EC1, opcode::OP_JumpOnTrueExpr }, + { 0x2EC2, opcode::OP_WaitTillFrameEnd }, + { 0x2EC3, opcode::OP_EvalFieldVariable }, + { 0x2EC4, opcode::OP_Invalid }, + { 0x2EC5, opcode::OP_ClearArray }, + { 0x2EC6, opcode::OP_Wait }, + { 0x2EC7, opcode::OP_Invalid }, + { 0x2EC8, opcode::OP_Invalid }, + { 0x2EC9, opcode::OP_GetAnim }, + { 0x2ECA, opcode::OP_EvalLocalVariableRefCached }, + { 0x2ECB, opcode::OP_Invalid }, + { 0x2ECC, opcode::OP_ShiftRight }, + { 0x2ECD, opcode::OP_SizeOf }, + { 0x2ECE, opcode::OP_Switch }, + { 0x2ECF, opcode::OP_SafeCreateLocalVariables }, + { 0x2ED0, opcode::OP_Invalid }, + { 0x2ED1, opcode::OP_Bit_And }, + { 0x2ED2, opcode::OP_Invalid }, + { 0x2ED3, opcode::OP_Switch }, + { 0x2ED4, opcode::OP_GetUnsignedShort }, + { 0x2ED5, opcode::OP_ScriptMethodCallPointer }, + { 0x2ED6, opcode::OP_ClearFieldVariable }, + { 0x2ED7, opcode::OP_Invalid }, + { 0x2ED8, opcode::OP_Invalid }, + { 0x2ED9, opcode::OP_CastFieldObject }, + { 0x2EDA, opcode::OP_GetUndefined }, + { 0x2EDB, opcode::OP_Invalid }, + { 0x2EDC, opcode::OP_Invalid }, + { 0x2EDD, opcode::OP_DevblockBegin }, + { 0x2EDE, opcode::OP_EndSwitch }, + { 0x2EDF, opcode::OP_Invalid }, + { 0x2EE0, opcode::OP_Minus }, + { 0x2EE1, opcode::OP_Invalid }, + { 0x2EE2, opcode::OP_Invalid }, + { 0x2EE3, opcode::OP_GetNegUnsignedShort }, + { 0x2EE4, opcode::OP_GetWorld }, + { 0x2EE5, opcode::OP_Invalid }, + { 0x2EE6, opcode::OP_WaitTill }, + { 0x2EE7, opcode::OP_GetAPIFunction }, + { 0x2EE8, opcode::OP_GetSelfObject }, + { 0x2EE9, opcode::OP_Wait }, + { 0x2EEA, opcode::OP_Jump }, + { 0x2EEB, opcode::OP_Invalid }, + { 0x2EEC, opcode::OP_GetLevel }, + { 0x2EED, opcode::OP_GetFloat }, + { 0x2EEE, opcode::OP_Invalid }, + { 0x2EEF, opcode::OP_JumpOnTrueExpr }, + { 0x2EF0, opcode::OP_WaitTillMatch }, + { 0x2EF1, opcode::OP_Multiply }, + { 0x2EF2, opcode::OP_ScriptMethodCallPointer }, + { 0x2EF3, opcode::OP_Invalid }, + { 0x2EF4, opcode::OP_GetGameRef }, + { 0x2EF5, opcode::OP_Invalid }, + { 0x2EF6, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x2EF7, opcode::OP_GetWorldObject }, + { 0x2EF8, opcode::OP_ScriptThreadCallPointer }, + { 0x2EF9, opcode::OP_Invalid }, + { 0x2EFA, opcode::OP_Invalid }, + { 0x2EFB, opcode::OP_Invalid }, + { 0x2EFC, opcode::OP_ProfileStop }, + { 0x2EFD, opcode::OP_EvalFieldVariable }, + { 0x2EFE, opcode::OP_New }, + { 0x2EFF, opcode::OP_Invalid }, + { 0x2F00, opcode::OP_NextArrayKey }, + { 0x2F01, opcode::OP_Invalid }, + { 0x2F02, opcode::OP_Invalid }, + { 0x2F03, opcode::OP_GetByte }, + { 0x2F04, opcode::OP_SetVariableField }, + { 0x2F05, opcode::OP_GreaterThan }, + { 0x2F06, opcode::OP_GetGame }, + { 0x2F07, opcode::OP_Invalid }, + { 0x2F08, opcode::OP_WaitTill }, + { 0x2F09, opcode::OP_Invalid }, + { 0x2F0A, opcode::OP_GetNegUnsignedShort }, + { 0x2F0B, opcode::OP_GetGameRef }, + { 0x2F0C, opcode::OP_GetLevelObject }, + { 0x2F0D, opcode::OP_Dec }, + { 0x2F0E, opcode::OP_JumpOnTrue }, + { 0x2F0F, opcode::OP_SizeOf }, + { 0x2F10, opcode::OP_GreaterThanOrEqualTo }, + { 0x2F11, opcode::OP_GetSelfObject }, + { 0x2F12, opcode::OP_Invalid }, + { 0x2F13, opcode::OP_Invalid }, + { 0x2F14, opcode::OP_SafeDecTop }, + { 0x2F15, opcode::OP_GetZero }, + { 0x2F16, opcode::OP_Notify }, + { 0x2F17, opcode::OP_Bit_Or }, + { 0x2F18, opcode::OP_ShiftLeft }, + { 0x2F19, opcode::OP_FirstArrayKey }, + { 0x2F1A, opcode::OP_Invalid }, + { 0x2F1B, opcode::OP_Wait }, + { 0x2F1C, opcode::OP_Return }, + { 0x2F1D, opcode::OP_Invalid }, + { 0x2F1E, opcode::OP_DevblockBegin }, + { 0x2F1F, opcode::OP_SetVariableField }, + { 0x2F20, opcode::OP_ShiftRight }, + { 0x2F21, opcode::OP_GetString }, + { 0x2F22, opcode::OP_Invalid }, + { 0x2F23, opcode::OP_ShiftRight }, + { 0x2F24, opcode::OP_Switch }, + { 0x2F25, opcode::OP_WaitTillMatch }, + { 0x2F26, opcode::OP_Invalid }, + { 0x2F27, opcode::OP_ScriptMethodCall }, + { 0x2F28, opcode::OP_New }, + { 0x2F29, opcode::OP_Invalid }, + { 0x2F2A, opcode::OP_VectorScale }, + { 0x2F2B, opcode::OP_New }, + { 0x2F2C, opcode::OP_EvalLocalVariableCached }, + { 0x2F2D, opcode::OP_Invalid }, + { 0x2F2E, opcode::OP_SetVariableField }, + { 0x2F2F, opcode::OP_Wait }, + { 0x2F30, opcode::OP_Invalid }, + { 0x2F31, opcode::OP_ScriptThreadCall }, + { 0x2F32, opcode::OP_SafeSetVariableFieldCached }, + { 0x2F33, opcode::OP_Invalid }, + { 0x2F34, opcode::OP_ScriptThreadCall }, + { 0x2F35, opcode::OP_GetVector }, + { 0x2F36, opcode::OP_GetFloat }, + { 0x2F37, opcode::OP_Modulus }, + { 0x2F38, opcode::OP_LessThan }, + { 0x2F39, opcode::OP_Invalid }, + { 0x2F3A, opcode::OP_DecTop }, + { 0x2F3B, opcode::OP_Invalid }, + { 0x2F3C, opcode::OP_EmptyArray }, + { 0x2F3D, opcode::OP_Invalid }, + { 0x2F3E, opcode::OP_SuperEqual }, + { 0x2F3F, opcode::OP_EvalArrayRef }, + { 0x2F40, opcode::OP_Invalid }, + { 0x2F41, opcode::OP_GetNegByte }, + { 0x2F42, opcode::OP_JumpOnTrue }, + { 0x2F43, opcode::OP_GetByte }, + { 0x2F44, opcode::OP_New }, + { 0x2F45, opcode::OP_BoolNot }, + { 0x2F46, opcode::OP_Invalid }, + { 0x2F47, opcode::OP_Wait }, + { 0x2F48, opcode::OP_Invalid }, + { 0x2F49, opcode::OP_EndSwitch }, + { 0x2F4A, opcode::OP_GetByte }, + { 0x2F4B, opcode::OP_Jump }, + { 0x2F4C, opcode::OP_Invalid }, + { 0x2F4D, opcode::OP_GetAPIFunction }, + { 0x2F4E, opcode::OP_Invalid }, + { 0x2F4F, opcode::OP_Plus }, + { 0x2F50, opcode::OP_Invalid }, + { 0x2F51, opcode::OP_Invalid }, + { 0x2F52, opcode::OP_SelfEvalFieldVariable }, + { 0x2F53, opcode::OP_Invalid }, + { 0x2F54, opcode::OP_Return }, + { 0x2F55, opcode::OP_Invalid }, + { 0x2F56, opcode::OP_JumpOnFalseExpr }, + { 0x2F57, opcode::OP_GetWorldObject }, + { 0x2F58, opcode::OP_GetAnimation }, + { 0x2F59, opcode::OP_SetVariableField }, + { 0x2F5A, opcode::OP_SelfEvalFieldVariable }, + { 0x2F5B, opcode::OP_Invalid }, + { 0x2F5C, opcode::OP_Bit_Xor }, + { 0x2F5D, opcode::OP_ScriptThreadCall }, + { 0x2F5E, opcode::OP_EmptyArray }, + { 0x2F5F, opcode::OP_GreaterThanOrEqualTo }, + { 0x2F60, opcode::OP_GetLevel }, + { 0x2F61, opcode::OP_WaitTillMatch }, + { 0x2F62, opcode::OP_GetHash }, + { 0x2F63, opcode::OP_Invalid }, + { 0x2F64, opcode::OP_Invalid }, + { 0x2F65, opcode::OP_Invalid }, + { 0x2F66, opcode::OP_EvalArray }, + { 0x2F67, opcode::OP_Invalid }, + { 0x2F68, opcode::OP_FirstArrayKey }, + { 0x2F69, opcode::OP_GetHash }, + { 0x2F6A, opcode::OP_Invalid }, + { 0x2F6B, opcode::OP_GetAPIFunction }, + { 0x2F6C, opcode::OP_RealWait }, + { 0x2F6D, opcode::OP_ScriptMethodCallPointer }, + { 0x2F6E, opcode::OP_GetNegByte }, + { 0x2F6F, opcode::OP_ShiftLeft }, + { 0x2F70, opcode::OP_DevblockBegin }, + { 0x2F71, opcode::OP_Bit_Or }, + { 0x2F72, opcode::OP_CallBuiltinMethod }, + { 0x2F73, opcode::OP_VectorScale }, + { 0x2F74, opcode::OP_Invalid }, + { 0x2F75, opcode::OP_Invalid }, + { 0x2F76, opcode::OP_LessThanOrEqualTo }, + { 0x2F77, opcode::OP_Invalid }, + { 0x2F78, opcode::OP_Invalid }, + { 0x2F79, opcode::OP_Invalid }, + { 0x2F7A, opcode::OP_ScriptMethodThreadCall }, + { 0x2F7B, opcode::OP_EvalLocalVariableCached }, + { 0x2F7C, opcode::OP_Notify }, + { 0x2F7D, opcode::OP_Invalid }, + { 0x2F7E, opcode::OP_VectorConstant }, + { 0x2F7F, opcode::OP_NextArrayKey }, + { 0x2F80, opcode::OP_GetString }, + { 0x2F81, opcode::OP_DecTop }, + { 0x2F82, opcode::OP_Invalid }, + { 0x2F83, opcode::OP_Invalid }, + { 0x2F84, opcode::OP_FirstArrayKey }, + { 0x2F85, opcode::OP_Bit_And }, + { 0x2F86, opcode::OP_Invalid }, + { 0x2F87, opcode::OP_GetTime }, + { 0x2F88, opcode::OP_SizeOf }, + { 0x2F89, opcode::OP_EmptyArray }, + { 0x2F8A, opcode::OP_DecTop }, + { 0x2F8B, opcode::OP_Invalid }, + { 0x2F8C, opcode::OP_GetUnsignedShort }, + { 0x2F8D, opcode::OP_SuperNotEqual }, + { 0x2F8E, opcode::OP_RealWait }, + { 0x2F8F, opcode::OP_LessThanOrEqualTo }, + { 0x2F90, opcode::OP_Invalid }, + { 0x2F91, opcode::OP_Invalid }, + { 0x2F92, opcode::OP_Invalid }, + { 0x2F93, opcode::OP_Invalid }, + { 0x2F94, opcode::OP_Plus }, + { 0x2F95, opcode::OP_Invalid }, + { 0x2F96, opcode::OP_GetAnimObject }, + { 0x2F97, opcode::OP_EndOn }, + { 0x2F98, opcode::OP_JumpOnFalse }, + { 0x2F99, opcode::OP_GetVector }, + { 0x2F9A, opcode::OP_LevelEvalFieldVariableRef }, + { 0x2F9B, opcode::OP_JumpOnFalse }, + { 0x2F9C, opcode::OP_VectorConstant }, + { 0x2F9D, opcode::OP_Invalid }, + { 0x2F9E, opcode::OP_New }, + { 0x2F9F, opcode::OP_Invalid }, + { 0x2FA0, opcode::OP_Bit_Xor }, + { 0x2FA1, opcode::OP_Invalid }, + { 0x2FA2, opcode::OP_Invalid }, + { 0x2FA3, opcode::OP_Invalid }, + { 0x2FA4, opcode::OP_GreaterThan }, + { 0x2FA5, opcode::OP_Invalid }, + { 0x2FA6, opcode::OP_Invalid }, + { 0x2FA7, opcode::OP_Notify }, + { 0x2FA8, opcode::OP_Invalid }, + { 0x2FA9, opcode::OP_EvalArray }, + { 0x2FAA, opcode::OP_Invalid }, + { 0x2FAB, opcode::OP_DecTop }, + { 0x2FAC, opcode::OP_ScriptFunctionCallClass }, + { 0x2FAD, opcode::OP_NextArrayKey }, + { 0x2FAE, opcode::OP_ProfileStop }, + { 0x2FAF, opcode::OP_Divide }, + { 0x2FB0, opcode::OP_Invalid }, + { 0x2FB1, opcode::OP_Modulus }, + { 0x2FB2, opcode::OP_GetIString }, + { 0x2FB3, opcode::OP_Divide }, + { 0x2FB4, opcode::OP_Invalid }, + { 0x2FB5, opcode::OP_EvalFieldVariableRef }, + { 0x2FB6, opcode::OP_ScriptMethodThreadCall }, + { 0x2FB7, opcode::OP_JumpOnFalse }, + { 0x2FB8, opcode::OP_SuperEqual }, + { 0x2FB9, opcode::OP_Invalid }, + { 0x2FBA, opcode::OP_Invalid }, + { 0x2FBB, opcode::OP_Invalid }, + { 0x2FBC, opcode::OP_LevelEvalFieldVariable }, + { 0x2FBD, opcode::OP_GetVector }, + { 0x2FBE, opcode::OP_Invalid }, + { 0x2FBF, opcode::OP_CallBuiltinMethod }, + { 0x2FC0, opcode::OP_ScriptMethodCall }, + { 0x2FC1, opcode::OP_ShiftLeft }, + { 0x2FC2, opcode::OP_LevelEvalFieldVariable }, + { 0x2FC3, opcode::OP_Minus }, + { 0x2FC4, opcode::OP_GetLevelObject }, + { 0x2FC5, opcode::OP_ProfileStop }, + { 0x2FC6, opcode::OP_GetAnim }, + { 0x2FC7, opcode::OP_GetHash }, + { 0x2FC8, opcode::OP_GetUintptr }, + { 0x2FC9, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x2FCA, opcode::OP_Invalid }, + { 0x2FCB, opcode::OP_CastFieldObject }, + { 0x2FCC, opcode::OP_Modulus }, + { 0x2FCD, opcode::OP_GetVector }, + { 0x2FCE, opcode::OP_EndSwitch }, + { 0x2FCF, opcode::OP_Invalid }, + { 0x2FD0, opcode::OP_ScriptThreadCallClass }, + { 0x2FD1, opcode::OP_Notify }, + { 0x2FD2, opcode::OP_Invalid }, + { 0x2FD3, opcode::OP_GetClassesObject }, + { 0x2FD4, opcode::OP_ClearFieldVariable }, + { 0x2FD5, opcode::OP_Invalid }, + { 0x2FD6, opcode::OP_ScriptMethodThreadCall }, + { 0x2FD7, opcode::OP_Return }, + { 0x2FD8, opcode::OP_Jump }, + { 0x2FD9, opcode::OP_EvalArrayRef }, + { 0x2FDA, opcode::OP_Notify }, + { 0x2FDB, opcode::OP_Invalid }, + { 0x2FDC, opcode::OP_Invalid }, + { 0x2FDD, opcode::OP_EvalFieldVariable }, + { 0x2FDE, opcode::OP_Invalid }, + { 0x2FDF, opcode::OP_Invalid }, + { 0x2FE0, opcode::OP_EvalArray }, + { 0x2FE1, opcode::OP_Invalid }, + { 0x2FE2, opcode::OP_Jump }, + { 0x2FE3, opcode::OP_EmptyArray }, + { 0x2FE4, opcode::OP_Bit_Xor }, + { 0x2FE5, opcode::OP_GetAPIFunction }, + { 0x2FE6, opcode::OP_VectorScale }, + { 0x2FE7, opcode::OP_Invalid }, + { 0x2FE8, opcode::OP_Invalid }, + { 0x2FE9, opcode::OP_CastFieldObject }, + { 0x2FEA, opcode::OP_EndSwitch }, + { 0x2FEB, opcode::OP_CallBuiltinMethod }, + { 0x2FEC, opcode::OP_JumpOnTrue }, + { 0x2FED, opcode::OP_Invalid }, + { 0x2FEE, opcode::OP_New }, + { 0x2FEF, opcode::OP_Invalid }, + { 0x2FF0, opcode::OP_New }, + { 0x2FF1, opcode::OP_Invalid }, + { 0x2FF2, opcode::OP_EvalArray }, + { 0x2FF3, opcode::OP_EndOn }, + { 0x2FF4, opcode::OP_GetIString }, + { 0x2FF5, opcode::OP_Wait }, + { 0x2FF6, opcode::OP_Vector }, + { 0x2FF7, opcode::OP_Invalid }, + { 0x2FF8, opcode::OP_GetInteger }, + { 0x2FF9, opcode::OP_NextArrayKey }, + { 0x2FFA, opcode::OP_ScriptMethodThreadCall }, + { 0x2FFB, opcode::OP_GetUintptr }, + { 0x2FFC, opcode::OP_GetUintptr }, + { 0x2FFD, opcode::OP_CastBool }, + { 0x2FFE, opcode::OP_Notify }, + { 0x2FFF, opcode::OP_Invalid }, + { 0x3000, opcode::OP_Invalid }, + { 0x3001, opcode::OP_Invalid }, + { 0x3002, opcode::OP_LevelEvalFieldVariable }, + { 0x3003, opcode::OP_Vector }, + { 0x3004, opcode::OP_Invalid }, + { 0x3005, opcode::OP_Invalid }, + { 0x3006, opcode::OP_JumpOnTrue }, + { 0x3007, opcode::OP_GetNegByte }, + { 0x3008, opcode::OP_Invalid }, + { 0x3009, opcode::OP_EndOn }, + { 0x300A, opcode::OP_GetClasses }, + { 0x300B, opcode::OP_ScriptThreadCall }, + { 0x300C, opcode::OP_GetSelf }, + { 0x300D, opcode::OP_GetFloat }, + { 0x300E, opcode::OP_ClearFieldVariable }, + { 0x300F, opcode::OP_SizeOf }, + { 0x3010, opcode::OP_FirstArrayKey }, + { 0x3011, opcode::OP_GetAnimObject }, + { 0x3012, opcode::OP_Invalid }, + { 0x3013, opcode::OP_Invalid }, + { 0x3014, opcode::OP_ClearFieldVariable }, + { 0x3015, opcode::OP_SelfEvalFieldVariable }, + { 0x3016, opcode::OP_Invalid }, + { 0x3017, opcode::OP_ShiftRight }, + { 0x3018, opcode::OP_Invalid }, + { 0x3019, opcode::OP_Inc }, + { 0x301A, opcode::OP_Invalid }, + { 0x301B, opcode::OP_VectorScale }, + { 0x301C, opcode::OP_Invalid }, + { 0x301D, opcode::OP_Wait }, + { 0x301E, opcode::OP_WaitTill }, + { 0x301F, opcode::OP_GetAnim }, + { 0x3020, opcode::OP_Invalid }, + { 0x3021, opcode::OP_SelfEvalFieldVariable }, + { 0x3022, opcode::OP_Invalid }, + { 0x3023, opcode::OP_Invalid }, + { 0x3024, opcode::OP_FirstArrayKey }, + { 0x3025, opcode::OP_SetVariableField }, + { 0x3026, opcode::OP_EvalLocalVariableRefCached }, + { 0x3027, opcode::OP_GetAnimObject }, + { 0x3028, opcode::OP_ScriptMethodCallPointer }, + { 0x3029, opcode::OP_SafeCreateLocalVariables }, + { 0x302A, opcode::OP_WaitTillMatch }, + { 0x302B, opcode::OP_Notify }, + { 0x302C, opcode::OP_GetWorld }, + { 0x302D, opcode::OP_EmptyArray }, + { 0x302E, opcode::OP_GetGame }, + { 0x302F, opcode::OP_Invalid }, + { 0x3030, opcode::OP_Notify }, + { 0x3031, opcode::OP_Invalid }, + { 0x3032, opcode::OP_Invalid }, + { 0x3033, opcode::OP_Invalid }, + { 0x3034, opcode::OP_SetVariableField }, + { 0x3035, opcode::OP_WaitTill }, + { 0x3036, opcode::OP_WaitTillFrameEnd }, + { 0x3037, opcode::OP_Jump }, + { 0x3038, opcode::OP_GetAPIFunction }, + { 0x3039, opcode::OP_SafeDecTop }, + { 0x303A, opcode::OP_WaitTillMatch }, + { 0x303B, opcode::OP_Invalid }, + { 0x303C, opcode::OP_EvalLocalVariableRefCached }, + { 0x303D, opcode::OP_Invalid }, + { 0x303E, opcode::OP_SuperEqual }, + { 0x303F, opcode::OP_GetString }, + { 0x3040, opcode::OP_Invalid }, + { 0x3041, opcode::OP_EvalFieldVariable }, + { 0x3042, opcode::OP_GetAnimation }, + { 0x3043, opcode::OP_Vector }, + { 0x3044, opcode::OP_Invalid }, + { 0x3045, opcode::OP_Invalid }, + { 0x3046, opcode::OP_GetNegUnsignedShort }, + { 0x3047, opcode::OP_GetString }, + { 0x3048, opcode::OP_JumpOnTrueExpr }, + { 0x3049, opcode::OP_DecTop }, + { 0x304A, opcode::OP_GetSelfObject }, + { 0x304B, opcode::OP_Invalid }, + { 0x304C, opcode::OP_GetZero }, + { 0x304D, opcode::OP_Invalid }, + { 0x304E, opcode::OP_WaitTill }, + { 0x304F, opcode::OP_Bit_Or }, + { 0x3050, opcode::OP_JumpOnTrue }, + { 0x3051, opcode::OP_ScriptFunctionCallPointer }, + { 0x3052, opcode::OP_Wait }, + { 0x3053, opcode::OP_GetClasses }, + { 0x3054, opcode::OP_VectorScale }, + { 0x3055, opcode::OP_Invalid }, + { 0x3056, opcode::OP_WaitTill }, + { 0x3057, opcode::OP_ClearFieldVariable }, + { 0x3058, opcode::OP_CastFieldObject }, + { 0x3059, opcode::OP_GetNegUnsignedShort }, + { 0x305A, opcode::OP_Multiply }, + { 0x305B, opcode::OP_Bit_And }, + { 0x305C, opcode::OP_Invalid }, + { 0x305D, opcode::OP_Invalid }, + { 0x305E, opcode::OP_VectorConstant }, + { 0x305F, opcode::OP_GetFloat }, + { 0x3060, opcode::OP_LessThanOrEqualTo }, + { 0x3061, opcode::OP_Invalid }, + { 0x3062, opcode::OP_Invalid }, + { 0x3063, opcode::OP_GetVector }, + { 0x3064, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x3065, opcode::OP_ScriptMethodThreadCall }, + { 0x3066, opcode::OP_ShiftLeft }, + { 0x3067, opcode::OP_EvalLocalVariableCached }, + { 0x3068, opcode::OP_GetAnimObject }, + { 0x3069, opcode::OP_Invalid }, + { 0x306A, opcode::OP_GetHash }, + { 0x306B, opcode::OP_ProfileStart }, + { 0x306C, opcode::OP_DecTop }, + { 0x306D, opcode::OP_ScriptThreadCallClass }, + { 0x306E, opcode::OP_GetLevel }, + { 0x306F, opcode::OP_Invalid }, + { 0x3070, opcode::OP_LevelEvalFieldVariable }, + { 0x3071, opcode::OP_Invalid }, + { 0x3072, opcode::OP_Invalid }, + { 0x3073, opcode::OP_GetSelfObject }, + { 0x3074, opcode::OP_Invalid }, + { 0x3075, opcode::OP_Invalid }, + { 0x3076, opcode::OP_ScriptMethodCallPointer }, + { 0x3077, opcode::OP_WaitTillFrameEnd }, + { 0x3078, opcode::OP_Invalid }, + { 0x3079, opcode::OP_Return }, + { 0x307A, opcode::OP_DevblockBegin }, + { 0x307B, opcode::OP_LevelEvalFieldVariableRef }, + { 0x307C, opcode::OP_Invalid }, + { 0x307D, opcode::OP_ScriptThreadCallClass }, + { 0x307E, opcode::OP_Invalid }, + { 0x307F, opcode::OP_GetFunction }, + { 0x3080, opcode::OP_GetUndefined }, + { 0x3081, opcode::OP_Invalid }, + { 0x3082, opcode::OP_JumpOnTrueExpr }, + { 0x3083, opcode::OP_GreaterThanOrEqualTo }, + { 0x3084, opcode::OP_WaitTill }, + { 0x3085, opcode::OP_EvalLocalVariableCached }, + { 0x3086, opcode::OP_Switch }, + { 0x3087, opcode::OP_Invalid }, + { 0x3088, opcode::OP_Bit_Or }, + { 0x3089, opcode::OP_LevelEvalFieldVariable }, + { 0x308A, opcode::OP_GetWorld }, + { 0x308B, opcode::OP_SetVariableField }, + { 0x308C, opcode::OP_EvalFieldVariable }, + { 0x308D, opcode::OP_SelfEvalFieldVariable }, + { 0x308E, opcode::OP_ScriptThreadCallClass }, + { 0x308F, opcode::OP_GetUndefined }, + { 0x3090, opcode::OP_GetFunction }, + { 0x3091, opcode::OP_JumpOnTrueExpr }, + { 0x3092, opcode::OP_ScriptThreadCallClass }, + { 0x3093, opcode::OP_ScriptFunctionCallClass }, + { 0x3094, opcode::OP_Modulus }, + { 0x3095, opcode::OP_GreaterThan }, + { 0x3096, opcode::OP_SizeOf }, + { 0x3097, opcode::OP_SafeSetVariableFieldCached }, + { 0x3098, opcode::OP_Bit_Or }, + { 0x3099, opcode::OP_New }, + { 0x309A, opcode::OP_GetAnim }, + { 0x309B, opcode::OP_ScriptFunctionCall }, + { 0x309C, opcode::OP_ShiftLeft }, + { 0x309D, opcode::OP_GetLevelObject }, + { 0x309E, opcode::OP_Invalid }, + { 0x309F, opcode::OP_ScriptFunctionCallPointer }, + { 0x30A0, opcode::OP_JumpOnTrueExpr }, + { 0x30A1, opcode::OP_SafeDecTop }, + { 0x30A2, opcode::OP_Invalid }, + { 0x30A3, opcode::OP_Invalid }, + { 0x30A4, opcode::OP_GetHash }, + { 0x30A5, opcode::OP_JumpOnFalseExpr }, + { 0x30A6, opcode::OP_Plus }, + { 0x30A7, opcode::OP_ScriptThreadCall }, + { 0x30A8, opcode::OP_GetHash }, + { 0x30A9, opcode::OP_EvalLocalVariableCached }, + { 0x30AA, opcode::OP_Invalid }, + { 0x30AB, opcode::OP_SafeDecTop }, + { 0x30AC, opcode::OP_Bit_Or }, + { 0x30AD, opcode::OP_GetVector }, + { 0x30AE, opcode::OP_GetAnimObject }, + { 0x30AF, opcode::OP_SafeDecTop }, + { 0x30B0, opcode::OP_Invalid }, + { 0x30B1, opcode::OP_Invalid }, + { 0x30B2, opcode::OP_SetVariableField }, + { 0x30B3, opcode::OP_GetTime }, + { 0x30B4, opcode::OP_CastFieldObject }, + { 0x30B5, opcode::OP_Plus }, + { 0x30B6, opcode::OP_GetWorld }, + { 0x30B7, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x30B8, opcode::OP_ScriptMethodThreadCall }, + { 0x30B9, opcode::OP_Invalid }, + { 0x30BA, opcode::OP_GreaterThanOrEqualTo }, + { 0x30BB, opcode::OP_EndSwitch }, + { 0x30BC, opcode::OP_JumpOnTrueExpr }, + { 0x30BD, opcode::OP_Invalid }, + { 0x30BE, opcode::OP_Return }, + { 0x30BF, opcode::OP_GetLevelObject }, + { 0x30C0, opcode::OP_Invalid }, + { 0x30C1, opcode::OP_SelfEvalFieldVariableRef }, + { 0x30C2, opcode::OP_Invalid }, + { 0x30C3, opcode::OP_Invalid }, + { 0x30C4, opcode::OP_GreaterThanOrEqualTo }, + { 0x30C5, opcode::OP_Invalid }, + { 0x30C6, opcode::OP_SafeSetVariableFieldCached }, + { 0x30C7, opcode::OP_JumpOnFalse }, + { 0x30C8, opcode::OP_Invalid }, + { 0x30C9, opcode::OP_Invalid }, + { 0x30CA, opcode::OP_GetAnim }, + { 0x30CB, opcode::OP_Invalid }, + { 0x30CC, opcode::OP_Invalid }, + { 0x30CD, opcode::OP_Invalid }, + { 0x30CE, opcode::OP_Invalid }, + { 0x30CF, opcode::OP_Invalid }, + { 0x30D0, opcode::OP_EmptyArray }, + { 0x30D1, opcode::OP_CastFieldObject }, + { 0x30D2, opcode::OP_JumpOnFalse }, + { 0x30D3, opcode::OP_Jump }, + { 0x30D4, opcode::OP_ScriptMethodThreadCall }, + { 0x30D5, opcode::OP_ShiftRight }, + { 0x30D6, opcode::OP_JumpOnFalseExpr }, + { 0x30D7, opcode::OP_Invalid }, + { 0x30D8, opcode::OP_Invalid }, + { 0x30D9, opcode::OP_Invalid }, + { 0x30DA, opcode::OP_SafeDecTop }, + { 0x30DB, opcode::OP_GetHash }, + { 0x30DC, opcode::OP_GetUndefined }, + { 0x30DD, opcode::OP_Invalid }, + { 0x30DE, opcode::OP_Invalid }, + { 0x30DF, opcode::OP_Notify }, + { 0x30E0, opcode::OP_ProfileStart }, + { 0x30E1, opcode::OP_Invalid }, + { 0x30E2, opcode::OP_SizeOf }, + { 0x30E3, opcode::OP_Bit_And }, + { 0x30E4, opcode::OP_GetFloat }, + { 0x30E5, opcode::OP_ClearFieldVariable }, + { 0x30E6, opcode::OP_Invalid }, + { 0x30E7, opcode::OP_GetNegByte }, + { 0x30E8, opcode::OP_GetInteger }, + { 0x30E9, opcode::OP_GetWorld }, + { 0x30EA, opcode::OP_ShiftLeft }, + { 0x30EB, opcode::OP_DevblockBegin }, + { 0x30EC, opcode::OP_VectorScale }, + { 0x30ED, opcode::OP_Invalid }, + { 0x30EE, opcode::OP_GetSelfObject }, + { 0x30EF, opcode::OP_Divide }, + { 0x30F0, opcode::OP_Invalid }, + { 0x30F1, opcode::OP_ScriptThreadCallClass }, + { 0x30F2, opcode::OP_Invalid }, + { 0x30F3, opcode::OP_GetAnimObject }, + { 0x30F4, opcode::OP_NextArrayKey }, + { 0x30F5, opcode::OP_GetSelfObject }, + { 0x30F6, opcode::OP_Modulus }, + { 0x30F7, opcode::OP_GetHash }, + { 0x30F8, opcode::OP_GetGame }, + { 0x30F9, opcode::OP_Multiply }, + { 0x30FA, opcode::OP_GetIString }, + { 0x30FB, opcode::OP_GetUintptr }, + { 0x30FC, opcode::OP_Wait }, + { 0x30FD, opcode::OP_CallBuiltinMethod }, + { 0x30FE, opcode::OP_Invalid }, + { 0x30FF, opcode::OP_ScriptThreadCallClass }, + { 0x3100, opcode::OP_CallBuiltinMethod }, + { 0x3101, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x3102, opcode::OP_Invalid }, + { 0x3103, opcode::OP_GetAnim }, + { 0x3104, opcode::OP_ProfileStop }, + { 0x3105, opcode::OP_GetString }, + { 0x3106, opcode::OP_IsDefined }, + { 0x3107, opcode::OP_Invalid }, + { 0x3108, opcode::OP_Invalid }, + { 0x3109, opcode::OP_RealWait }, + { 0x310A, opcode::OP_JumpOnFalse }, + { 0x310B, opcode::OP_DecTop }, + { 0x310C, opcode::OP_Invalid }, + { 0x310D, opcode::OP_GetHash }, + { 0x310E, opcode::OP_Invalid }, + { 0x310F, opcode::OP_EvalArray }, + { 0x3110, opcode::OP_SuperNotEqual }, + { 0x3111, opcode::OP_JumpOnFalseExpr }, + { 0x3112, opcode::OP_GetAnimObject }, + { 0x3113, opcode::OP_Invalid }, + { 0x3114, opcode::OP_NotEqual }, + { 0x3115, opcode::OP_Invalid }, + { 0x3116, opcode::OP_Invalid }, + { 0x3117, opcode::OP_ScriptThreadCall }, + { 0x3118, opcode::OP_EvalArray }, + { 0x3119, opcode::OP_GetUintptr }, + { 0x311A, opcode::OP_SafeDecTop }, + { 0x311B, opcode::OP_Invalid }, + { 0x311C, opcode::OP_Invalid }, + { 0x311D, opcode::OP_Bit_Xor }, + { 0x311E, opcode::OP_Invalid }, + { 0x311F, opcode::OP_Invalid }, + { 0x3120, opcode::OP_Invalid }, + { 0x3121, opcode::OP_EndSwitch }, + { 0x3122, opcode::OP_Jump }, + { 0x3123, opcode::OP_GetWorld }, + { 0x3124, opcode::OP_Invalid }, + { 0x3125, opcode::OP_JumpOnFalseExpr }, + { 0x3126, opcode::OP_GetWorldObject }, + { 0x3127, opcode::OP_EmptyArray }, + { 0x3128, opcode::OP_Return }, + { 0x3129, opcode::OP_NextArrayKey }, + { 0x312A, opcode::OP_ScriptFunctionCallClass }, + { 0x312B, opcode::OP_WaitTill }, + { 0x312C, opcode::OP_EndSwitch }, + { 0x312D, opcode::OP_Return }, + { 0x312E, opcode::OP_Invalid }, + { 0x312F, opcode::OP_LessThanOrEqualTo }, + { 0x3130, opcode::OP_Return }, + { 0x3131, opcode::OP_JumpOnTrue }, + { 0x3132, opcode::OP_Invalid }, + { 0x3133, opcode::OP_Invalid }, + { 0x3134, opcode::OP_LevelEvalFieldVariable }, + { 0x3135, opcode::OP_GetUnsignedShort }, + { 0x3136, opcode::OP_NextArrayKey }, + { 0x3137, opcode::OP_Invalid }, + { 0x3138, opcode::OP_Invalid }, + { 0x3139, opcode::OP_GetVector }, + { 0x313A, opcode::OP_GetHash }, + { 0x313B, opcode::OP_BoolComplement }, + { 0x313C, opcode::OP_IsDefined }, + { 0x313D, opcode::OP_Divide }, + { 0x313E, opcode::OP_ProfileStart }, + { 0x313F, opcode::OP_DevblockBegin }, + { 0x3140, opcode::OP_GetClasses }, + { 0x3141, opcode::OP_Invalid }, + { 0x3142, opcode::OP_GetVector }, + { 0x3143, opcode::OP_BoolComplement }, + { 0x3144, opcode::OP_Invalid }, + { 0x3145, opcode::OP_GetUnsignedShort }, + { 0x3146, opcode::OP_Invalid }, + { 0x3147, opcode::OP_Invalid }, + { 0x3148, opcode::OP_ProfileStop }, + { 0x3149, opcode::OP_Invalid }, + { 0x314A, opcode::OP_Invalid }, + { 0x314B, opcode::OP_GetUndefined }, + { 0x314C, opcode::OP_ClearFieldVariable }, + { 0x314D, opcode::OP_IsDefined }, + { 0x314E, opcode::OP_Invalid }, + { 0x314F, opcode::OP_Dec }, + { 0x3150, opcode::OP_Invalid }, + { 0x3151, opcode::OP_Invalid }, + { 0x3152, opcode::OP_Multiply }, + { 0x3153, opcode::OP_Vector }, + { 0x3154, opcode::OP_EvalLocalVariableRefCached }, + { 0x3155, opcode::OP_EmptyArray }, + { 0x3156, opcode::OP_BoolNot }, + { 0x3157, opcode::OP_Invalid }, + { 0x3158, opcode::OP_ShiftLeft }, + { 0x3159, opcode::OP_GetWorld }, + { 0x315A, opcode::OP_Invalid }, + { 0x315B, opcode::OP_Jump }, + { 0x315C, opcode::OP_Plus }, + { 0x315D, opcode::OP_JumpOnFalseExpr }, + { 0x315E, opcode::OP_Invalid }, + { 0x315F, opcode::OP_JumpOnFalseExpr }, + { 0x3160, opcode::OP_LessThan }, + { 0x3161, opcode::OP_ScriptThreadCall }, + { 0x3162, opcode::OP_JumpOnTrueExpr }, + { 0x3163, opcode::OP_GetGame }, + { 0x3164, opcode::OP_Bit_Or }, + { 0x3165, opcode::OP_Minus }, + { 0x3166, opcode::OP_Divide }, + { 0x3167, opcode::OP_GetIString }, + { 0x3168, opcode::OP_ScriptFunctionCallPointer }, + { 0x3169, opcode::OP_Invalid }, + { 0x316A, opcode::OP_LevelEvalFieldVariable }, + { 0x316B, opcode::OP_Invalid }, + { 0x316C, opcode::OP_GetSelf }, + { 0x316D, opcode::OP_SetVariableField }, + { 0x316E, opcode::OP_GetGame }, + { 0x316F, opcode::OP_SetVariableField }, + { 0x3170, opcode::OP_Invalid }, + { 0x3171, opcode::OP_Invalid }, + { 0x3172, opcode::OP_JumpOnFalseExpr }, + { 0x3173, opcode::OP_Invalid }, + { 0x3174, opcode::OP_Plus }, + { 0x3175, opcode::OP_GetFloat }, + { 0x3176, opcode::OP_LessThanOrEqualTo }, + { 0x3177, opcode::OP_DevblockBegin }, + { 0x3178, opcode::OP_Invalid }, + { 0x3179, opcode::OP_Jump }, + { 0x317A, opcode::OP_Invalid }, + { 0x317B, opcode::OP_GetAnim }, + { 0x317C, opcode::OP_EvalLocalVariableCached }, + { 0x317D, opcode::OP_Invalid }, + { 0x317E, opcode::OP_Invalid }, + { 0x317F, opcode::OP_Invalid }, + { 0x3180, opcode::OP_WaitTill }, + { 0x3181, opcode::OP_FirstArrayKey }, + { 0x3182, opcode::OP_EvalFieldVariable }, + { 0x3183, opcode::OP_Invalid }, + { 0x3184, opcode::OP_Bit_Xor }, + { 0x3185, opcode::OP_RealWait }, + { 0x3186, opcode::OP_Invalid }, + { 0x3187, opcode::OP_Invalid }, + { 0x3188, opcode::OP_LevelEvalFieldVariableRef }, + { 0x3189, opcode::OP_FirstArrayKey }, + { 0x318A, opcode::OP_Invalid }, + { 0x318B, opcode::OP_EvalFieldVariableRef }, + { 0x318C, opcode::OP_GetAnimObject }, + { 0x318D, opcode::OP_GetIString }, + { 0x318E, opcode::OP_Invalid }, + { 0x318F, opcode::OP_WaitTillFrameEnd }, + { 0x3190, opcode::OP_Invalid }, + { 0x3191, opcode::OP_Invalid }, + { 0x3192, opcode::OP_Wait }, + { 0x3193, opcode::OP_Invalid }, + { 0x3194, opcode::OP_ScriptMethodThreadCall }, + { 0x3195, opcode::OP_Invalid }, + { 0x3196, opcode::OP_SafeCreateLocalVariables }, + { 0x3197, opcode::OP_GetString }, + { 0x3198, opcode::OP_Invalid }, + { 0x3199, opcode::OP_Invalid }, + { 0x319A, opcode::OP_WaitTillFrameEnd }, + { 0x319B, opcode::OP_Invalid }, + { 0x319C, opcode::OP_Notify }, + { 0x319D, opcode::OP_Invalid }, + { 0x319E, opcode::OP_Invalid }, + { 0x319F, opcode::OP_Invalid }, + { 0x31A0, opcode::OP_Invalid }, + { 0x31A1, opcode::OP_ClearFieldVariable }, + { 0x31A2, opcode::OP_SuperNotEqual }, + { 0x31A3, opcode::OP_Invalid }, + { 0x31A4, opcode::OP_ScriptMethodCall }, + { 0x31A5, opcode::OP_Bit_Or }, + { 0x31A6, opcode::OP_GetClasses }, + { 0x31A7, opcode::OP_EvalLocalVariableCached }, + { 0x31A8, opcode::OP_EndOn }, + { 0x31A9, opcode::OP_SizeOf }, + { 0x31AA, opcode::OP_Bit_And }, + { 0x31AB, opcode::OP_VectorScale }, + { 0x31AC, opcode::OP_Invalid }, + { 0x31AD, opcode::OP_Inc }, + { 0x31AE, opcode::OP_Invalid }, + { 0x31AF, opcode::OP_JumpOnFalseExpr }, + { 0x31B0, opcode::OP_LessThan }, + { 0x31B1, opcode::OP_Invalid }, + { 0x31B2, opcode::OP_Invalid }, + { 0x31B3, opcode::OP_GetAPIFunction }, + { 0x31B4, opcode::OP_Switch }, + { 0x31B5, opcode::OP_Return }, + { 0x31B6, opcode::OP_Invalid }, + { 0x31B7, opcode::OP_DevblockBegin }, + { 0x31B8, opcode::OP_CallBuiltinMethod }, + { 0x31B9, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x31BA, opcode::OP_RealWait }, + { 0x31BB, opcode::OP_JumpOnFalseExpr }, + { 0x31BC, opcode::OP_Modulus }, + { 0x31BD, opcode::OP_JumpOnTrue }, + { 0x31BE, opcode::OP_GetWorldObject }, + { 0x31BF, opcode::OP_Invalid }, + { 0x31C0, opcode::OP_Invalid }, + { 0x31C1, opcode::OP_GetFloat }, + { 0x31C2, opcode::OP_JumpOnFalseExpr }, + { 0x31C3, opcode::OP_GetWorldObject }, + { 0x31C4, opcode::OP_VectorScale }, + { 0x31C5, opcode::OP_GetSelf }, + { 0x31C6, opcode::OP_JumpOnFalse }, + { 0x31C7, opcode::OP_Invalid }, + { 0x31C8, opcode::OP_SuperEqual }, + { 0x31C9, opcode::OP_GetUndefined }, + { 0x31CA, opcode::OP_EvalArray }, + { 0x31CB, opcode::OP_Invalid }, + { 0x31CC, opcode::OP_EvalLocalVariableRefCached }, + { 0x31CD, opcode::OP_ShiftRight }, + { 0x31CE, opcode::OP_RealWait }, + { 0x31CF, opcode::OP_FirstArrayKey }, + { 0x31D0, opcode::OP_Invalid }, + { 0x31D1, opcode::OP_ShiftRight }, + { 0x31D2, opcode::OP_NotEqual }, + { 0x31D3, opcode::OP_GreaterThan }, + { 0x31D4, opcode::OP_Return }, + { 0x31D5, opcode::OP_EndSwitch }, + { 0x31D6, opcode::OP_EmptyArray }, + { 0x31D7, opcode::OP_EndOn }, + { 0x31D8, opcode::OP_JumpOnTrue }, + { 0x31D9, opcode::OP_Switch }, + { 0x31DA, opcode::OP_Invalid }, + { 0x31DB, opcode::OP_GetWorldObject }, + { 0x31DC, opcode::OP_GetLevel }, + { 0x31DD, opcode::OP_Invalid }, + { 0x31DE, opcode::OP_ClearArray }, + { 0x31DF, opcode::OP_JumpOnTrue }, + { 0x31E0, opcode::OP_Invalid }, + { 0x31E1, opcode::OP_SafeSetVariableFieldCached }, + { 0x31E2, opcode::OP_NotEqual }, + { 0x31E3, opcode::OP_Invalid }, + { 0x31E4, opcode::OP_GetLevel }, + { 0x31E5, opcode::OP_LessThanOrEqualTo }, + { 0x31E6, opcode::OP_Invalid }, + { 0x31E7, opcode::OP_ScriptFunctionCallClass }, + { 0x31E8, opcode::OP_Invalid }, + { 0x31E9, opcode::OP_Invalid }, + { 0x31EA, opcode::OP_Invalid }, + { 0x31EB, opcode::OP_SafeDecTop }, + { 0x31EC, opcode::OP_SafeDecTop }, + { 0x31ED, opcode::OP_Invalid }, + { 0x31EE, opcode::OP_GetUndefined }, + { 0x31EF, opcode::OP_GetInteger }, + { 0x31F0, opcode::OP_Invalid }, + { 0x31F1, opcode::OP_GetHash }, + { 0x31F2, opcode::OP_Invalid }, + { 0x31F3, opcode::OP_LessThanOrEqualTo }, + { 0x31F4, opcode::OP_Invalid }, + { 0x31F5, opcode::OP_Invalid }, + { 0x31F6, opcode::OP_Invalid }, + { 0x31F7, opcode::OP_Invalid }, + { 0x31F8, opcode::OP_Jump }, + { 0x31F9, opcode::OP_Notify }, + { 0x31FA, opcode::OP_Invalid }, + { 0x31FB, opcode::OP_Invalid }, + { 0x31FC, opcode::OP_Invalid }, + { 0x31FD, opcode::OP_GreaterThanOrEqualTo }, + { 0x31FE, opcode::OP_GetByte }, + { 0x31FF, opcode::OP_NotEqual }, + { 0x3200, opcode::OP_Invalid }, + { 0x3201, opcode::OP_BoolComplement }, + { 0x3202, opcode::OP_Invalid }, + { 0x3203, opcode::OP_Invalid }, + { 0x3204, opcode::OP_GetSelf }, + { 0x3205, opcode::OP_GetIString }, + { 0x3206, opcode::OP_GetTime }, + { 0x3207, opcode::OP_ShiftLeft }, + { 0x3208, opcode::OP_Invalid }, + { 0x3209, opcode::OP_EvalLocalVariableCached }, + { 0x320A, opcode::OP_Notify }, + { 0x320B, opcode::OP_Wait }, + { 0x320C, opcode::OP_Invalid }, + { 0x320D, opcode::OP_Invalid }, + { 0x320E, opcode::OP_Invalid }, + { 0x320F, opcode::OP_CastBool }, + { 0x3210, opcode::OP_Invalid }, + { 0x3211, opcode::OP_Invalid }, + { 0x3212, opcode::OP_ClearFieldVariable }, + { 0x3213, opcode::OP_EvalLocalVariableCached }, + { 0x3214, opcode::OP_Plus }, + { 0x3215, opcode::OP_Invalid }, + { 0x3216, opcode::OP_Invalid }, + { 0x3217, opcode::OP_Notify }, + { 0x3218, opcode::OP_BoolNot }, + { 0x3219, opcode::OP_Invalid }, + { 0x321A, opcode::OP_Invalid }, + { 0x321B, opcode::OP_Invalid }, + { 0x321C, opcode::OP_ScriptMethodThreadCall }, + { 0x321D, opcode::OP_EvalArrayRef }, + { 0x321E, opcode::OP_NextArrayKey }, + { 0x321F, opcode::OP_GetVector }, + { 0x3220, opcode::OP_GreaterThanOrEqualTo }, + { 0x3221, opcode::OP_Invalid }, + { 0x3222, opcode::OP_Invalid }, + { 0x3223, opcode::OP_EvalLocalVariableRefCached }, + { 0x3224, opcode::OP_Invalid }, + { 0x3225, opcode::OP_Invalid }, + { 0x3226, opcode::OP_Invalid }, + { 0x3227, opcode::OP_SafeCreateLocalVariables }, + { 0x3228, opcode::OP_DevblockBegin }, + { 0x3229, opcode::OP_Notify }, + { 0x322A, opcode::OP_EvalLocalVariableRefCached }, + { 0x322B, opcode::OP_GetIString }, + { 0x322C, opcode::OP_GetSelfObject }, + { 0x322D, opcode::OP_ScriptThreadCall }, + { 0x322E, opcode::OP_JumpOnFalse }, + { 0x322F, opcode::OP_Invalid }, + { 0x3230, opcode::OP_Invalid }, + { 0x3231, opcode::OP_Invalid }, + { 0x3232, opcode::OP_Invalid }, + { 0x3233, opcode::OP_Invalid }, + { 0x3234, opcode::OP_GetAnimObject }, + { 0x3235, opcode::OP_Invalid }, + { 0x3236, opcode::OP_Invalid }, + { 0x3237, opcode::OP_Invalid }, + { 0x3238, opcode::OP_Invalid }, + { 0x3239, opcode::OP_EndSwitch }, + { 0x323A, opcode::OP_DecTop }, + { 0x323B, opcode::OP_Inc }, + { 0x323C, opcode::OP_ShiftLeft }, + { 0x323D, opcode::OP_EvalArray }, + { 0x323E, opcode::OP_ScriptFunctionCallClass }, + { 0x323F, opcode::OP_FirstArrayKey }, + { 0x3240, opcode::OP_ShiftLeft }, + { 0x3241, opcode::OP_Bit_Xor }, + { 0x3242, opcode::OP_ShiftRight }, + { 0x3243, opcode::OP_SafeCreateLocalVariables }, + { 0x3244, opcode::OP_GetClasses }, + { 0x3245, opcode::OP_Invalid }, + { 0x3246, opcode::OP_IsDefined }, + { 0x3247, opcode::OP_CastBool }, + { 0x3248, opcode::OP_Invalid }, + { 0x3249, opcode::OP_Bit_Or }, + { 0x324A, opcode::OP_WaitTillMatch }, + { 0x324B, opcode::OP_EndSwitch }, + { 0x324C, opcode::OP_GetAnimObject }, + { 0x324D, opcode::OP_Bit_Or }, + { 0x324E, opcode::OP_GetNegUnsignedShort }, + { 0x324F, opcode::OP_JumpOnTrue }, + { 0x3250, opcode::OP_EvalFieldVariable }, + { 0x3251, opcode::OP_Invalid }, + { 0x3252, opcode::OP_Invalid }, + { 0x3253, opcode::OP_Invalid }, + { 0x3254, opcode::OP_Invalid }, + { 0x3255, opcode::OP_Invalid }, + { 0x3256, opcode::OP_Invalid }, + { 0x3257, opcode::OP_RealWait }, + { 0x3258, opcode::OP_Invalid }, + { 0x3259, opcode::OP_Invalid }, + { 0x325A, opcode::OP_Invalid }, + { 0x325B, opcode::OP_Invalid }, + { 0x325C, opcode::OP_Invalid }, + { 0x325D, opcode::OP_GetWorld }, + { 0x325E, opcode::OP_Invalid }, + { 0x325F, opcode::OP_NextArrayKey }, + { 0x3260, opcode::OP_EmptyArray }, + { 0x3261, opcode::OP_Invalid }, + { 0x3262, opcode::OP_SafeDecTop }, + { 0x3263, opcode::OP_GetAnimObject }, + { 0x3264, opcode::OP_JumpOnFalse }, + { 0x3265, opcode::OP_Invalid }, + { 0x3266, opcode::OP_New }, + { 0x3267, opcode::OP_GetWorldObject }, + { 0x3268, opcode::OP_Invalid }, + { 0x3269, opcode::OP_GreaterThanOrEqualTo }, + { 0x326A, opcode::OP_VectorConstant }, + { 0x326B, opcode::OP_ShiftLeft }, + { 0x326C, opcode::OP_Invalid }, + { 0x326D, opcode::OP_New }, + { 0x326E, opcode::OP_DecTop }, + { 0x326F, opcode::OP_EvalArray }, + { 0x3270, opcode::OP_Invalid }, + { 0x3271, opcode::OP_WaitTillMatch }, + { 0x3272, opcode::OP_GetHash }, + { 0x3273, opcode::OP_Invalid }, + { 0x3274, opcode::OP_ShiftLeft }, + { 0x3275, opcode::OP_ShiftRight }, + { 0x3276, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x3277, opcode::OP_Invalid }, + { 0x3278, opcode::OP_Invalid }, + { 0x3279, opcode::OP_GetSelfObject }, + { 0x327A, opcode::OP_Invalid }, + { 0x327B, opcode::OP_Invalid }, + { 0x327C, opcode::OP_SafeCreateLocalVariables }, + { 0x327D, opcode::OP_GetString }, + { 0x327E, opcode::OP_GetZero }, + { 0x327F, opcode::OP_GetFunction }, + { 0x3280, opcode::OP_WaitTillFrameEnd }, + { 0x3281, opcode::OP_Invalid }, + { 0x3282, opcode::OP_Invalid }, + { 0x3283, opcode::OP_SafeSetVariableFieldCached }, + { 0x3284, opcode::OP_Jump }, + { 0x3285, opcode::OP_BoolNot }, + { 0x3286, opcode::OP_Invalid }, + { 0x3287, opcode::OP_ClearFieldVariable }, + { 0x3288, opcode::OP_Bit_Xor }, + { 0x3289, opcode::OP_EvalFieldVariable }, + { 0x328A, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x328B, opcode::OP_Invalid }, + { 0x328C, opcode::OP_Multiply }, + { 0x328D, opcode::OP_ScriptFunctionCallPointer }, + { 0x328E, opcode::OP_Invalid }, + { 0x328F, opcode::OP_ScriptMethodCall }, + { 0x3290, opcode::OP_Invalid }, + { 0x3291, opcode::OP_GetByte }, + { 0x3292, opcode::OP_Divide }, + { 0x3293, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x3294, opcode::OP_Invalid }, + { 0x3295, opcode::OP_Invalid }, + { 0x3296, opcode::OP_Invalid }, + { 0x3297, opcode::OP_Bit_Or }, + { 0x3298, opcode::OP_Invalid }, + { 0x3299, opcode::OP_SafeSetVariableFieldCached }, + { 0x329A, opcode::OP_Invalid }, + { 0x329B, opcode::OP_ShiftLeft }, + { 0x329C, opcode::OP_GetWorld }, + { 0x329D, opcode::OP_ClearFieldVariable }, + { 0x329E, opcode::OP_SafeSetVariableFieldCached }, + { 0x329F, opcode::OP_Invalid }, + { 0x32A0, opcode::OP_Bit_Xor }, + { 0x32A1, opcode::OP_Invalid }, + { 0x32A2, opcode::OP_ScriptMethodCall }, + { 0x32A3, opcode::OP_DecTop }, + { 0x32A4, opcode::OP_ProfileStop }, + { 0x32A5, opcode::OP_Invalid }, + { 0x32A6, opcode::OP_DevblockBegin }, + { 0x32A7, opcode::OP_JumpOnFalseExpr }, + { 0x32A8, opcode::OP_Invalid }, + { 0x32A9, opcode::OP_Invalid }, + { 0x32AA, opcode::OP_GetUnsignedShort }, + { 0x32AB, opcode::OP_Vector }, + { 0x32AC, opcode::OP_Invalid }, + { 0x32AD, opcode::OP_Invalid }, + { 0x32AE, opcode::OP_ShiftLeft }, + { 0x32AF, opcode::OP_Invalid }, + { 0x32B0, opcode::OP_GetGame }, + { 0x32B1, opcode::OP_Invalid }, + { 0x32B2, opcode::OP_Invalid }, + { 0x32B3, opcode::OP_GetUnsignedShort }, + { 0x32B4, opcode::OP_GetGame }, + { 0x32B5, opcode::OP_SelfEvalFieldVariable }, + { 0x32B6, opcode::OP_SelfEvalFieldVariable }, + { 0x32B7, opcode::OP_Invalid }, + { 0x32B8, opcode::OP_Invalid }, + { 0x32B9, opcode::OP_Invalid }, + { 0x32BA, opcode::OP_GetZero }, + { 0x32BB, opcode::OP_FirstArrayKey }, + { 0x32BC, opcode::OP_ScriptThreadCallPointer }, + { 0x32BD, opcode::OP_GetAnimObject }, + { 0x32BE, opcode::OP_EvalFieldVariable }, + { 0x32BF, opcode::OP_Invalid }, + { 0x32C0, opcode::OP_Bit_And }, + { 0x32C1, opcode::OP_Jump }, + { 0x32C2, opcode::OP_GetAnimObject }, + { 0x32C3, opcode::OP_Invalid }, + { 0x32C4, opcode::OP_CastBool }, + { 0x32C5, opcode::OP_WaitTillMatch }, + { 0x32C6, opcode::OP_Invalid }, + { 0x32C7, opcode::OP_Invalid }, + { 0x32C8, opcode::OP_DevblockBegin }, + { 0x32C9, opcode::OP_Invalid }, + { 0x32CA, opcode::OP_Invalid }, + { 0x32CB, opcode::OP_Invalid }, + { 0x32CC, opcode::OP_Invalid }, + { 0x32CD, opcode::OP_Invalid }, + { 0x32CE, opcode::OP_Invalid }, + { 0x32CF, opcode::OP_ScriptFunctionCallPointer }, + { 0x32D0, opcode::OP_Invalid }, + { 0x32D1, opcode::OP_Invalid }, + { 0x32D2, opcode::OP_CastBool }, + { 0x32D3, opcode::OP_Invalid }, + { 0x32D4, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x32D5, opcode::OP_Invalid }, + { 0x32D6, opcode::OP_ShiftLeft }, + { 0x32D7, opcode::OP_GetUndefined }, + { 0x32D8, opcode::OP_SelfEvalFieldVariableRef }, + { 0x32D9, opcode::OP_Invalid }, + { 0x32DA, opcode::OP_Invalid }, + { 0x32DB, opcode::OP_EvalFieldVariableRef }, + { 0x32DC, opcode::OP_Switch }, + { 0x32DD, opcode::OP_ScriptMethodCall }, + { 0x32DE, opcode::OP_Invalid }, + { 0x32DF, opcode::OP_Invalid }, + { 0x32E0, opcode::OP_VectorScale }, + { 0x32E1, opcode::OP_CallBuiltinMethod }, + { 0x32E2, opcode::OP_Multiply }, + { 0x32E3, opcode::OP_ScriptMethodThreadCall }, + { 0x32E4, opcode::OP_Invalid }, + { 0x32E5, opcode::OP_Modulus }, + { 0x32E6, opcode::OP_WaitTill }, + { 0x32E7, opcode::OP_GetClasses }, + { 0x32E8, opcode::OP_Bit_Xor }, + { 0x32E9, opcode::OP_GetAPIFunction }, + { 0x32EA, opcode::OP_Invalid }, + { 0x32EB, opcode::OP_Invalid }, + { 0x32EC, opcode::OP_Invalid }, + { 0x32ED, opcode::OP_Wait }, + { 0x32EE, opcode::OP_GetUnsignedShort }, + { 0x32EF, opcode::OP_GetFunction }, + { 0x32F0, opcode::OP_GetFloat }, + { 0x32F1, opcode::OP_Invalid }, + { 0x32F2, opcode::OP_ScriptMethodThreadCall }, + { 0x32F3, opcode::OP_Invalid }, + { 0x32F4, opcode::OP_WaitTillMatch }, + { 0x32F5, opcode::OP_Invalid }, + { 0x32F6, opcode::OP_EvalFieldVariable }, + { 0x32F7, opcode::OP_Invalid }, + { 0x32F8, opcode::OP_Bit_Or }, + { 0x32F9, opcode::OP_Multiply }, + { 0x32FA, opcode::OP_ClearArray }, + { 0x32FB, opcode::OP_GetUintptr }, + { 0x32FC, opcode::OP_Invalid }, + { 0x32FD, opcode::OP_EvalArray }, + { 0x32FE, opcode::OP_Invalid }, + { 0x32FF, opcode::OP_EvalFieldVariable }, + { 0x3300, opcode::OP_ShiftRight }, + { 0x3301, opcode::OP_EvalLocalVariableRefCached }, + { 0x3302, opcode::OP_Invalid }, + { 0x3303, opcode::OP_Invalid }, + { 0x3304, opcode::OP_Jump }, + { 0x3305, opcode::OP_GetWorld }, + { 0x3306, opcode::OP_ProfileStart }, + { 0x3307, opcode::OP_Invalid }, + { 0x3308, opcode::OP_SafeCreateLocalVariables }, + { 0x3309, opcode::OP_GetByte }, + { 0x330A, opcode::OP_GetFloat }, + { 0x330B, opcode::OP_SelfEvalFieldVariable }, + { 0x330C, opcode::OP_Notify }, + { 0x330D, opcode::OP_Invalid }, + { 0x330E, opcode::OP_Invalid }, + { 0x330F, opcode::OP_GetClassesObject }, + { 0x3310, opcode::OP_Invalid }, + { 0x3311, opcode::OP_Invalid }, + { 0x3312, opcode::OP_LessThan }, + { 0x3313, opcode::OP_SuperNotEqual }, + { 0x3314, opcode::OP_Invalid }, + { 0x3315, opcode::OP_DecTop }, + { 0x3316, opcode::OP_Invalid }, + { 0x3317, opcode::OP_Bit_Xor }, + { 0x3318, opcode::OP_Invalid }, + { 0x3319, opcode::OP_GetFloat }, + { 0x331A, opcode::OP_Invalid }, + { 0x331B, opcode::OP_CastBool }, + { 0x331C, opcode::OP_Invalid }, + { 0x331D, opcode::OP_JumpOnFalseExpr }, + { 0x331E, opcode::OP_Invalid }, + { 0x331F, opcode::OP_GetAnim }, + { 0x3320, opcode::OP_ShiftRight }, + { 0x3321, opcode::OP_Invalid }, + { 0x3322, opcode::OP_GetWorldObject }, + { 0x3323, opcode::OP_Invalid }, + { 0x3324, opcode::OP_Invalid }, + { 0x3325, opcode::OP_Wait }, + { 0x3326, opcode::OP_Wait }, + { 0x3327, opcode::OP_ClearFieldVariable }, + { 0x3328, opcode::OP_EvalLocalVariableCached }, + { 0x3329, opcode::OP_Invalid }, + { 0x332A, opcode::OP_GetHash }, + { 0x332B, opcode::OP_NextArrayKey }, + { 0x332C, opcode::OP_Invalid }, + { 0x332D, opcode::OP_ClearFieldVariable }, + { 0x332E, opcode::OP_Invalid }, + { 0x332F, opcode::OP_Invalid }, + { 0x3330, opcode::OP_Invalid }, + { 0x3331, opcode::OP_GetUintptr }, + { 0x3332, opcode::OP_Invalid }, + { 0x3333, opcode::OP_GreaterThanOrEqualTo }, + { 0x3334, opcode::OP_Invalid }, + { 0x3335, opcode::OP_Invalid }, + { 0x3336, opcode::OP_Minus }, + { 0x3337, opcode::OP_GetHash }, + { 0x3338, opcode::OP_EndOn }, + { 0x3339, opcode::OP_Invalid }, + { 0x333A, opcode::OP_LevelEvalFieldVariableRef }, + { 0x333B, opcode::OP_Invalid }, + { 0x333C, opcode::OP_GetGameRef }, + { 0x333D, opcode::OP_CastFieldObject }, + { 0x333E, opcode::OP_Invalid }, + { 0x333F, opcode::OP_Invalid }, + { 0x3340, opcode::OP_ClearFieldVariable }, + { 0x3341, opcode::OP_EndOn }, + { 0x3342, opcode::OP_Invalid }, + { 0x3343, opcode::OP_Invalid }, + { 0x3344, opcode::OP_GetClasses }, + { 0x3345, opcode::OP_BoolComplement }, + { 0x3346, opcode::OP_GetFloat }, + { 0x3347, opcode::OP_GreaterThan }, + { 0x3348, opcode::OP_Invalid }, + { 0x3349, opcode::OP_ScriptFunctionCallPointer }, + { 0x334A, opcode::OP_Plus }, + { 0x334B, opcode::OP_JumpOnTrueExpr }, + { 0x334C, opcode::OP_Invalid }, + { 0x334D, opcode::OP_Invalid }, + { 0x334E, opcode::OP_Invalid }, + { 0x334F, opcode::OP_EvalLocalVariableCached }, + { 0x3350, opcode::OP_New }, + { 0x3351, opcode::OP_WaitTillMatch }, + { 0x3352, opcode::OP_SelfEvalFieldVariable }, + { 0x3353, opcode::OP_ScriptFunctionCallPointer }, + { 0x3354, opcode::OP_Invalid }, + { 0x3355, opcode::OP_Invalid }, + { 0x3356, opcode::OP_New }, + { 0x3357, opcode::OP_ScriptThreadCall }, + { 0x3358, opcode::OP_Invalid }, + { 0x3359, opcode::OP_New }, + { 0x335A, opcode::OP_Invalid }, + { 0x335B, opcode::OP_VectorConstant }, + { 0x335C, opcode::OP_SelfEvalFieldVariableRef }, + { 0x335D, opcode::OP_Invalid }, + { 0x335E, opcode::OP_Invalid }, + { 0x335F, opcode::OP_Invalid }, + { 0x3360, opcode::OP_SuperEqual }, + { 0x3361, opcode::OP_Invalid }, + { 0x3362, opcode::OP_Divide }, + { 0x3363, opcode::OP_Invalid }, + { 0x3364, opcode::OP_CastFieldObject }, + { 0x3365, opcode::OP_Multiply }, + { 0x3366, opcode::OP_Invalid }, + { 0x3367, opcode::OP_Invalid }, + { 0x3368, opcode::OP_GetString }, + { 0x3369, opcode::OP_EvalArray }, + { 0x336A, opcode::OP_JumpOnTrueExpr }, + { 0x336B, opcode::OP_SizeOf }, + { 0x336C, opcode::OP_Invalid }, + { 0x336D, opcode::OP_GetSelfObject }, + { 0x336E, opcode::OP_ScriptThreadCallClass }, + { 0x336F, opcode::OP_GetClasses }, + { 0x3370, opcode::OP_GetString }, + { 0x3371, opcode::OP_Invalid }, + { 0x3372, opcode::OP_SafeDecTop }, + { 0x3373, opcode::OP_SafeSetVariableFieldCached }, + { 0x3374, opcode::OP_GetAnimObject }, + { 0x3375, opcode::OP_ShiftRight }, + { 0x3376, opcode::OP_Invalid }, + { 0x3377, opcode::OP_GetUndefined }, + { 0x3378, opcode::OP_BoolComplement }, + { 0x3379, opcode::OP_WaitTillMatch }, + { 0x337A, opcode::OP_GetWorld }, + { 0x337B, opcode::OP_GreaterThan }, + { 0x337C, opcode::OP_RealWait }, + { 0x337D, opcode::OP_Invalid }, + { 0x337E, opcode::OP_Invalid }, + { 0x337F, opcode::OP_GetLevelObject }, + { 0x3380, opcode::OP_Invalid }, + { 0x3381, opcode::OP_Invalid }, + { 0x3382, opcode::OP_Multiply }, + { 0x3383, opcode::OP_Invalid }, + { 0x3384, opcode::OP_Invalid }, + { 0x3385, opcode::OP_Invalid }, + { 0x3386, opcode::OP_Invalid }, + { 0x3387, opcode::OP_Invalid }, + { 0x3388, opcode::OP_Invalid }, + { 0x3389, opcode::OP_Invalid }, + { 0x338A, opcode::OP_Invalid }, + { 0x338B, opcode::OP_ScriptMethodCall }, + { 0x338C, opcode::OP_GetLevelObject }, + { 0x338D, opcode::OP_Invalid }, + { 0x338E, opcode::OP_EvalArrayRef }, + { 0x338F, opcode::OP_Invalid }, + { 0x3390, opcode::OP_ClearArray }, + { 0x3391, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x3392, opcode::OP_EvalLocalVariableRefCached }, + { 0x3393, opcode::OP_GetSelfObject }, + { 0x3394, opcode::OP_Invalid }, + { 0x3395, opcode::OP_GetIString }, + { 0x3396, opcode::OP_ClearArray }, + { 0x3397, opcode::OP_Invalid }, + { 0x3398, opcode::OP_VectorScale }, + { 0x3399, opcode::OP_WaitTill }, + { 0x339A, opcode::OP_SafeCreateLocalVariables }, + { 0x339B, opcode::OP_Invalid }, + { 0x339C, opcode::OP_Invalid }, + { 0x339D, opcode::OP_Dec }, + { 0x339E, opcode::OP_EndSwitch }, + { 0x339F, opcode::OP_Wait }, + { 0x33A0, opcode::OP_Invalid }, + { 0x33A1, opcode::OP_Invalid }, + { 0x33A2, opcode::OP_ScriptThreadCallPointer }, + { 0x33A3, opcode::OP_Invalid }, + { 0x33A4, opcode::OP_GetAnimation }, + { 0x33A5, opcode::OP_GetLevel }, + { 0x33A6, opcode::OP_Invalid }, + { 0x33A7, opcode::OP_ShiftLeft }, + { 0x33A8, opcode::OP_Invalid }, + { 0x33A9, opcode::OP_GetClassesObject }, + { 0x33AA, opcode::OP_Wait }, + { 0x33AB, opcode::OP_Invalid }, + { 0x33AC, opcode::OP_Equal }, + { 0x33AD, opcode::OP_GetLevel }, + { 0x33AE, opcode::OP_Invalid }, + { 0x33AF, opcode::OP_VectorConstant }, + { 0x33B0, opcode::OP_Invalid }, + { 0x33B1, opcode::OP_Modulus }, + { 0x33B2, opcode::OP_GetByte }, + { 0x33B3, opcode::OP_GetNegUnsignedShort }, + { 0x33B4, opcode::OP_SuperEqual }, + { 0x33B5, opcode::OP_Invalid }, + { 0x33B6, opcode::OP_Invalid }, + { 0x33B7, opcode::OP_Invalid }, + { 0x33B8, opcode::OP_Invalid }, + { 0x33B9, opcode::OP_Invalid }, + { 0x33BA, opcode::OP_Invalid }, + { 0x33BB, opcode::OP_Invalid }, + { 0x33BC, opcode::OP_Invalid }, + { 0x33BD, opcode::OP_WaitTillMatch }, + { 0x33BE, opcode::OP_Invalid }, + { 0x33BF, opcode::OP_GetAPIFunction }, + { 0x33C0, opcode::OP_Vector }, + { 0x33C1, opcode::OP_Invalid }, + { 0x33C2, opcode::OP_Invalid }, + { 0x33C3, opcode::OP_Invalid }, + { 0x33C4, opcode::OP_Invalid }, + { 0x33C5, opcode::OP_Switch }, + { 0x33C6, opcode::OP_ScriptFunctionCallPointer }, + { 0x33C7, opcode::OP_RealWait }, + { 0x33C8, opcode::OP_ScriptMethodCallPointer }, + { 0x33C9, opcode::OP_Invalid }, + { 0x33CA, opcode::OP_LessThan }, + { 0x33CB, opcode::OP_Invalid }, + { 0x33CC, opcode::OP_Notify }, + { 0x33CD, opcode::OP_GetHash }, + { 0x33CE, opcode::OP_Invalid }, + { 0x33CF, opcode::OP_LevelEvalFieldVariable }, + { 0x33D0, opcode::OP_Invalid }, + { 0x33D1, opcode::OP_GetIString }, + { 0x33D2, opcode::OP_Invalid }, + { 0x33D3, opcode::OP_Invalid }, + { 0x33D4, opcode::OP_JumpOnTrue }, + { 0x33D5, opcode::OP_Invalid }, + { 0x33D6, opcode::OP_ProfileStart }, + { 0x33D7, opcode::OP_Invalid }, + { 0x33D8, opcode::OP_Invalid }, + { 0x33D9, opcode::OP_GreaterThanOrEqualTo }, + { 0x33DA, opcode::OP_DevblockBegin }, + { 0x33DB, opcode::OP_GetUndefined }, + { 0x33DC, opcode::OP_Invalid }, + { 0x33DD, opcode::OP_Invalid }, + { 0x33DE, opcode::OP_EvalArray }, + { 0x33DF, opcode::OP_Invalid }, + { 0x33E0, opcode::OP_Invalid }, + { 0x33E1, opcode::OP_GetString }, + { 0x33E2, opcode::OP_GetClassesObject }, + { 0x33E3, opcode::OP_GetAnim }, + { 0x33E4, opcode::OP_Invalid }, + { 0x33E5, opcode::OP_SafeCreateLocalVariables }, + { 0x33E6, opcode::OP_Invalid }, + { 0x33E7, opcode::OP_Invalid }, + { 0x33E8, opcode::OP_New }, + { 0x33E9, opcode::OP_GetFloat }, + { 0x33EA, opcode::OP_Invalid }, + { 0x33EB, opcode::OP_GetSelf }, + { 0x33EC, opcode::OP_ScriptFunctionCallPointer }, + { 0x33ED, opcode::OP_Invalid }, + { 0x33EE, opcode::OP_Invalid }, + { 0x33EF, opcode::OP_GetInteger }, + { 0x33F0, opcode::OP_Invalid }, + { 0x33F1, opcode::OP_Invalid }, + { 0x33F2, opcode::OP_ClearFieldVariable }, + { 0x33F3, opcode::OP_Invalid }, + { 0x33F4, opcode::OP_Invalid }, + { 0x33F5, opcode::OP_LessThan }, + { 0x33F6, opcode::OP_GetFloat }, + { 0x33F7, opcode::OP_GetWorld }, + { 0x33F8, opcode::OP_ScriptThreadCallClass }, + { 0x33F9, opcode::OP_New }, + { 0x33FA, opcode::OP_Invalid }, + { 0x33FB, opcode::OP_ClearArray }, + { 0x33FC, opcode::OP_ScriptMethodCall }, + { 0x33FD, opcode::OP_Invalid }, + { 0x33FE, opcode::OP_JumpOnFalseExpr }, + { 0x33FF, opcode::OP_GetFunction }, + { 0x3400, opcode::OP_BoolComplement }, + { 0x3401, opcode::OP_Invalid }, + { 0x3402, opcode::OP_SafeDecTop }, + { 0x3403, opcode::OP_WaitTill }, + { 0x3404, opcode::OP_Invalid }, + { 0x3405, opcode::OP_Invalid }, + { 0x3406, opcode::OP_EndOn }, + { 0x3407, opcode::OP_RealWait }, + { 0x3408, opcode::OP_EvalFieldVariable }, + { 0x3409, opcode::OP_JumpOnFalseExpr }, + { 0x340A, opcode::OP_ClearFieldVariable }, + { 0x340B, opcode::OP_EndOn }, + { 0x340C, opcode::OP_IsDefined }, + { 0x340D, opcode::OP_ScriptMethodCallPointer }, + { 0x340E, opcode::OP_Invalid }, + { 0x340F, opcode::OP_Bit_And }, + { 0x3410, opcode::OP_Invalid }, + { 0x3411, opcode::OP_GetNegUnsignedShort }, + { 0x3412, opcode::OP_CastBool }, + { 0x3413, opcode::OP_Invalid }, + { 0x3414, opcode::OP_Invalid }, + { 0x3415, opcode::OP_Invalid }, + { 0x3416, opcode::OP_Invalid }, + { 0x3417, opcode::OP_Invalid }, + { 0x3418, opcode::OP_ProfileStart }, + { 0x3419, opcode::OP_Invalid }, + { 0x341A, opcode::OP_Invalid }, + { 0x341B, opcode::OP_Plus }, + { 0x341C, opcode::OP_GetZero }, + { 0x341D, opcode::OP_Invalid }, + { 0x341E, opcode::OP_GreaterThanOrEqualTo }, + { 0x341F, opcode::OP_EndSwitch }, + { 0x3420, opcode::OP_Invalid }, + { 0x3421, opcode::OP_Invalid }, + { 0x3422, opcode::OP_Invalid }, + { 0x3423, opcode::OP_GetHash }, + { 0x3424, opcode::OP_Invalid }, + { 0x3425, opcode::OP_Invalid }, + { 0x3426, opcode::OP_IsDefined }, + { 0x3427, opcode::OP_LevelEvalFieldVariableRef }, + { 0x3428, opcode::OP_Invalid }, + { 0x3429, opcode::OP_EvalFieldVariableRef }, + { 0x342A, opcode::OP_GetAnimObject }, + { 0x342B, opcode::OP_Invalid }, + { 0x342C, opcode::OP_JumpOnFalse }, + { 0x342D, opcode::OP_Invalid }, + { 0x342E, opcode::OP_JumpOnTrueExpr }, + { 0x342F, opcode::OP_WaitTillMatch }, + { 0x3430, opcode::OP_ScriptMethodCallPointer }, + { 0x3431, opcode::OP_Invalid }, + { 0x3432, opcode::OP_LevelEvalFieldVariable }, + { 0x3433, opcode::OP_EvalArray }, + { 0x3434, opcode::OP_GetAnimation }, + { 0x3435, opcode::OP_LessThan }, + { 0x3436, opcode::OP_GreaterThan }, + { 0x3437, opcode::OP_Invalid }, + { 0x3438, opcode::OP_EndSwitch }, + { 0x3439, opcode::OP_SuperNotEqual }, + { 0x343A, opcode::OP_WaitTillMatch }, + { 0x343B, opcode::OP_ShiftRight }, + { 0x343C, opcode::OP_NotEqual }, + { 0x343D, opcode::OP_EvalFieldVariable }, + { 0x343E, opcode::OP_GetVector }, + { 0x343F, opcode::OP_ScriptMethodThreadCall }, + { 0x3440, opcode::OP_JumpOnTrue }, + { 0x3441, opcode::OP_GetString }, + { 0x3442, opcode::OP_Invalid }, + { 0x3443, opcode::OP_Invalid }, + { 0x3444, opcode::OP_LessThan }, + { 0x3445, opcode::OP_Invalid }, + { 0x3446, opcode::OP_GetAnimObject }, + { 0x3447, opcode::OP_EvalFieldVariable }, + { 0x3448, opcode::OP_Invalid }, + { 0x3449, opcode::OP_ScriptFunctionCall }, + { 0x344A, opcode::OP_Invalid }, + { 0x344B, opcode::OP_GetGame }, + { 0x344C, opcode::OP_Invalid }, + { 0x344D, opcode::OP_Invalid }, + { 0x344E, opcode::OP_Invalid }, + { 0x344F, opcode::OP_Jump }, + { 0x3450, opcode::OP_Invalid }, + { 0x3451, opcode::OP_Invalid }, + { 0x3452, opcode::OP_Invalid }, + { 0x3453, opcode::OP_Invalid }, + { 0x3454, opcode::OP_Invalid }, + { 0x3455, opcode::OP_Invalid }, + { 0x3456, opcode::OP_GetIString }, + { 0x3457, opcode::OP_Invalid }, + { 0x3458, opcode::OP_GetAPIFunction }, + { 0x3459, opcode::OP_NotEqual }, + { 0x345A, opcode::OP_ScriptMethodCallPointer }, + { 0x345B, opcode::OP_ScriptMethodCall }, + { 0x345C, opcode::OP_SizeOf }, + { 0x345D, opcode::OP_Invalid }, + { 0x345E, opcode::OP_Dec }, + { 0x345F, opcode::OP_Invalid }, + { 0x3460, opcode::OP_CastFieldObject }, + { 0x3461, opcode::OP_GetByte }, + { 0x3462, opcode::OP_DevblockBegin }, + { 0x3463, opcode::OP_VectorConstant }, + { 0x3464, opcode::OP_Vector }, + { 0x3465, opcode::OP_Invalid }, + { 0x3466, opcode::OP_ShiftLeft }, + { 0x3467, opcode::OP_Invalid }, + { 0x3468, opcode::OP_Invalid }, + { 0x3469, opcode::OP_Invalid }, + { 0x346A, opcode::OP_Invalid }, + { 0x346B, opcode::OP_EvalLocalVariableRefCached }, + { 0x346C, opcode::OP_GetVector }, + { 0x346D, opcode::OP_Invalid }, + { 0x346E, opcode::OP_EvalArrayRef }, + { 0x346F, opcode::OP_GetNegUnsignedShort }, + { 0x3470, opcode::OP_CallBuiltinMethod }, + { 0x3471, opcode::OP_Switch }, + { 0x3472, opcode::OP_Wait }, + { 0x3473, opcode::OP_VectorScale }, + { 0x3474, opcode::OP_Plus }, + { 0x3475, opcode::OP_VectorConstant }, + { 0x3476, opcode::OP_Invalid }, + { 0x3477, opcode::OP_GetAnim }, + { 0x3478, opcode::OP_SuperEqual }, + { 0x3479, opcode::OP_Inc }, + { 0x347A, opcode::OP_GetClassesObject }, + { 0x347B, opcode::OP_GetClasses }, + { 0x347C, opcode::OP_GetUintptr }, + { 0x347D, opcode::OP_BoolNot }, + { 0x347E, opcode::OP_GetWorld }, + { 0x347F, opcode::OP_Invalid }, + { 0x3480, opcode::OP_FirstArrayKey }, + { 0x3481, opcode::OP_GetAPIFunction }, + { 0x3482, opcode::OP_Invalid }, + { 0x3483, opcode::OP_Invalid }, + { 0x3484, opcode::OP_Invalid }, + { 0x3485, opcode::OP_Invalid }, + { 0x3486, opcode::OP_Invalid }, + { 0x3487, opcode::OP_NextArrayKey }, + { 0x3488, opcode::OP_GetByte }, + { 0x3489, opcode::OP_LessThan }, + { 0x348A, opcode::OP_Bit_Xor }, + { 0x348B, opcode::OP_GetTime }, + { 0x348C, opcode::OP_Bit_Or }, + { 0x348D, opcode::OP_SafeDecTop }, + { 0x348E, opcode::OP_Invalid }, + { 0x348F, opcode::OP_EvalFieldVariableRef }, + { 0x3490, opcode::OP_GetByte }, + { 0x3491, opcode::OP_New }, + { 0x3492, opcode::OP_NotEqual }, + { 0x3493, opcode::OP_EndSwitch }, + { 0x3494, opcode::OP_Plus }, + { 0x3495, opcode::OP_SuperNotEqual }, + { 0x3496, opcode::OP_GetSelfObject }, + { 0x3497, opcode::OP_GetTime }, + { 0x3498, opcode::OP_Invalid }, + { 0x3499, opcode::OP_Switch }, + { 0x349A, opcode::OP_ScriptFunctionCallPointer }, + { 0x349B, opcode::OP_ScriptMethodCallPointer }, + { 0x349C, opcode::OP_ScriptThreadCallPointer }, + { 0x349D, opcode::OP_Invalid }, + { 0x349E, opcode::OP_JumpOnFalse }, + { 0x349F, opcode::OP_Invalid }, + { 0x34A0, opcode::OP_GetAPIFunction }, + { 0x34A1, opcode::OP_DecTop }, + { 0x34A2, opcode::OP_GetWorld }, + { 0x34A3, opcode::OP_Invalid }, + { 0x34A4, opcode::OP_SafeDecTop }, + { 0x34A5, opcode::OP_LevelEvalFieldVariable }, + { 0x34A6, opcode::OP_EvalArrayRef }, + { 0x34A7, opcode::OP_Equal }, + { 0x34A8, opcode::OP_NotEqual }, + { 0x34A9, opcode::OP_Invalid }, + { 0x34AA, opcode::OP_ScriptFunctionCallClass }, + { 0x34AB, opcode::OP_GetVector }, + { 0x34AC, opcode::OP_Invalid }, + { 0x34AD, opcode::OP_GetHash }, + { 0x34AE, opcode::OP_GetFunction }, + { 0x34AF, opcode::OP_GetAnim }, + { 0x34B0, opcode::OP_Modulus }, + { 0x34B1, opcode::OP_VectorScale }, + { 0x34B2, opcode::OP_EvalLocalVariableRefCached }, + { 0x34B3, opcode::OP_Invalid }, + { 0x34B4, opcode::OP_EndSwitch }, + { 0x34B5, opcode::OP_LessThan }, + { 0x34B6, opcode::OP_Invalid }, + { 0x34B7, opcode::OP_Invalid }, + { 0x34B8, opcode::OP_SuperEqual }, + { 0x34B9, opcode::OP_Invalid }, + { 0x34BA, opcode::OP_GetZero }, + { 0x34BB, opcode::OP_Invalid }, + { 0x34BC, opcode::OP_GetAnim }, + { 0x34BD, opcode::OP_ProfileStart }, + { 0x34BE, opcode::OP_SizeOf }, + { 0x34BF, opcode::OP_Invalid }, + { 0x34C0, opcode::OP_CallBuiltinMethod }, + { 0x34C1, opcode::OP_ShiftLeft }, + { 0x34C2, opcode::OP_Divide }, + { 0x34C3, opcode::OP_VectorScale }, + { 0x34C4, opcode::OP_Invalid }, + { 0x34C5, opcode::OP_New }, + { 0x34C6, opcode::OP_EvalArray }, + { 0x34C7, opcode::OP_Invalid }, + { 0x34C8, opcode::OP_Invalid }, + { 0x34C9, opcode::OP_Invalid }, + { 0x34CA, opcode::OP_Invalid }, + { 0x34CB, opcode::OP_Invalid }, + { 0x34CC, opcode::OP_Invalid }, + { 0x34CD, opcode::OP_Invalid }, + { 0x34CE, opcode::OP_GetGame }, + { 0x34CF, opcode::OP_Invalid }, + { 0x34D0, opcode::OP_ProfileStart }, + { 0x34D1, opcode::OP_Invalid }, + { 0x34D2, opcode::OP_WaitTill }, + { 0x34D3, opcode::OP_JumpOnTrueExpr }, + { 0x34D4, opcode::OP_Invalid }, + { 0x34D5, opcode::OP_Invalid }, + { 0x34D6, opcode::OP_JumpOnFalseExpr }, + { 0x34D7, opcode::OP_GetUintptr }, + { 0x34D8, opcode::OP_SizeOf }, + { 0x34D9, opcode::OP_SuperEqual }, + { 0x34DA, opcode::OP_GetNegUnsignedShort }, + { 0x34DB, opcode::OP_ScriptThreadCallClass }, + { 0x34DC, opcode::OP_GetGame }, + { 0x34DD, opcode::OP_Invalid }, + { 0x34DE, opcode::OP_Invalid }, + { 0x34DF, opcode::OP_Invalid }, + { 0x34E0, opcode::OP_Invalid }, + { 0x34E1, opcode::OP_Invalid }, + { 0x34E2, opcode::OP_Jump }, + { 0x34E3, opcode::OP_RealWait }, + { 0x34E4, opcode::OP_ScriptThreadCall }, + { 0x34E5, opcode::OP_Invalid }, + { 0x34E6, opcode::OP_Invalid }, + { 0x34E7, opcode::OP_EmptyArray }, + { 0x34E8, opcode::OP_Invalid }, + { 0x34E9, opcode::OP_Invalid }, + { 0x34EA, opcode::OP_GetNegByte }, + { 0x34EB, opcode::OP_GetString }, + { 0x34EC, opcode::OP_ShiftLeft }, + { 0x34ED, opcode::OP_WaitTill }, + { 0x34EE, opcode::OP_GetLevel }, + { 0x34EF, opcode::OP_Invalid }, + { 0x34F0, opcode::OP_Invalid }, + { 0x34F1, opcode::OP_Invalid }, + { 0x34F2, opcode::OP_Invalid }, + { 0x34F3, opcode::OP_GreaterThan }, + { 0x34F4, opcode::OP_Invalid }, + { 0x34F5, opcode::OP_Invalid }, + { 0x34F6, opcode::OP_SelfEvalFieldVariableRef }, + { 0x34F7, opcode::OP_Invalid }, + { 0x34F8, opcode::OP_ClearArray }, + { 0x34F9, opcode::OP_GetNegByte }, + { 0x34FA, opcode::OP_Invalid }, + { 0x34FB, opcode::OP_IsDefined }, + { 0x34FC, opcode::OP_Invalid }, + { 0x34FD, opcode::OP_Equal }, + { 0x34FE, opcode::OP_Invalid }, + { 0x34FF, opcode::OP_ShiftLeft }, + { 0x3500, opcode::OP_Invalid }, + { 0x3501, opcode::OP_GetString }, + { 0x3502, opcode::OP_GetVector }, + { 0x3503, opcode::OP_SuperEqual }, + { 0x3504, opcode::OP_Equal }, + { 0x3505, opcode::OP_BoolComplement }, + { 0x3506, opcode::OP_Invalid }, + { 0x3507, opcode::OP_Invalid }, + { 0x3508, opcode::OP_EvalArrayRef }, + { 0x3509, opcode::OP_Invalid }, + { 0x350A, opcode::OP_GetGame }, + { 0x350B, opcode::OP_Invalid }, + { 0x350C, opcode::OP_Switch }, + { 0x350D, opcode::OP_GetAnimObject }, + { 0x350E, opcode::OP_Invalid }, + { 0x350F, opcode::OP_Invalid }, + { 0x3510, opcode::OP_SelfEvalFieldVariable }, + { 0x3511, opcode::OP_GetGameRef }, + { 0x3512, opcode::OP_ShiftLeft }, + { 0x3513, opcode::OP_SuperEqual }, + { 0x3514, opcode::OP_DevblockBegin }, + { 0x3515, opcode::OP_LessThan }, + { 0x3516, opcode::OP_DecTop }, + { 0x3517, opcode::OP_Invalid }, + { 0x3518, opcode::OP_Bit_And }, + { 0x3519, opcode::OP_SizeOf }, + { 0x351A, opcode::OP_NotEqual }, + { 0x351B, opcode::OP_DevblockBegin }, + { 0x351C, opcode::OP_Wait }, + { 0x351D, opcode::OP_Plus }, + { 0x351E, opcode::OP_Invalid }, + { 0x351F, opcode::OP_SafeSetVariableFieldCached }, + { 0x3520, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x3521, opcode::OP_GetGame }, + { 0x3522, opcode::OP_GetFloat }, + { 0x3523, opcode::OP_WaitTill }, + { 0x3524, opcode::OP_Invalid }, + { 0x3525, opcode::OP_Invalid }, + { 0x3526, opcode::OP_ScriptMethodThreadCall }, + { 0x3527, opcode::OP_GetByte }, + { 0x3528, opcode::OP_Divide }, + { 0x3529, opcode::OP_Switch }, + { 0x352A, opcode::OP_Invalid }, + { 0x352B, opcode::OP_Bit_Xor }, + { 0x352C, opcode::OP_Invalid }, + { 0x352D, opcode::OP_EndSwitch }, + { 0x352E, opcode::OP_LessThanOrEqualTo }, + { 0x352F, opcode::OP_GetUintptr }, + { 0x3530, opcode::OP_Invalid }, + { 0x3531, opcode::OP_Bit_Or }, + { 0x3532, opcode::OP_JumpOnTrueExpr }, + { 0x3533, opcode::OP_Invalid }, + { 0x3534, opcode::OP_New }, + { 0x3535, opcode::OP_SelfEvalFieldVariableRef }, + { 0x3536, opcode::OP_Bit_And }, + { 0x3537, opcode::OP_Invalid }, + { 0x3538, opcode::OP_Invalid }, + { 0x3539, opcode::OP_Invalid }, + { 0x353A, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x353B, opcode::OP_Jump }, + { 0x353C, opcode::OP_GetTime }, + { 0x353D, opcode::OP_Notify }, + { 0x353E, opcode::OP_GetWorldObject }, + { 0x353F, opcode::OP_Invalid }, + { 0x3540, opcode::OP_Inc }, + { 0x3541, opcode::OP_Invalid }, + { 0x3542, opcode::OP_EvalFieldVariable }, + { 0x3543, opcode::OP_WaitTillMatch }, + { 0x3544, opcode::OP_Invalid }, + { 0x3545, opcode::OP_Inc }, + { 0x3546, opcode::OP_Invalid }, + { 0x3547, opcode::OP_SelfEvalFieldVariable }, + { 0x3548, opcode::OP_JumpOnTrueExpr }, + { 0x3549, opcode::OP_Invalid }, + { 0x354A, opcode::OP_SizeOf }, + { 0x354B, opcode::OP_ScriptFunctionCallPointer }, + { 0x354C, opcode::OP_Invalid }, + { 0x354D, opcode::OP_Invalid }, + { 0x354E, opcode::OP_EvalFieldVariableRef }, + { 0x354F, opcode::OP_LevelEvalFieldVariable }, + { 0x3550, opcode::OP_EvalArray }, + { 0x3551, opcode::OP_EvalArrayRef }, + { 0x3552, opcode::OP_JumpOnTrue }, + { 0x3553, opcode::OP_SizeOf }, + { 0x3554, opcode::OP_SafeSetVariableFieldCached }, + { 0x3555, opcode::OP_Invalid }, + { 0x3556, opcode::OP_Invalid }, + { 0x3557, opcode::OP_Invalid }, + { 0x3558, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x3559, opcode::OP_GetUintptr }, + { 0x355A, opcode::OP_Invalid }, + { 0x355B, opcode::OP_Invalid }, + { 0x355C, opcode::OP_Invalid }, + { 0x355D, opcode::OP_Invalid }, + { 0x355E, opcode::OP_SelfEvalFieldVariable }, + { 0x355F, opcode::OP_Invalid }, + { 0x3560, opcode::OP_GetUnsignedShort }, + { 0x3561, opcode::OP_Invalid }, + { 0x3562, opcode::OP_ShiftLeft }, + { 0x3563, opcode::OP_LessThanOrEqualTo }, + { 0x3564, opcode::OP_Invalid }, + { 0x3565, opcode::OP_Invalid }, + { 0x3566, opcode::OP_SafeSetVariableFieldCached }, + { 0x3567, opcode::OP_Invalid }, + { 0x3568, opcode::OP_GetUintptr }, + { 0x3569, opcode::OP_GetHash }, + { 0x356A, opcode::OP_ScriptThreadCall }, + { 0x356B, opcode::OP_Invalid }, + { 0x356C, opcode::OP_GetLevel }, + { 0x356D, opcode::OP_DevblockBegin }, + { 0x356E, opcode::OP_EvalArray }, + { 0x356F, opcode::OP_Wait }, + { 0x3570, opcode::OP_Invalid }, + { 0x3571, opcode::OP_Invalid }, + { 0x3572, opcode::OP_GetSelfObject }, + { 0x3573, opcode::OP_Multiply }, + { 0x3574, opcode::OP_SafeDecTop }, + { 0x3575, opcode::OP_Invalid }, + { 0x3576, opcode::OP_ShiftLeft }, + { 0x3577, opcode::OP_GetGameRef }, + { 0x3578, opcode::OP_Invalid }, + { 0x3579, opcode::OP_ScriptThreadCallClass }, + { 0x357A, opcode::OP_EndSwitch }, + { 0x357B, opcode::OP_Invalid }, + { 0x357C, opcode::OP_ScriptThreadCallPointer }, + { 0x357D, opcode::OP_CallBuiltinMethod }, + { 0x357E, opcode::OP_Invalid }, + { 0x357F, opcode::OP_EvalFieldVariable }, + { 0x3580, opcode::OP_EvalLocalVariableRefCached }, + { 0x3581, opcode::OP_EvalFieldVariableRef }, + { 0x3582, opcode::OP_Invalid }, + { 0x3583, opcode::OP_SetVariableField }, + { 0x3584, opcode::OP_Invalid }, + { 0x3585, opcode::OP_LevelEvalFieldVariable }, + { 0x3586, opcode::OP_GetIString }, + { 0x3587, opcode::OP_GreaterThan }, + { 0x3588, opcode::OP_Invalid }, + { 0x3589, opcode::OP_Invalid }, + { 0x358A, opcode::OP_Invalid }, + { 0x358B, opcode::OP_ShiftLeft }, + { 0x358C, opcode::OP_NotEqual }, + { 0x358D, opcode::OP_SuperEqual }, + { 0x358E, opcode::OP_Invalid }, + { 0x358F, opcode::OP_ShiftLeft }, + { 0x3590, opcode::OP_BoolComplement }, + { 0x3591, opcode::OP_ScriptMethodThreadCall }, + { 0x3592, opcode::OP_Invalid }, + { 0x3593, opcode::OP_SelfEvalFieldVariableRef }, + { 0x3594, opcode::OP_GetAPIFunction }, + { 0x3595, opcode::OP_GetWorld }, + { 0x3596, opcode::OP_Jump }, + { 0x3597, opcode::OP_Invalid }, + { 0x3598, opcode::OP_Invalid }, + { 0x3599, opcode::OP_Invalid }, + { 0x359A, opcode::OP_SafeDecTop }, + { 0x359B, opcode::OP_GetNegUnsignedShort }, + { 0x359C, opcode::OP_VectorScale }, + { 0x359D, opcode::OP_Invalid }, + { 0x359E, opcode::OP_GetWorldObject }, + { 0x359F, opcode::OP_EvalLocalVariableCached }, + { 0x35A0, opcode::OP_Invalid }, + { 0x35A1, opcode::OP_Inc }, + { 0x35A2, opcode::OP_ClearArray }, + { 0x35A3, opcode::OP_Modulus }, + { 0x35A4, opcode::OP_Bit_Or }, + { 0x35A5, opcode::OP_GreaterThan }, + { 0x35A6, opcode::OP_Modulus }, + { 0x35A7, opcode::OP_Invalid }, + { 0x35A8, opcode::OP_GetUintptr }, + { 0x35A9, opcode::OP_GetInteger }, + { 0x35AA, opcode::OP_CastBool }, + { 0x35AB, opcode::OP_ScriptMethodCallPointer }, + { 0x35AC, opcode::OP_ScriptMethodThreadCall }, + { 0x35AD, opcode::OP_GetInteger }, + { 0x35AE, opcode::OP_Invalid }, + { 0x35AF, opcode::OP_RealWait }, + { 0x35B0, opcode::OP_Invalid }, + { 0x35B1, opcode::OP_JumpOnFalseExpr }, + { 0x35B2, opcode::OP_ShiftLeft }, + { 0x35B3, opcode::OP_RealWait }, + { 0x35B4, opcode::OP_Divide }, + { 0x35B5, opcode::OP_Invalid }, + { 0x35B6, opcode::OP_New }, + { 0x35B7, opcode::OP_GetFunction }, + { 0x35B8, opcode::OP_Invalid }, + { 0x35B9, opcode::OP_GetAnim }, + { 0x35BA, opcode::OP_Invalid }, + { 0x35BB, opcode::OP_GetWorldObject }, + { 0x35BC, opcode::OP_Invalid }, + { 0x35BD, opcode::OP_ScriptFunctionCallClass }, + { 0x35BE, opcode::OP_GreaterThanOrEqualTo }, + { 0x35BF, opcode::OP_EvalArrayRef }, + { 0x35C0, opcode::OP_Invalid }, + { 0x35C1, opcode::OP_Minus }, + { 0x35C2, opcode::OP_GetAnimation }, + { 0x35C3, opcode::OP_GetUintptr }, + { 0x35C4, opcode::OP_Invalid }, + { 0x35C5, opcode::OP_CastBool }, + { 0x35C6, opcode::OP_ClearFieldVariable }, + { 0x35C7, opcode::OP_Invalid }, + { 0x35C8, opcode::OP_GetWorld }, + { 0x35C9, opcode::OP_GetFloat }, + { 0x35CA, opcode::OP_Invalid }, + { 0x35CB, opcode::OP_GetNegByte }, + { 0x35CC, opcode::OP_NextArrayKey }, + { 0x35CD, opcode::OP_SelfEvalFieldVariable }, + { 0x35CE, opcode::OP_Invalid }, + { 0x35CF, opcode::OP_RealWait }, + { 0x35D0, opcode::OP_Invalid }, + { 0x35D1, opcode::OP_Invalid }, + { 0x35D2, opcode::OP_RealWait }, + { 0x35D3, opcode::OP_LessThanOrEqualTo }, + { 0x35D4, opcode::OP_Invalid }, + { 0x35D5, opcode::OP_Invalid }, + { 0x35D6, opcode::OP_Invalid }, + { 0x35D7, opcode::OP_Invalid }, + { 0x35D8, opcode::OP_Multiply }, + { 0x35D9, opcode::OP_Invalid }, + { 0x35DA, opcode::OP_GetUnsignedShort }, + { 0x35DB, opcode::OP_SizeOf }, + { 0x35DC, opcode::OP_SelfEvalFieldVariable }, + { 0x35DD, opcode::OP_CallBuiltinMethod }, + { 0x35DE, opcode::OP_GetVector }, + { 0x35DF, opcode::OP_Invalid }, + { 0x35E0, opcode::OP_JumpOnFalseExpr }, + { 0x35E1, opcode::OP_GetAnimObject }, + { 0x35E2, opcode::OP_Invalid }, + { 0x35E3, opcode::OP_VectorConstant }, + { 0x35E4, opcode::OP_GetLevel }, + { 0x35E5, opcode::OP_Invalid }, + { 0x35E6, opcode::OP_Invalid }, + { 0x35E7, opcode::OP_NextArrayKey }, + { 0x35E8, opcode::OP_Invalid }, + { 0x35E9, opcode::OP_SizeOf }, + { 0x35EA, opcode::OP_JumpOnFalseExpr }, + { 0x35EB, opcode::OP_Invalid }, + { 0x35EC, opcode::OP_Invalid }, + { 0x35ED, opcode::OP_GetGameRef }, + { 0x35EE, opcode::OP_Invalid }, + { 0x35EF, opcode::OP_SuperNotEqual }, + { 0x35F0, opcode::OP_ShiftLeft }, + { 0x35F1, opcode::OP_Multiply }, + { 0x35F2, opcode::OP_Invalid }, + { 0x35F3, opcode::OP_NextArrayKey }, + { 0x35F4, opcode::OP_WaitTill }, + { 0x35F5, opcode::OP_NextArrayKey }, + { 0x35F6, opcode::OP_DevblockBegin }, + { 0x35F7, opcode::OP_ScriptFunctionCallClass }, + { 0x35F8, opcode::OP_GetIString }, + { 0x35F9, opcode::OP_ScriptMethodThreadCall }, + { 0x35FA, opcode::OP_GetTime }, + { 0x35FB, opcode::OP_SuperNotEqual }, + { 0x35FC, opcode::OP_Invalid }, + { 0x35FD, opcode::OP_GetFunction }, + { 0x35FE, opcode::OP_WaitTillFrameEnd }, + { 0x35FF, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x3600, opcode::OP_ScriptMethodThreadCall }, + { 0x3601, opcode::OP_Invalid }, + { 0x3602, opcode::OP_Invalid }, + { 0x3603, opcode::OP_Invalid }, + { 0x3604, opcode::OP_ShiftRight }, + { 0x3605, opcode::OP_JumpOnTrue }, + { 0x3606, opcode::OP_GetSelf }, + { 0x3607, opcode::OP_Invalid }, + { 0x3608, opcode::OP_Invalid }, + { 0x3609, opcode::OP_ScriptThreadCallClass }, + { 0x360A, opcode::OP_ScriptMethodCall }, + { 0x360B, opcode::OP_Invalid }, + { 0x360C, opcode::OP_SafeDecTop }, + { 0x360D, opcode::OP_GetFunction }, + { 0x360E, opcode::OP_SafeDecTop }, + { 0x360F, opcode::OP_GetClasses }, + { 0x3610, opcode::OP_GetString }, + { 0x3611, opcode::OP_Invalid }, + { 0x3612, opcode::OP_SizeOf }, + { 0x3613, opcode::OP_Switch }, + { 0x3614, opcode::OP_ScriptThreadCallClass }, + { 0x3615, opcode::OP_Bit_And }, + { 0x3616, opcode::OP_NextArrayKey }, + { 0x3617, opcode::OP_GetUintptr }, + { 0x3618, opcode::OP_ShiftLeft }, + { 0x3619, opcode::OP_Invalid }, + { 0x361A, opcode::OP_Invalid }, + { 0x361B, opcode::OP_Multiply }, + { 0x361C, opcode::OP_Invalid }, + { 0x361D, opcode::OP_GetGame }, + { 0x361E, opcode::OP_LessThan }, + { 0x361F, opcode::OP_ClearArray }, + { 0x3620, opcode::OP_WaitTillFrameEnd }, + { 0x3621, opcode::OP_GetString }, + { 0x3622, opcode::OP_Invalid }, + { 0x3623, opcode::OP_Invalid }, + { 0x3624, opcode::OP_GetUndefined }, + { 0x3625, opcode::OP_WaitTillMatch }, + { 0x3626, opcode::OP_ScriptFunctionCall }, + { 0x3627, opcode::OP_WaitTill }, + { 0x3628, opcode::OP_EvalFieldVariable }, + { 0x3629, opcode::OP_Invalid }, + { 0x362A, opcode::OP_Invalid }, + { 0x362B, opcode::OP_ScriptFunctionCallClass }, + { 0x362C, opcode::OP_CallBuiltinMethod }, + { 0x362D, opcode::OP_SafeSetVariableFieldCached }, + { 0x362E, opcode::OP_Invalid }, + { 0x362F, opcode::OP_GetGameRef }, + { 0x3630, opcode::OP_Minus }, + { 0x3631, opcode::OP_GetNegByte }, + { 0x3632, opcode::OP_ScriptFunctionCall }, + { 0x3633, opcode::OP_LessThanOrEqualTo }, + { 0x3634, opcode::OP_Invalid }, + { 0x3635, opcode::OP_ProfileStart }, + { 0x3636, opcode::OP_Multiply }, + { 0x3637, opcode::OP_GetHash }, + { 0x3638, opcode::OP_Invalid }, + { 0x3639, opcode::OP_ClearFieldVariable }, + { 0x363A, opcode::OP_Invalid }, + { 0x363B, opcode::OP_Invalid }, + { 0x363C, opcode::OP_Invalid }, + { 0x363D, opcode::OP_GetZero }, + { 0x363E, opcode::OP_Wait }, + { 0x363F, opcode::OP_GetUintptr }, + { 0x3640, opcode::OP_Invalid }, + { 0x3641, opcode::OP_ProfileStart }, + { 0x3642, opcode::OP_Invalid }, + { 0x3643, opcode::OP_GetLevelObject }, + { 0x3644, opcode::OP_SelfEvalFieldVariable }, + { 0x3645, opcode::OP_EvalArray }, + { 0x3646, opcode::OP_Invalid }, + { 0x3647, opcode::OP_Multiply }, + { 0x3648, opcode::OP_EvalFieldVariableRef }, + { 0x3649, opcode::OP_WaitTill }, + { 0x364A, opcode::OP_SuperNotEqual }, + { 0x364B, opcode::OP_Invalid }, + { 0x364C, opcode::OP_RealWait }, + { 0x364D, opcode::OP_Invalid }, + { 0x364E, opcode::OP_Invalid }, + { 0x364F, opcode::OP_GetAnim }, + { 0x3650, opcode::OP_WaitTillMatch }, + { 0x3651, opcode::OP_GetIString }, + { 0x3652, opcode::OP_Switch }, + { 0x3653, opcode::OP_Multiply }, + { 0x3654, opcode::OP_Invalid }, + { 0x3655, opcode::OP_Invalid }, + { 0x3656, opcode::OP_GetClasses }, + { 0x3657, opcode::OP_Invalid }, + { 0x3658, opcode::OP_EndSwitch }, + { 0x3659, opcode::OP_GetSelfObject }, + { 0x365A, opcode::OP_Invalid }, + { 0x365B, opcode::OP_ScriptFunctionCallClass }, + { 0x365C, opcode::OP_EmptyArray }, + { 0x365D, opcode::OP_SafeDecTop }, + { 0x365E, opcode::OP_SelfEvalFieldVariable }, + { 0x365F, opcode::OP_Plus }, + { 0x3660, opcode::OP_Invalid }, + { 0x3661, opcode::OP_Invalid }, + { 0x3662, opcode::OP_WaitTillFrameEnd }, + { 0x3663, opcode::OP_Invalid }, + { 0x3664, opcode::OP_SelfEvalFieldVariable }, + { 0x3665, opcode::OP_GetAnimObject }, + { 0x3666, opcode::OP_Invalid }, + { 0x3667, opcode::OP_GetFunction }, + { 0x3668, opcode::OP_BoolNot }, + { 0x3669, opcode::OP_GetAnimObject }, + { 0x366A, opcode::OP_GetAnimObject }, + { 0x366B, opcode::OP_ScriptMethodCall }, + { 0x366C, opcode::OP_Invalid }, + { 0x366D, opcode::OP_Invalid }, + { 0x366E, opcode::OP_GetIString }, + { 0x366F, opcode::OP_SafeCreateLocalVariables }, + { 0x3670, opcode::OP_Switch }, + { 0x3671, opcode::OP_GreaterThan }, + { 0x3672, opcode::OP_BoolComplement }, + { 0x3673, opcode::OP_SafeDecTop }, + { 0x3674, opcode::OP_EvalArray }, + { 0x3675, opcode::OP_GetSelfObject }, + { 0x3676, opcode::OP_Invalid }, + { 0x3677, opcode::OP_Invalid }, + { 0x3678, opcode::OP_Invalid }, + { 0x3679, opcode::OP_GetString }, + { 0x367A, opcode::OP_WaitTill }, + { 0x367B, opcode::OP_SizeOf }, + { 0x367C, opcode::OP_SuperEqual }, + { 0x367D, opcode::OP_LevelEvalFieldVariable }, + { 0x367E, opcode::OP_NotEqual }, + { 0x367F, opcode::OP_Bit_And }, + { 0x3680, opcode::OP_ClearFieldVariable }, + { 0x3681, opcode::OP_ScriptFunctionCallClass }, + { 0x3682, opcode::OP_LevelEvalFieldVariable }, + { 0x3683, opcode::OP_CallBuiltinMethod }, + { 0x3684, opcode::OP_Invalid }, + { 0x3685, opcode::OP_GetFloat }, + { 0x3686, opcode::OP_GetWorld }, + { 0x3687, opcode::OP_Invalid }, + { 0x3688, opcode::OP_Invalid }, + { 0x3689, opcode::OP_Invalid }, + { 0x368A, opcode::OP_GetGameRef }, + { 0x368B, opcode::OP_EvalFieldVariableRef }, + { 0x368C, opcode::OP_SafeCreateLocalVariables }, + { 0x368D, opcode::OP_Invalid }, + { 0x368E, opcode::OP_Invalid }, + { 0x368F, opcode::OP_EndSwitch }, + { 0x3690, opcode::OP_Invalid }, + { 0x3691, opcode::OP_Invalid }, + { 0x3692, opcode::OP_Invalid }, + { 0x3693, opcode::OP_LessThan }, + { 0x3694, opcode::OP_Dec }, + { 0x3695, opcode::OP_Invalid }, + { 0x3696, opcode::OP_EvalFieldVariable }, + { 0x3697, opcode::OP_GetTime }, + { 0x3698, opcode::OP_Invalid }, + { 0x3699, opcode::OP_Invalid }, + { 0x369A, opcode::OP_WaitTill }, + { 0x369B, opcode::OP_Invalid }, + { 0x369C, opcode::OP_Invalid }, + { 0x369D, opcode::OP_VectorScale }, + { 0x369E, opcode::OP_Invalid }, + { 0x369F, opcode::OP_JumpOnTrueExpr }, + { 0x36A0, opcode::OP_GetAnim }, + { 0x36A1, opcode::OP_Invalid }, + { 0x36A2, opcode::OP_Invalid }, + { 0x36A3, opcode::OP_Invalid }, + { 0x36A4, opcode::OP_GetHash }, + { 0x36A5, opcode::OP_EvalLocalVariableCached }, + { 0x36A6, opcode::OP_Divide }, + { 0x36A7, opcode::OP_EvalLocalVariableRefCached }, + { 0x36A8, opcode::OP_GetHash }, + { 0x36A9, opcode::OP_GetLevel }, + { 0x36AA, opcode::OP_GetInteger }, + { 0x36AB, opcode::OP_BoolComplement }, + { 0x36AC, opcode::OP_JumpOnFalseExpr }, + { 0x36AD, opcode::OP_Invalid }, + { 0x36AE, opcode::OP_EvalLocalVariableCached }, + { 0x36AF, opcode::OP_Notify }, + { 0x36B0, opcode::OP_LessThanOrEqualTo }, + { 0x36B1, opcode::OP_Invalid }, + { 0x36B2, opcode::OP_Return }, + { 0x36B3, opcode::OP_Minus }, + { 0x36B4, opcode::OP_Jump }, + { 0x36B5, opcode::OP_Invalid }, + { 0x36B6, opcode::OP_Invalid }, + { 0x36B7, opcode::OP_Invalid }, + { 0x36B8, opcode::OP_Invalid }, + { 0x36B9, opcode::OP_Invalid }, + { 0x36BA, opcode::OP_ScriptMethodCall }, + { 0x36BB, opcode::OP_DevblockBegin }, + { 0x36BC, opcode::OP_GetVector }, + { 0x36BD, opcode::OP_Jump }, + { 0x36BE, opcode::OP_Invalid }, + { 0x36BF, opcode::OP_JumpOnFalseExpr }, + { 0x36C0, opcode::OP_Notify }, + { 0x36C1, opcode::OP_Multiply }, + { 0x36C2, opcode::OP_Invalid }, + { 0x36C3, opcode::OP_Invalid }, + { 0x36C4, opcode::OP_JumpOnTrueExpr }, + { 0x36C5, opcode::OP_Invalid }, + { 0x36C6, opcode::OP_Invalid }, + { 0x36C7, opcode::OP_RealWait }, + { 0x36C8, opcode::OP_GetAnimObject }, + { 0x36C9, opcode::OP_Invalid }, + { 0x36CA, opcode::OP_Invalid }, + { 0x36CB, opcode::OP_GetAnim }, + { 0x36CC, opcode::OP_Invalid }, + { 0x36CD, opcode::OP_Modulus }, + { 0x36CE, opcode::OP_Invalid }, + { 0x36CF, opcode::OP_Invalid }, + { 0x36D0, opcode::OP_GetInteger }, + { 0x36D1, opcode::OP_Invalid }, + { 0x36D2, opcode::OP_LessThanOrEqualTo }, + { 0x36D3, opcode::OP_GetZero }, + { 0x36D4, opcode::OP_LevelEvalFieldVariableRef }, + { 0x36D5, opcode::OP_Invalid }, + { 0x36D6, opcode::OP_Plus }, + { 0x36D7, opcode::OP_GetFloat }, + { 0x36D8, opcode::OP_SafeSetVariableFieldCached }, + { 0x36D9, opcode::OP_Invalid }, + { 0x36DA, opcode::OP_Invalid }, + { 0x36DB, opcode::OP_GetClassesObject }, + { 0x36DC, opcode::OP_VectorConstant }, + { 0x36DD, opcode::OP_SuperNotEqual }, + { 0x36DE, opcode::OP_GetUintptr }, + { 0x36DF, opcode::OP_GetUintptr }, + { 0x36E0, opcode::OP_Invalid }, + { 0x36E1, opcode::OP_GetWorld }, + { 0x36E2, opcode::OP_EmptyArray }, + { 0x36E3, opcode::OP_RealWait }, + { 0x36E4, opcode::OP_GetZero }, + { 0x36E5, opcode::OP_Invalid }, + { 0x36E6, opcode::OP_ScriptMethodCallPointer }, + { 0x36E7, opcode::OP_ClearFieldVariable }, + { 0x36E8, opcode::OP_ScriptFunctionCall }, + { 0x36E9, opcode::OP_Divide }, + { 0x36EA, opcode::OP_Invalid }, + { 0x36EB, opcode::OP_Invalid }, + { 0x36EC, opcode::OP_ShiftLeft }, + { 0x36ED, opcode::OP_LevelEvalFieldVariable }, + { 0x36EE, opcode::OP_GetHash }, + { 0x36EF, opcode::OP_GetUndefined }, + { 0x36F0, opcode::OP_Invalid }, + { 0x36F1, opcode::OP_Invalid }, + { 0x36F2, opcode::OP_Invalid }, + { 0x36F3, opcode::OP_Inc }, + { 0x36F4, opcode::OP_GetSelf }, + { 0x36F5, opcode::OP_EvalArrayRef }, + { 0x36F6, opcode::OP_WaitTillFrameEnd }, + { 0x36F7, opcode::OP_Invalid }, + { 0x36F8, opcode::OP_Minus }, + { 0x36F9, opcode::OP_FirstArrayKey }, + { 0x36FA, opcode::OP_GreaterThan }, + { 0x36FB, opcode::OP_Invalid }, + { 0x36FC, opcode::OP_IsDefined }, + { 0x36FD, opcode::OP_GetUnsignedShort }, + { 0x36FE, opcode::OP_NotEqual }, + { 0x36FF, opcode::OP_GetAnimObject }, + { 0x3700, opcode::OP_Invalid }, + { 0x3701, opcode::OP_Invalid }, + { 0x3702, opcode::OP_EmptyArray }, + { 0x3703, opcode::OP_JumpOnFalseExpr }, + { 0x3704, opcode::OP_Switch }, + { 0x3705, opcode::OP_Invalid }, + { 0x3706, opcode::OP_Invalid }, + { 0x3707, opcode::OP_EndSwitch }, + { 0x3708, opcode::OP_VectorConstant }, + { 0x3709, opcode::OP_SizeOf }, + { 0x370A, opcode::OP_Invalid }, + { 0x370B, opcode::OP_LessThanOrEqualTo }, + { 0x370C, opcode::OP_NotEqual }, + { 0x370D, opcode::OP_ShiftRight }, + { 0x370E, opcode::OP_ScriptMethodCall }, + { 0x370F, opcode::OP_GreaterThanOrEqualTo }, + { 0x3710, opcode::OP_Bit_And }, + { 0x3711, opcode::OP_GetUndefined }, + { 0x3712, opcode::OP_WaitTillMatch }, + { 0x3713, opcode::OP_Return }, + { 0x3714, opcode::OP_Invalid }, + { 0x3715, opcode::OP_Invalid }, + { 0x3716, opcode::OP_Invalid }, + { 0x3717, opcode::OP_WaitTill }, + { 0x3718, opcode::OP_WaitTillMatch }, + { 0x3719, opcode::OP_Invalid }, + { 0x371A, opcode::OP_Invalid }, + { 0x371B, opcode::OP_ScriptMethodThreadCall }, + { 0x371C, opcode::OP_GetFloat }, + { 0x371D, opcode::OP_GetHash }, + { 0x371E, opcode::OP_Return }, + { 0x371F, opcode::OP_Invalid }, + { 0x3720, opcode::OP_GetFunction }, + { 0x3721, opcode::OP_Invalid }, + { 0x3722, opcode::OP_Invalid }, + { 0x3723, opcode::OP_GetWorld }, + { 0x3724, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x3725, opcode::OP_BoolNot }, + { 0x3726, opcode::OP_GetUintptr }, + { 0x3727, opcode::OP_Return }, + { 0x3728, opcode::OP_GetVector }, + { 0x3729, opcode::OP_ScriptFunctionCall }, + { 0x372A, opcode::OP_Invalid }, + { 0x372B, opcode::OP_Invalid }, + { 0x372C, opcode::OP_GetUintptr }, + { 0x372D, opcode::OP_Invalid }, + { 0x372E, opcode::OP_Invalid }, + { 0x372F, opcode::OP_Invalid }, + { 0x3730, opcode::OP_GreaterThan }, + { 0x3731, opcode::OP_GetGameRef }, + { 0x3732, opcode::OP_Invalid }, + { 0x3733, opcode::OP_Invalid }, + { 0x3734, opcode::OP_Invalid }, + { 0x3735, opcode::OP_Invalid }, + { 0x3736, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x3737, opcode::OP_Invalid }, + { 0x3738, opcode::OP_Invalid }, + { 0x3739, opcode::OP_Invalid }, + { 0x373A, opcode::OP_Invalid }, + { 0x373B, opcode::OP_WaitTill }, + { 0x373C, opcode::OP_Bit_Or }, + { 0x373D, opcode::OP_RealWait }, + { 0x373E, opcode::OP_Invalid }, + { 0x373F, opcode::OP_Invalid }, + { 0x3740, opcode::OP_GetZero }, + { 0x3741, opcode::OP_Invalid }, + { 0x3742, opcode::OP_SafeCreateLocalVariables }, + { 0x3743, opcode::OP_Bit_Xor }, + { 0x3744, opcode::OP_JumpOnTrueExpr }, + { 0x3745, opcode::OP_GetClassesObject }, + { 0x3746, opcode::OP_Invalid }, + { 0x3747, opcode::OP_ProfileStop }, + { 0x3748, opcode::OP_Notify }, + { 0x3749, opcode::OP_GetGame }, + { 0x374A, opcode::OP_Equal }, + { 0x374B, opcode::OP_Invalid }, + { 0x374C, opcode::OP_GetUnsignedShort }, + { 0x374D, opcode::OP_WaitTillFrameEnd }, + { 0x374E, opcode::OP_Invalid }, + { 0x374F, opcode::OP_Invalid }, + { 0x3750, opcode::OP_BoolNot }, + { 0x3751, opcode::OP_Invalid }, + { 0x3752, opcode::OP_Invalid }, + { 0x3753, opcode::OP_Invalid }, + { 0x3754, opcode::OP_Minus }, + { 0x3755, opcode::OP_Invalid }, + { 0x3756, opcode::OP_Invalid }, + { 0x3757, opcode::OP_GreaterThanOrEqualTo }, + { 0x3758, opcode::OP_Invalid }, + { 0x3759, opcode::OP_Invalid }, + { 0x375A, opcode::OP_GetLevelObject }, + { 0x375B, opcode::OP_Vector }, + { 0x375C, opcode::OP_Bit_And }, + { 0x375D, opcode::OP_GetHash }, + { 0x375E, opcode::OP_Invalid }, + { 0x375F, opcode::OP_Dec }, + { 0x3760, opcode::OP_Invalid }, + { 0x3761, opcode::OP_Invalid }, + { 0x3762, opcode::OP_Invalid }, + { 0x3763, opcode::OP_LessThanOrEqualTo }, + { 0x3764, opcode::OP_Inc }, + { 0x3765, opcode::OP_Invalid }, + { 0x3766, opcode::OP_Bit_And }, + { 0x3767, opcode::OP_CastBool }, + { 0x3768, opcode::OP_Invalid }, + { 0x3769, opcode::OP_Invalid }, + { 0x376A, opcode::OP_Inc }, + { 0x376B, opcode::OP_Invalid }, + { 0x376C, opcode::OP_GetAnimObject }, + { 0x376D, opcode::OP_GetWorldObject }, + { 0x376E, opcode::OP_Invalid }, + { 0x376F, opcode::OP_Invalid }, + { 0x3770, opcode::OP_ClearArray }, + { 0x3771, opcode::OP_Invalid }, + { 0x3772, opcode::OP_Invalid }, + { 0x3773, opcode::OP_ScriptMethodCall }, + { 0x3774, opcode::OP_Invalid }, + { 0x3775, opcode::OP_Invalid }, + { 0x3776, opcode::OP_Bit_And }, + { 0x3777, opcode::OP_Invalid }, + { 0x3778, opcode::OP_Invalid }, + { 0x3779, opcode::OP_Invalid }, + { 0x377A, opcode::OP_VectorScale }, + { 0x377B, opcode::OP_Invalid }, + { 0x377C, opcode::OP_Invalid }, + { 0x377D, opcode::OP_Invalid }, + { 0x377E, opcode::OP_ClearArray }, + { 0x377F, opcode::OP_GetAnimation }, + { 0x3780, opcode::OP_GetIString }, + { 0x3781, opcode::OP_Invalid }, + { 0x3782, opcode::OP_Invalid }, + { 0x3783, opcode::OP_GetFloat }, + { 0x3784, opcode::OP_EvalFieldVariable }, + { 0x3785, opcode::OP_WaitTillMatch }, + { 0x3786, opcode::OP_Invalid }, + { 0x3787, opcode::OP_GetSelfObject }, + { 0x3788, opcode::OP_GetSelf }, + { 0x3789, opcode::OP_Invalid }, + { 0x378A, opcode::OP_SuperEqual }, + { 0x378B, opcode::OP_GetUndefined }, + { 0x378C, opcode::OP_Invalid }, + { 0x378D, opcode::OP_GetGameRef }, + { 0x378E, opcode::OP_Invalid }, + { 0x378F, opcode::OP_Invalid }, + { 0x3790, opcode::OP_Invalid }, + { 0x3791, opcode::OP_GetGame }, + { 0x3792, opcode::OP_ScriptFunctionCallPointer }, + { 0x3793, opcode::OP_Invalid }, + { 0x3794, opcode::OP_NextArrayKey }, + { 0x3795, opcode::OP_EvalArrayRef }, + { 0x3796, opcode::OP_Invalid }, + { 0x3797, opcode::OP_Invalid }, + { 0x3798, opcode::OP_Invalid }, + { 0x3799, opcode::OP_LessThan }, + { 0x379A, opcode::OP_WaitTillMatch }, + { 0x379B, opcode::OP_Invalid }, + { 0x379C, opcode::OP_LevelEvalFieldVariableRef }, + { 0x379D, opcode::OP_SuperNotEqual }, + { 0x379E, opcode::OP_GetUnsignedShort }, + { 0x379F, opcode::OP_Invalid }, + { 0x37A0, opcode::OP_Invalid }, + { 0x37A1, opcode::OP_ScriptFunctionCallPointer }, + { 0x37A2, opcode::OP_Invalid }, + { 0x37A3, opcode::OP_LevelEvalFieldVariableRef }, + { 0x37A4, opcode::OP_RealWait }, + { 0x37A5, opcode::OP_ScriptFunctionCallClass }, + { 0x37A6, opcode::OP_EvalFieldVariable }, + { 0x37A7, opcode::OP_Wait }, + { 0x37A8, opcode::OP_Invalid }, + { 0x37A9, opcode::OP_Invalid }, + { 0x37AA, opcode::OP_Return }, + { 0x37AB, opcode::OP_ScriptFunctionCallClass }, + { 0x37AC, opcode::OP_GetUndefined }, + { 0x37AD, opcode::OP_Invalid }, + { 0x37AE, opcode::OP_Invalid }, + { 0x37AF, opcode::OP_Divide }, + { 0x37B0, opcode::OP_GetClasses }, + { 0x37B1, opcode::OP_Invalid }, + { 0x37B2, opcode::OP_JumpOnTrue }, + { 0x37B3, opcode::OP_CallBuiltinMethod }, + { 0x37B4, opcode::OP_GetSelfObject }, + { 0x37B5, opcode::OP_GetClasses }, + { 0x37B6, opcode::OP_GetUnsignedShort }, + { 0x37B7, opcode::OP_GetLevel }, + { 0x37B8, opcode::OP_SuperEqual }, + { 0x37B9, opcode::OP_Invalid }, + { 0x37BA, opcode::OP_Invalid }, + { 0x37BB, opcode::OP_Divide }, + { 0x37BC, opcode::OP_Invalid }, + { 0x37BD, opcode::OP_GetVector }, + { 0x37BE, opcode::OP_EvalLocalVariableCached }, + { 0x37BF, opcode::OP_Invalid }, + { 0x37C0, opcode::OP_GetUnsignedShort }, + { 0x37C1, opcode::OP_DevblockBegin }, + { 0x37C2, opcode::OP_WaitTill }, + { 0x37C3, opcode::OP_JumpOnTrue }, + { 0x37C4, opcode::OP_Jump }, + { 0x37C5, opcode::OP_GetSelfObject }, + { 0x37C6, opcode::OP_ScriptMethodThreadCall }, + { 0x37C7, opcode::OP_Invalid }, + { 0x37C8, opcode::OP_CastBool }, + { 0x37C9, opcode::OP_Invalid }, + { 0x37CA, opcode::OP_New }, + { 0x37CB, opcode::OP_BoolComplement }, + { 0x37CC, opcode::OP_EvalLocalVariableRefCached }, + { 0x37CD, opcode::OP_FirstArrayKey }, + { 0x37CE, opcode::OP_ScriptThreadCall }, + { 0x37CF, opcode::OP_Bit_Xor }, + { 0x37D0, opcode::OP_WaitTill }, + { 0x37D1, opcode::OP_Invalid }, + { 0x37D2, opcode::OP_JumpOnTrueExpr }, + { 0x37D3, opcode::OP_Minus }, + { 0x37D4, opcode::OP_GetInteger }, + { 0x37D5, opcode::OP_GetUndefined }, + { 0x37D6, opcode::OP_NextArrayKey }, + { 0x37D7, opcode::OP_Invalid }, + { 0x37D8, opcode::OP_Invalid }, + { 0x37D9, opcode::OP_GetFloat }, + { 0x37DA, opcode::OP_FirstArrayKey }, + { 0x37DB, opcode::OP_SelfEvalFieldVariableRef }, + { 0x37DC, opcode::OP_GetTime }, + { 0x37DD, opcode::OP_Invalid }, + { 0x37DE, opcode::OP_ScriptThreadCallClass }, + { 0x37DF, opcode::OP_GetIString }, + { 0x37E0, opcode::OP_Invalid }, + { 0x37E1, opcode::OP_GetLevel }, + { 0x37E2, opcode::OP_Invalid }, + { 0x37E3, opcode::OP_GetTime }, + { 0x37E4, opcode::OP_Invalid }, + { 0x37E5, opcode::OP_Invalid }, + { 0x37E6, opcode::OP_GetAnimObject }, + { 0x37E7, opcode::OP_Bit_And }, + { 0x37E8, opcode::OP_New }, + { 0x37E9, opcode::OP_NotEqual }, + { 0x37EA, opcode::OP_Invalid }, + { 0x37EB, opcode::OP_Plus }, + { 0x37EC, opcode::OP_ScriptFunctionCallPointer }, + { 0x37ED, opcode::OP_GetUnsignedShort }, + { 0x37EE, opcode::OP_Notify }, + { 0x37EF, opcode::OP_ScriptMethodCallPointer }, + { 0x37F0, opcode::OP_EvalArrayRef }, + { 0x37F1, opcode::OP_SizeOf }, + { 0x37F2, opcode::OP_Divide }, + { 0x37F3, opcode::OP_Invalid }, + { 0x37F4, opcode::OP_SafeDecTop }, + { 0x37F5, opcode::OP_GetIString }, + { 0x37F6, opcode::OP_Invalid }, + { 0x37F7, opcode::OP_GetNegUnsignedShort }, + { 0x37F8, opcode::OP_GetHash }, + { 0x37F9, opcode::OP_EndSwitch }, + { 0x37FA, opcode::OP_Invalid }, + { 0x37FB, opcode::OP_GetFunction }, + { 0x37FC, opcode::OP_GetInteger }, + { 0x37FD, opcode::OP_GetNegUnsignedShort }, + { 0x37FE, opcode::OP_Invalid }, + { 0x37FF, opcode::OP_GetUintptr }, + { 0x3800, opcode::OP_GetLevel }, + { 0x3801, opcode::OP_EvalArray }, + { 0x3802, opcode::OP_Invalid }, + { 0x3803, opcode::OP_VectorScale }, + { 0x3804, opcode::OP_Invalid }, + { 0x3805, opcode::OP_GetHash }, + { 0x3806, opcode::OP_Invalid }, + { 0x3807, opcode::OP_JumpOnFalseExpr }, + { 0x3808, opcode::OP_SelfEvalFieldVariable }, + { 0x3809, opcode::OP_Invalid }, + { 0x380A, opcode::OP_GetClasses }, + { 0x380B, opcode::OP_ScriptMethodCall }, + { 0x380C, opcode::OP_GetAnimation }, + { 0x380D, opcode::OP_EndSwitch }, + { 0x380E, opcode::OP_Invalid }, + { 0x380F, opcode::OP_GetLevel }, + { 0x3810, opcode::OP_WaitTillMatch }, + { 0x3811, opcode::OP_EvalFieldVariable }, + { 0x3812, opcode::OP_Invalid }, + { 0x3813, opcode::OP_Invalid }, + { 0x3814, opcode::OP_EvalLocalVariableRefCached }, + { 0x3815, opcode::OP_GetWorldObject }, + { 0x3816, opcode::OP_EndSwitch }, + { 0x3817, opcode::OP_Plus }, + { 0x3818, opcode::OP_NextArrayKey }, + { 0x3819, opcode::OP_GetClassesObject }, + { 0x381A, opcode::OP_ScriptMethodCallPointer }, + { 0x381B, opcode::OP_FirstArrayKey }, + { 0x381C, opcode::OP_ClearArray }, + { 0x381D, opcode::OP_Invalid }, + { 0x381E, opcode::OP_GetUnsignedShort }, + { 0x381F, opcode::OP_GetLevel }, + { 0x3820, opcode::OP_Invalid }, + { 0x3821, opcode::OP_Vector }, + { 0x3822, opcode::OP_Invalid }, + { 0x3823, opcode::OP_Invalid }, + { 0x3824, opcode::OP_CastBool }, + { 0x3825, opcode::OP_Invalid }, + { 0x3826, opcode::OP_Invalid }, + { 0x3827, opcode::OP_Invalid }, + { 0x3828, opcode::OP_Invalid }, + { 0x3829, opcode::OP_Invalid }, + { 0x382A, opcode::OP_Invalid }, + { 0x382B, opcode::OP_Invalid }, + { 0x382C, opcode::OP_New }, + { 0x382D, opcode::OP_Notify }, + { 0x382E, opcode::OP_Invalid }, + { 0x382F, opcode::OP_SuperNotEqual }, + { 0x3830, opcode::OP_Invalid }, + { 0x3831, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x3832, opcode::OP_Invalid }, + { 0x3833, opcode::OP_Switch }, + { 0x3834, opcode::OP_CastBool }, + { 0x3835, opcode::OP_Invalid }, + { 0x3836, opcode::OP_NotEqual }, + { 0x3837, opcode::OP_EvalLocalVariableCached }, + { 0x3838, opcode::OP_Invalid }, + { 0x3839, opcode::OP_RealWait }, + { 0x383A, opcode::OP_GetWorld }, + { 0x383B, opcode::OP_GreaterThan }, + { 0x383C, opcode::OP_Invalid }, + { 0x383D, opcode::OP_NotEqual }, + { 0x383E, opcode::OP_Invalid }, + { 0x383F, opcode::OP_Invalid }, + { 0x3840, opcode::OP_Invalid }, + { 0x3841, opcode::OP_ProfileStart }, + { 0x3842, opcode::OP_Invalid }, + { 0x3843, opcode::OP_Bit_And }, + { 0x3844, opcode::OP_ShiftRight }, + { 0x3845, opcode::OP_SetVariableField }, + { 0x3846, opcode::OP_NextArrayKey }, + { 0x3847, opcode::OP_ScriptThreadCall }, + { 0x3848, opcode::OP_CallBuiltinMethod }, + { 0x3849, opcode::OP_Vector }, + { 0x384A, opcode::OP_Jump }, + { 0x384B, opcode::OP_Invalid }, + { 0x384C, opcode::OP_GetNegByte }, + { 0x384D, opcode::OP_GreaterThanOrEqualTo }, + { 0x384E, opcode::OP_Invalid }, + { 0x384F, opcode::OP_GetVector }, + { 0x3850, opcode::OP_GetWorld }, + { 0x3851, opcode::OP_Invalid }, + { 0x3852, opcode::OP_Invalid }, + { 0x3853, opcode::OP_Invalid }, + { 0x3854, opcode::OP_Invalid }, + { 0x3855, opcode::OP_NextArrayKey }, + { 0x3856, opcode::OP_BoolNot }, + { 0x3857, opcode::OP_LessThanOrEqualTo }, + { 0x3858, opcode::OP_Multiply }, + { 0x3859, opcode::OP_Invalid }, + { 0x385A, opcode::OP_SetVariableField }, + { 0x385B, opcode::OP_SuperEqual }, + { 0x385C, opcode::OP_ClearArray }, + { 0x385D, opcode::OP_DevblockBegin }, + { 0x385E, opcode::OP_GetWorldObject }, + { 0x385F, opcode::OP_EndSwitch }, + { 0x3860, opcode::OP_GetAnimObject }, + { 0x3861, opcode::OP_Invalid }, + { 0x3862, opcode::OP_Bit_Xor }, + { 0x3863, opcode::OP_GetByte }, + { 0x3864, opcode::OP_GetUndefined }, + { 0x3865, opcode::OP_Invalid }, + { 0x3866, opcode::OP_ScriptMethodCallPointer }, + { 0x3867, opcode::OP_SuperEqual }, + { 0x3868, opcode::OP_SelfEvalFieldVariableRef }, + { 0x3869, opcode::OP_Invalid }, + { 0x386A, opcode::OP_NextArrayKey }, + { 0x386B, opcode::OP_Notify }, + { 0x386C, opcode::OP_GreaterThan }, + { 0x386D, opcode::OP_Invalid }, + { 0x386E, opcode::OP_Invalid }, + { 0x386F, opcode::OP_Invalid }, + { 0x3870, opcode::OP_Invalid }, + { 0x3871, opcode::OP_Notify }, + { 0x3872, opcode::OP_Vector }, + { 0x3873, opcode::OP_GetAnim }, + { 0x3874, opcode::OP_Invalid }, + { 0x3875, opcode::OP_SafeSetVariableFieldCached }, + { 0x3876, opcode::OP_SelfEvalFieldVariable }, + { 0x3877, opcode::OP_Invalid }, + { 0x3878, opcode::OP_LevelEvalFieldVariable }, + { 0x3879, opcode::OP_Multiply }, + { 0x387A, opcode::OP_Invalid }, + { 0x387B, opcode::OP_GetFloat }, + { 0x387C, opcode::OP_Bit_Xor }, + { 0x387D, opcode::OP_Invalid }, + { 0x387E, opcode::OP_Invalid }, + { 0x387F, opcode::OP_Invalid }, + { 0x3880, opcode::OP_EvalFieldVariableRef }, + { 0x3881, opcode::OP_GetAnimObject }, + { 0x3882, opcode::OP_FirstArrayKey }, + { 0x3883, opcode::OP_GetString }, + { 0x3884, opcode::OP_SuperNotEqual }, + { 0x3885, opcode::OP_Bit_Xor }, + { 0x3886, opcode::OP_SafeCreateLocalVariables }, + { 0x3887, opcode::OP_Invalid }, + { 0x3888, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x3889, opcode::OP_GetUndefined }, + { 0x388A, opcode::OP_Invalid }, + { 0x388B, opcode::OP_Invalid }, + { 0x388C, opcode::OP_Invalid }, + { 0x388D, opcode::OP_Invalid }, + { 0x388E, opcode::OP_GetTime }, + { 0x388F, opcode::OP_GetIString }, + { 0x3890, opcode::OP_GetUndefined }, + { 0x3891, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x3892, opcode::OP_Invalid }, + { 0x3893, opcode::OP_Notify }, + { 0x3894, opcode::OP_Invalid }, + { 0x3895, opcode::OP_Dec }, + { 0x3896, opcode::OP_Invalid }, + { 0x3897, opcode::OP_New }, + { 0x3898, opcode::OP_GetSelf }, + { 0x3899, opcode::OP_WaitTill }, + { 0x389A, opcode::OP_GetAnimObject }, + { 0x389B, opcode::OP_GetUndefined }, + { 0x389C, opcode::OP_Vector }, + { 0x389D, opcode::OP_ShiftLeft }, + { 0x389E, opcode::OP_GreaterThan }, + { 0x389F, opcode::OP_Invalid }, + { 0x38A0, opcode::OP_GetNegByte }, + { 0x38A1, opcode::OP_GetWorldObject }, + { 0x38A2, opcode::OP_Divide }, + { 0x38A3, opcode::OP_Notify }, + { 0x38A4, opcode::OP_ClearFieldVariable }, + { 0x38A5, opcode::OP_GetClasses }, + { 0x38A6, opcode::OP_ShiftRight }, + { 0x38A7, opcode::OP_RealWait }, + { 0x38A8, opcode::OP_GetWorld }, + { 0x38A9, opcode::OP_GetString }, + { 0x38AA, opcode::OP_Modulus }, + { 0x38AB, opcode::OP_SafeCreateLocalVariables }, + { 0x38AC, opcode::OP_GetAnimation }, + { 0x38AD, opcode::OP_Invalid }, + { 0x38AE, opcode::OP_Invalid }, + { 0x38AF, opcode::OP_GetFunction }, + { 0x38B0, opcode::OP_GetTime }, + { 0x38B1, opcode::OP_Invalid }, + { 0x38B2, opcode::OP_Invalid }, + { 0x38B3, opcode::OP_GetWorld }, + { 0x38B4, opcode::OP_Invalid }, + { 0x38B5, opcode::OP_WaitTillMatch }, + { 0x38B6, opcode::OP_Invalid }, + { 0x38B7, opcode::OP_GreaterThan }, + { 0x38B8, opcode::OP_Invalid }, + { 0x38B9, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x38BA, opcode::OP_Invalid }, + { 0x38BB, opcode::OP_EvalArray }, + { 0x38BC, opcode::OP_GetWorld }, + { 0x38BD, opcode::OP_Notify }, + { 0x38BE, opcode::OP_JumpOnFalseExpr }, + { 0x38BF, opcode::OP_JumpOnTrue }, + { 0x38C0, opcode::OP_GetClasses }, + { 0x38C1, opcode::OP_Invalid }, + { 0x38C2, opcode::OP_EndSwitch }, + { 0x38C3, opcode::OP_DevblockBegin }, + { 0x38C4, opcode::OP_ScriptThreadCall }, + { 0x38C5, opcode::OP_Invalid }, + { 0x38C6, opcode::OP_ScriptThreadCall }, + { 0x38C7, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x38C8, opcode::OP_Invalid }, + { 0x38C9, opcode::OP_LevelEvalFieldVariableRef }, + { 0x38CA, opcode::OP_GreaterThanOrEqualTo }, + { 0x38CB, opcode::OP_Multiply }, + { 0x38CC, opcode::OP_ShiftLeft }, + { 0x38CD, opcode::OP_GetGameRef }, + { 0x38CE, opcode::OP_GetWorld }, + { 0x38CF, opcode::OP_SafeDecTop }, + { 0x38D0, opcode::OP_SetVariableField }, + { 0x38D1, opcode::OP_Invalid }, + { 0x38D2, opcode::OP_SelfEvalFieldVariable }, + { 0x38D3, opcode::OP_Invalid }, + { 0x38D4, opcode::OP_GetTime }, + { 0x38D5, opcode::OP_Invalid }, + { 0x38D6, opcode::OP_ScriptThreadCallClass }, + { 0x38D7, opcode::OP_Invalid }, + { 0x38D8, opcode::OP_WaitTillMatch }, + { 0x38D9, opcode::OP_ShiftRight }, + { 0x38DA, opcode::OP_GetVector }, + { 0x38DB, opcode::OP_SuperEqual }, + { 0x38DC, opcode::OP_NotEqual }, + { 0x38DD, opcode::OP_Invalid }, + { 0x38DE, opcode::OP_GetHash }, + { 0x38DF, opcode::OP_Invalid }, + { 0x38E0, opcode::OP_Invalid }, + { 0x38E1, opcode::OP_GetIString }, + { 0x38E2, opcode::OP_Invalid }, + { 0x38E3, opcode::OP_Invalid }, + { 0x38E4, opcode::OP_Modulus }, + { 0x38E5, opcode::OP_GetVector }, + { 0x38E6, opcode::OP_ShiftRight }, + { 0x38E7, opcode::OP_GetUnsignedShort }, + { 0x38E8, opcode::OP_Invalid }, + { 0x38E9, opcode::OP_EmptyArray }, + { 0x38EA, opcode::OP_Invalid }, + { 0x38EB, opcode::OP_Invalid }, + { 0x38EC, opcode::OP_DevblockBegin }, + { 0x38ED, opcode::OP_Invalid }, + { 0x38EE, opcode::OP_LessThanOrEqualTo }, + { 0x38EF, opcode::OP_Invalid }, + { 0x38F0, opcode::OP_DevblockBegin }, + { 0x38F1, opcode::OP_EvalArrayRef }, + { 0x38F2, opcode::OP_Invalid }, + { 0x38F3, opcode::OP_Invalid }, + { 0x38F4, opcode::OP_Invalid }, + { 0x38F5, opcode::OP_Bit_And }, + { 0x38F6, opcode::OP_GetFloat }, + { 0x38F7, opcode::OP_Divide }, + { 0x38F8, opcode::OP_ScriptFunctionCallClass }, + { 0x38F9, opcode::OP_GetWorld }, + { 0x38FA, opcode::OP_GetWorldObject }, + { 0x38FB, opcode::OP_Invalid }, + { 0x38FC, opcode::OP_Invalid }, + { 0x38FD, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x38FE, opcode::OP_Invalid }, + { 0x38FF, opcode::OP_ClearArray }, + { 0x3900, opcode::OP_Invalid }, + { 0x3901, opcode::OP_GetFunction }, + { 0x3902, opcode::OP_New }, + { 0x3903, opcode::OP_Invalid }, + { 0x3904, opcode::OP_EvalArrayRef }, + { 0x3905, opcode::OP_Bit_Or }, + { 0x3906, opcode::OP_Jump }, + { 0x3907, opcode::OP_Invalid }, + { 0x3908, opcode::OP_JumpOnFalseExpr }, + { 0x3909, opcode::OP_Return }, + { 0x390A, opcode::OP_Invalid }, + { 0x390B, opcode::OP_ScriptMethodThreadCall }, + { 0x390C, opcode::OP_Invalid }, + { 0x390D, opcode::OP_ScriptMethodCallPointer }, + { 0x390E, opcode::OP_WaitTillFrameEnd }, + { 0x390F, opcode::OP_Invalid }, + { 0x3910, opcode::OP_WaitTill }, + { 0x3911, opcode::OP_GetSelfObject }, + { 0x3912, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x3913, opcode::OP_Invalid }, + { 0x3914, opcode::OP_WaitTillFrameEnd }, + { 0x3915, opcode::OP_ShiftRight }, + { 0x3916, opcode::OP_GetFloat }, + { 0x3917, opcode::OP_GetAnim }, + { 0x3918, opcode::OP_ScriptThreadCallClass }, + { 0x3919, opcode::OP_WaitTill }, + { 0x391A, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x391B, opcode::OP_Invalid }, + { 0x391C, opcode::OP_ProfileStart }, + { 0x391D, opcode::OP_GetUnsignedShort }, + { 0x391E, opcode::OP_Invalid }, + { 0x391F, opcode::OP_Invalid }, + { 0x3920, opcode::OP_SelfEvalFieldVariableRef }, + { 0x3921, opcode::OP_GetAnim }, + { 0x3922, opcode::OP_GetNegByte }, + { 0x3923, opcode::OP_Invalid }, + { 0x3924, opcode::OP_JumpOnTrueExpr }, + { 0x3925, opcode::OP_LevelEvalFieldVariable }, + { 0x3926, opcode::OP_GetNegByte }, + { 0x3927, opcode::OP_Invalid }, + { 0x3928, opcode::OP_CallBuiltinMethod }, + { 0x3929, opcode::OP_Invalid }, + { 0x392A, opcode::OP_Invalid }, + { 0x392B, opcode::OP_LevelEvalFieldVariable }, + { 0x392C, opcode::OP_ScriptFunctionCall }, + { 0x392D, opcode::OP_Invalid }, + { 0x392E, opcode::OP_Bit_And }, + { 0x392F, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x3930, opcode::OP_EmptyArray }, + { 0x3931, opcode::OP_Invalid }, + { 0x3932, opcode::OP_ShiftLeft }, + { 0x3933, opcode::OP_Jump }, + { 0x3934, opcode::OP_GetUndefined }, + { 0x3935, opcode::OP_Invalid }, + { 0x3936, opcode::OP_GetAnimObject }, + { 0x3937, opcode::OP_WaitTillMatch }, + { 0x3938, opcode::OP_GetUndefined }, + { 0x3939, opcode::OP_GetIString }, + { 0x393A, opcode::OP_GetUndefined }, + { 0x393B, opcode::OP_Minus }, + { 0x393C, opcode::OP_VectorScale }, + { 0x393D, opcode::OP_GetAnimObject }, + { 0x393E, opcode::OP_Bit_And }, + { 0x393F, opcode::OP_Invalid }, + { 0x3940, opcode::OP_CallBuiltinMethod }, + { 0x3941, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x3942, opcode::OP_GetFloat }, + { 0x3943, opcode::OP_GetGameRef }, + { 0x3944, opcode::OP_EmptyArray }, + { 0x3945, opcode::OP_Invalid }, + { 0x3946, opcode::OP_Invalid }, + { 0x3947, opcode::OP_Invalid }, + { 0x3948, opcode::OP_Invalid }, + { 0x3949, opcode::OP_GetFunction }, + { 0x394A, opcode::OP_Switch }, + { 0x394B, opcode::OP_CallBuiltinMethod }, + { 0x394C, opcode::OP_ShiftLeft }, + { 0x394D, opcode::OP_GetZero }, + { 0x394E, opcode::OP_GetIString }, + { 0x394F, opcode::OP_GetSelfObject }, + { 0x3950, opcode::OP_Invalid }, + { 0x3951, opcode::OP_GetHash }, + { 0x3952, opcode::OP_VectorScale }, + { 0x3953, opcode::OP_Invalid }, + { 0x3954, opcode::OP_Invalid }, + { 0x3955, opcode::OP_GreaterThanOrEqualTo }, + { 0x3956, opcode::OP_Invalid }, + { 0x3957, opcode::OP_GetGame }, + { 0x3958, opcode::OP_Invalid }, + { 0x3959, opcode::OP_Invalid }, + { 0x395A, opcode::OP_VectorScale }, + { 0x395B, opcode::OP_New }, + { 0x395C, opcode::OP_GetWorld }, + { 0x395D, opcode::OP_GetString }, + { 0x395E, opcode::OP_Invalid }, + { 0x395F, opcode::OP_ScriptFunctionCallClass }, + { 0x3960, opcode::OP_JumpOnFalseExpr }, + { 0x3961, opcode::OP_ScriptMethodCallPointer }, + { 0x3962, opcode::OP_Invalid }, + { 0x3963, opcode::OP_GetFunction }, + { 0x3964, opcode::OP_Bit_And }, + { 0x3965, opcode::OP_Invalid }, + { 0x3966, opcode::OP_ClearArray }, + { 0x3967, opcode::OP_Invalid }, + { 0x3968, opcode::OP_Invalid }, + { 0x3969, opcode::OP_ClearArray }, + { 0x396A, opcode::OP_Invalid }, + { 0x396B, opcode::OP_LevelEvalFieldVariableRef }, + { 0x396C, opcode::OP_Invalid }, + { 0x396D, opcode::OP_GetUintptr }, + { 0x396E, opcode::OP_Invalid }, + { 0x396F, opcode::OP_Invalid }, + { 0x3970, opcode::OP_Invalid }, + { 0x3971, opcode::OP_Switch }, + { 0x3972, opcode::OP_Wait }, + { 0x3973, opcode::OP_Invalid }, + { 0x3974, opcode::OP_EndSwitch }, + { 0x3975, opcode::OP_ClearFieldVariable }, + { 0x3976, opcode::OP_WaitTillMatch }, + { 0x3977, opcode::OP_Invalid }, + { 0x3978, opcode::OP_Invalid }, + { 0x3979, opcode::OP_CallBuiltinMethod }, + { 0x397A, opcode::OP_ScriptFunctionCallClass }, + { 0x397B, opcode::OP_Bit_And }, + { 0x397C, opcode::OP_LevelEvalFieldVariableRef }, + { 0x397D, opcode::OP_GetIString }, + { 0x397E, opcode::OP_NotEqual }, + { 0x397F, opcode::OP_Invalid }, + { 0x3980, opcode::OP_JumpOnTrue }, + { 0x3981, opcode::OP_FirstArrayKey }, + { 0x3982, opcode::OP_Invalid }, + { 0x3983, opcode::OP_JumpOnTrue }, + { 0x3984, opcode::OP_CallBuiltinMethod }, + { 0x3985, opcode::OP_EndSwitch }, + { 0x3986, opcode::OP_DevblockBegin }, + { 0x3987, opcode::OP_Invalid }, + { 0x3988, opcode::OP_Invalid }, + { 0x3989, opcode::OP_Invalid }, + { 0x398A, opcode::OP_GetIString }, + { 0x398B, opcode::OP_SetVariableField }, + { 0x398C, opcode::OP_Jump }, + { 0x398D, opcode::OP_NextArrayKey }, + { 0x398E, opcode::OP_WaitTillFrameEnd }, + { 0x398F, opcode::OP_EvalFieldVariableRef }, + { 0x3990, opcode::OP_GreaterThan }, + { 0x3991, opcode::OP_Invalid }, + { 0x3992, opcode::OP_Invalid }, + { 0x3993, opcode::OP_GetVector }, + { 0x3994, opcode::OP_Notify }, + { 0x3995, opcode::OP_Invalid }, + { 0x3996, opcode::OP_Vector }, + { 0x3997, opcode::OP_Invalid }, + { 0x3998, opcode::OP_GetGame }, + { 0x3999, opcode::OP_Invalid }, + { 0x399A, opcode::OP_Invalid }, + { 0x399B, opcode::OP_GetLevel }, + { 0x399C, opcode::OP_GetAnimObject }, + { 0x399D, opcode::OP_Invalid }, + { 0x399E, opcode::OP_GetFloat }, + { 0x399F, opcode::OP_SafeCreateLocalVariables }, + { 0x39A0, opcode::OP_Invalid }, + { 0x39A1, opcode::OP_ProfileStart }, + { 0x39A2, opcode::OP_EvalFieldVariableRef }, + { 0x39A3, opcode::OP_Invalid }, + { 0x39A4, opcode::OP_Invalid }, + { 0x39A5, opcode::OP_DecTop }, + { 0x39A6, opcode::OP_Invalid }, + { 0x39A7, opcode::OP_EvalArrayRef }, + { 0x39A8, opcode::OP_GetIString }, + { 0x39A9, opcode::OP_Bit_And }, + { 0x39AA, opcode::OP_EmptyArray }, + { 0x39AB, opcode::OP_GetWorld }, + { 0x39AC, opcode::OP_LessThan }, + { 0x39AD, opcode::OP_EvalLocalVariableRefCached }, + { 0x39AE, opcode::OP_ClearArray }, + { 0x39AF, opcode::OP_SetVariableField }, + { 0x39B0, opcode::OP_EmptyArray }, + { 0x39B1, opcode::OP_Invalid }, + { 0x39B2, opcode::OP_EvalLocalVariableRefCached }, + { 0x39B3, opcode::OP_VectorScale }, + { 0x39B4, opcode::OP_Invalid }, + { 0x39B5, opcode::OP_EvalArrayRef }, + { 0x39B6, opcode::OP_GetUndefined }, + { 0x39B7, opcode::OP_GetString }, + { 0x39B8, opcode::OP_Invalid }, + { 0x39B9, opcode::OP_FirstArrayKey }, + { 0x39BA, opcode::OP_DevblockBegin }, + { 0x39BB, opcode::OP_Invalid }, + { 0x39BC, opcode::OP_Invalid }, + { 0x39BD, opcode::OP_SelfEvalFieldVariable }, + { 0x39BE, opcode::OP_Invalid }, + { 0x39BF, opcode::OP_GetClasses }, + { 0x39C0, opcode::OP_Invalid }, + { 0x39C1, opcode::OP_Jump }, + { 0x39C2, opcode::OP_Invalid }, + { 0x39C3, opcode::OP_IsDefined }, + { 0x39C4, opcode::OP_SafeCreateLocalVariables }, + { 0x39C5, opcode::OP_CallBuiltinMethod }, + { 0x39C6, opcode::OP_Bit_Or }, + { 0x39C7, opcode::OP_Minus }, + { 0x39C8, opcode::OP_IsDefined }, + { 0x39C9, opcode::OP_Invalid }, + { 0x39CA, opcode::OP_Invalid }, + { 0x39CB, opcode::OP_Multiply }, + { 0x39CC, opcode::OP_GreaterThanOrEqualTo }, + { 0x39CD, opcode::OP_Invalid }, + { 0x39CE, opcode::OP_WaitTillFrameEnd }, + { 0x39CF, opcode::OP_Invalid }, + { 0x39D0, opcode::OP_Divide }, + { 0x39D1, opcode::OP_CastBool }, + { 0x39D2, opcode::OP_Invalid }, + { 0x39D3, opcode::OP_Invalid }, + { 0x39D4, opcode::OP_ScriptThreadCallPointer }, + { 0x39D5, opcode::OP_ScriptFunctionCallClass }, + { 0x39D6, opcode::OP_ScriptMethodCallPointer }, + { 0x39D7, opcode::OP_GetHash }, + { 0x39D8, opcode::OP_GetUintptr }, + { 0x39D9, opcode::OP_Invalid }, + { 0x39DA, opcode::OP_Equal }, + { 0x39DB, opcode::OP_ProfileStart }, + { 0x39DC, opcode::OP_GetSelf }, + { 0x39DD, opcode::OP_GreaterThanOrEqualTo }, + { 0x39DE, opcode::OP_Invalid }, + { 0x39DF, opcode::OP_GetZero }, + { 0x39E0, opcode::OP_GetInteger }, + { 0x39E1, opcode::OP_ClearFieldVariable }, + { 0x39E2, opcode::OP_Invalid }, + { 0x39E3, opcode::OP_EvalLocalVariableRefCached }, + { 0x39E4, opcode::OP_Invalid }, + { 0x39E5, opcode::OP_Switch }, + { 0x39E6, opcode::OP_WaitTillFrameEnd }, + { 0x39E7, opcode::OP_JumpOnFalseExpr }, + { 0x39E8, opcode::OP_SafeDecTop }, + { 0x39E9, opcode::OP_Invalid }, + { 0x39EA, opcode::OP_GetWorld }, + { 0x39EB, opcode::OP_GetInteger }, + { 0x39EC, opcode::OP_GetSelfObject }, + { 0x39ED, opcode::OP_Invalid }, + { 0x39EE, opcode::OP_Invalid }, + { 0x39EF, opcode::OP_Notify }, + { 0x39F0, opcode::OP_ScriptFunctionCallPointer }, + { 0x39F1, opcode::OP_Invalid }, + { 0x39F2, opcode::OP_EvalFieldVariableRef }, + { 0x39F3, opcode::OP_GreaterThan }, + { 0x39F4, opcode::OP_Invalid }, + { 0x39F5, opcode::OP_GetAnimObject }, + { 0x39F6, opcode::OP_GetAnimation }, + { 0x39F7, opcode::OP_Plus }, + { 0x39F8, opcode::OP_Invalid }, + { 0x39F9, opcode::OP_Invalid }, + { 0x39FA, opcode::OP_GetWorldObject }, + { 0x39FB, opcode::OP_Invalid }, + { 0x39FC, opcode::OP_GetClasses }, + { 0x39FD, opcode::OP_Notify }, + { 0x39FE, opcode::OP_NextArrayKey }, + { 0x39FF, opcode::OP_SuperEqual }, + { 0x3A00, opcode::OP_GetNegUnsignedShort }, + { 0x3A01, opcode::OP_Invalid }, + { 0x3A02, opcode::OP_EndOn }, + { 0x3A03, opcode::OP_IsDefined }, + { 0x3A04, opcode::OP_EndSwitch }, + { 0x3A05, opcode::OP_SelfEvalFieldVariableRef }, + { 0x3A06, opcode::OP_Invalid }, + { 0x3A07, opcode::OP_Invalid }, + { 0x3A08, opcode::OP_EmptyArray }, + { 0x3A09, opcode::OP_Invalid }, + { 0x3A0A, opcode::OP_Invalid }, + { 0x3A0B, opcode::OP_LevelEvalFieldVariable }, + { 0x3A0C, opcode::OP_Invalid }, + { 0x3A0D, opcode::OP_GetAnimObject }, + { 0x3A0E, opcode::OP_GetClassesObject }, + { 0x3A0F, opcode::OP_Bit_Or }, + { 0x3A10, opcode::OP_Equal }, + { 0x3A11, opcode::OP_GetUnsignedShort }, + { 0x3A12, opcode::OP_ClearArray }, + { 0x3A13, opcode::OP_GetVector }, + { 0x3A14, opcode::OP_New }, + { 0x3A15, opcode::OP_GetGameRef }, + { 0x3A16, opcode::OP_GetLevelObject }, + { 0x3A17, opcode::OP_SetVariableField }, + { 0x3A18, opcode::OP_Bit_And }, + { 0x3A19, opcode::OP_Invalid }, + { 0x3A1A, opcode::OP_SizeOf }, + { 0x3A1B, opcode::OP_DevblockBegin }, + { 0x3A1C, opcode::OP_BoolNot }, + { 0x3A1D, opcode::OP_Invalid }, + { 0x3A1E, opcode::OP_Divide }, + { 0x3A1F, opcode::OP_GetZero }, + { 0x3A20, opcode::OP_Invalid }, + { 0x3A21, opcode::OP_Invalid }, + { 0x3A22, opcode::OP_ClearFieldVariable }, + { 0x3A23, opcode::OP_EvalFieldVariable }, + { 0x3A24, opcode::OP_Invalid }, + { 0x3A25, opcode::OP_SafeSetVariableFieldCached }, + { 0x3A26, opcode::OP_Minus }, + { 0x3A27, opcode::OP_Bit_Xor }, + { 0x3A28, opcode::OP_JumpOnTrue }, + { 0x3A29, opcode::OP_NextArrayKey }, + { 0x3A2A, opcode::OP_EvalFieldVariableRef }, + { 0x3A2B, opcode::OP_IsDefined }, + { 0x3A2C, opcode::OP_New }, + { 0x3A2D, opcode::OP_GetLevel }, + { 0x3A2E, opcode::OP_ScriptFunctionCallClass }, + { 0x3A2F, opcode::OP_Invalid }, + { 0x3A30, opcode::OP_Inc }, + { 0x3A31, opcode::OP_GetNegByte }, + { 0x3A32, opcode::OP_LessThanOrEqualTo }, + { 0x3A33, opcode::OP_ClearArray }, + { 0x3A34, opcode::OP_New }, + { 0x3A35, opcode::OP_EvalFieldVariable }, + { 0x3A36, opcode::OP_GetUndefined }, + { 0x3A37, opcode::OP_Invalid }, + { 0x3A38, opcode::OP_LevelEvalFieldVariable }, + { 0x3A39, opcode::OP_NextArrayKey }, + { 0x3A3A, opcode::OP_ScriptThreadCallClass }, + { 0x3A3B, opcode::OP_GetUnsignedShort }, + { 0x3A3C, opcode::OP_Invalid }, + { 0x3A3D, opcode::OP_ShiftLeft }, + { 0x3A3E, opcode::OP_Bit_Or }, + { 0x3A3F, opcode::OP_GetGameRef }, + { 0x3A40, opcode::OP_Invalid }, + { 0x3A41, opcode::OP_LessThan }, + { 0x3A42, opcode::OP_BoolComplement }, + { 0x3A43, opcode::OP_Invalid }, + { 0x3A44, opcode::OP_Bit_Or }, + { 0x3A45, opcode::OP_Invalid }, + { 0x3A46, opcode::OP_Invalid }, + { 0x3A47, opcode::OP_Invalid }, + { 0x3A48, opcode::OP_Jump }, + { 0x3A49, opcode::OP_Invalid }, + { 0x3A4A, opcode::OP_Modulus }, + { 0x3A4B, opcode::OP_Invalid }, + { 0x3A4C, opcode::OP_GetWorld }, + { 0x3A4D, opcode::OP_LessThan }, + { 0x3A4E, opcode::OP_GetGameRef }, + { 0x3A4F, opcode::OP_Multiply }, + { 0x3A50, opcode::OP_Invalid }, + { 0x3A51, opcode::OP_WaitTillMatch }, + { 0x3A52, opcode::OP_Invalid }, + { 0x3A53, opcode::OP_Invalid }, + { 0x3A54, opcode::OP_GetWorld }, + { 0x3A55, opcode::OP_Invalid }, + { 0x3A56, opcode::OP_WaitTillMatch }, + { 0x3A57, opcode::OP_Invalid }, + { 0x3A58, opcode::OP_NextArrayKey }, + { 0x3A59, opcode::OP_ScriptThreadCallPointer }, + { 0x3A5A, opcode::OP_Invalid }, + { 0x3A5B, opcode::OP_GetLevel }, + { 0x3A5C, opcode::OP_Invalid }, + { 0x3A5D, opcode::OP_EndSwitch }, + { 0x3A5E, opcode::OP_Invalid }, + { 0x3A5F, opcode::OP_LessThan }, + { 0x3A60, opcode::OP_ProfileStart }, + { 0x3A61, opcode::OP_Invalid }, + { 0x3A62, opcode::OP_EndOn }, + { 0x3A63, opcode::OP_CallBuiltinMethod }, + { 0x3A64, opcode::OP_Jump }, + { 0x3A65, opcode::OP_GetClassesObject }, + { 0x3A66, opcode::OP_Notify }, + { 0x3A67, opcode::OP_WaitTillMatch }, + { 0x3A68, opcode::OP_Invalid }, + { 0x3A69, opcode::OP_Invalid }, + { 0x3A6A, opcode::OP_Invalid }, + { 0x3A6B, opcode::OP_JumpOnTrue }, + { 0x3A6C, opcode::OP_VectorScale }, + { 0x3A6D, opcode::OP_GetIString }, + { 0x3A6E, opcode::OP_Bit_Or }, + { 0x3A6F, opcode::OP_SelfEvalFieldVariable }, + { 0x3A70, opcode::OP_GetAnimObject }, + { 0x3A71, opcode::OP_GetWorld }, + { 0x3A72, opcode::OP_EvalFieldVariable }, + { 0x3A73, opcode::OP_RealWait }, + { 0x3A74, opcode::OP_ScriptFunctionCallPointer }, + { 0x3A75, opcode::OP_Invalid }, + { 0x3A76, opcode::OP_Invalid }, + { 0x3A77, opcode::OP_Invalid }, + { 0x3A78, opcode::OP_Invalid }, + { 0x3A79, opcode::OP_JumpOnFalse }, + { 0x3A7A, opcode::OP_Invalid }, + { 0x3A7B, opcode::OP_SetVariableField }, + { 0x3A7C, opcode::OP_Invalid }, + { 0x3A7D, opcode::OP_Invalid }, + { 0x3A7E, opcode::OP_GetNegUnsignedShort }, + { 0x3A7F, opcode::OP_VectorConstant }, + { 0x3A80, opcode::OP_Wait }, + { 0x3A81, opcode::OP_Inc }, + { 0x3A82, opcode::OP_LessThan }, + { 0x3A83, opcode::OP_GetAPIFunction }, + { 0x3A84, opcode::OP_GetUintptr }, + { 0x3A85, opcode::OP_Invalid }, + { 0x3A86, opcode::OP_GetSelfObject }, + { 0x3A87, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x3A88, opcode::OP_GreaterThan }, + { 0x3A89, opcode::OP_Invalid }, + { 0x3A8A, opcode::OP_Invalid }, + { 0x3A8B, opcode::OP_WaitTillFrameEnd }, + { 0x3A8C, opcode::OP_Invalid }, + { 0x3A8D, opcode::OP_WaitTill }, + { 0x3A8E, opcode::OP_Bit_Xor }, + { 0x3A8F, opcode::OP_Invalid }, + { 0x3A90, opcode::OP_Invalid }, + { 0x3A91, opcode::OP_GetClassesObject }, + { 0x3A92, opcode::OP_Wait }, + { 0x3A93, opcode::OP_WaitTillFrameEnd }, + { 0x3A94, opcode::OP_GetFloat }, + { 0x3A95, opcode::OP_CastBool }, + { 0x3A96, opcode::OP_SafeDecTop }, + { 0x3A97, opcode::OP_Invalid }, + { 0x3A98, opcode::OP_GetVector }, + { 0x3A99, opcode::OP_GetAnimObject }, + { 0x3A9A, opcode::OP_Minus }, + { 0x3A9B, opcode::OP_Invalid }, + { 0x3A9C, opcode::OP_ScriptFunctionCallClass }, + { 0x3A9D, opcode::OP_Invalid }, + { 0x3A9E, opcode::OP_Invalid }, + { 0x3A9F, opcode::OP_JumpOnTrue }, + { 0x3AA0, opcode::OP_Invalid }, + { 0x3AA1, opcode::OP_Invalid }, + { 0x3AA2, opcode::OP_SafeDecTop }, + { 0x3AA3, opcode::OP_SizeOf }, + { 0x3AA4, opcode::OP_Invalid }, + { 0x3AA5, opcode::OP_Invalid }, + { 0x3AA6, opcode::OP_Dec }, + { 0x3AA7, opcode::OP_GetString }, + { 0x3AA8, opcode::OP_EvalFieldVariableRef }, + { 0x3AA9, opcode::OP_SuperNotEqual }, + { 0x3AAA, opcode::OP_Return }, + { 0x3AAB, opcode::OP_Invalid }, + { 0x3AAC, opcode::OP_Invalid }, + { 0x3AAD, opcode::OP_GreaterThan }, + { 0x3AAE, opcode::OP_EmptyArray }, + { 0x3AAF, opcode::OP_Invalid }, + { 0x3AB0, opcode::OP_DevblockBegin }, + { 0x3AB1, opcode::OP_Notify }, + { 0x3AB2, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x3AB3, opcode::OP_GreaterThan }, + { 0x3AB4, opcode::OP_VectorScale }, + { 0x3AB5, opcode::OP_Invalid }, + { 0x3AB6, opcode::OP_Invalid }, + { 0x3AB7, opcode::OP_GetAnimObject }, + { 0x3AB8, opcode::OP_Invalid }, + { 0x3AB9, opcode::OP_ShiftLeft }, + { 0x3ABA, opcode::OP_LessThan }, + { 0x3ABB, opcode::OP_Invalid }, + { 0x3ABC, opcode::OP_Invalid }, + { 0x3ABD, opcode::OP_Invalid }, + { 0x3ABE, opcode::OP_SelfEvalFieldVariable }, + { 0x3ABF, opcode::OP_Invalid }, + { 0x3AC0, opcode::OP_Invalid }, + { 0x3AC1, opcode::OP_GetHash }, + { 0x3AC2, opcode::OP_Plus }, + { 0x3AC3, opcode::OP_ScriptMethodCallPointer }, + { 0x3AC4, opcode::OP_IsDefined }, + { 0x3AC5, opcode::OP_WaitTillFrameEnd }, + { 0x3AC6, opcode::OP_NextArrayKey }, + { 0x3AC7, opcode::OP_Invalid }, + { 0x3AC8, opcode::OP_Bit_Xor }, + { 0x3AC9, opcode::OP_Bit_Xor }, + { 0x3ACA, opcode::OP_ScriptMethodCall }, + { 0x3ACB, opcode::OP_EndOn }, + { 0x3ACC, opcode::OP_Invalid }, + { 0x3ACD, opcode::OP_Invalid }, + { 0x3ACE, opcode::OP_GetSelf }, + { 0x3ACF, opcode::OP_Return }, + { 0x3AD0, opcode::OP_GetUnsignedShort }, + { 0x3AD1, opcode::OP_Minus }, + { 0x3AD2, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x3AD3, opcode::OP_GetZero }, + { 0x3AD4, opcode::OP_SafeDecTop }, + { 0x3AD5, opcode::OP_Invalid }, + { 0x3AD6, opcode::OP_Invalid }, + { 0x3AD7, opcode::OP_GetClassesObject }, + { 0x3AD8, opcode::OP_GetHash }, + { 0x3AD9, opcode::OP_Invalid }, + { 0x3ADA, opcode::OP_Invalid }, + { 0x3ADB, opcode::OP_New }, + { 0x3ADC, opcode::OP_EvalArray }, + { 0x3ADD, opcode::OP_Invalid }, + { 0x3ADE, opcode::OP_GetWorld }, + { 0x3ADF, opcode::OP_EndOn }, + { 0x3AE0, opcode::OP_Jump }, + { 0x3AE1, opcode::OP_Invalid }, + { 0x3AE2, opcode::OP_Return }, + { 0x3AE3, opcode::OP_Plus }, + { 0x3AE4, opcode::OP_Invalid }, + { 0x3AE5, opcode::OP_Invalid }, + { 0x3AE6, opcode::OP_SuperNotEqual }, + { 0x3AE7, opcode::OP_Invalid }, + { 0x3AE8, opcode::OP_WaitTillMatch }, + { 0x3AE9, opcode::OP_NextArrayKey }, + { 0x3AEA, opcode::OP_New }, + { 0x3AEB, opcode::OP_Notify }, + { 0x3AEC, opcode::OP_Invalid }, + { 0x3AED, opcode::OP_Invalid }, + { 0x3AEE, opcode::OP_NotEqual }, + { 0x3AEF, opcode::OP_JumpOnTrue }, + { 0x3AF0, opcode::OP_GetSelfObject }, + { 0x3AF1, opcode::OP_Switch }, + { 0x3AF2, opcode::OP_LevelEvalFieldVariableRef }, + { 0x3AF3, opcode::OP_Invalid }, + { 0x3AF4, opcode::OP_Invalid }, + { 0x3AF5, opcode::OP_ProfileStart }, + { 0x3AF6, opcode::OP_SafeCreateLocalVariables }, + { 0x3AF7, opcode::OP_GetHash }, + { 0x3AF8, opcode::OP_Invalid }, + { 0x3AF9, opcode::OP_GetFloat }, + { 0x3AFA, opcode::OP_Return }, + { 0x3AFB, opcode::OP_ScriptFunctionCallClass }, + { 0x3AFC, opcode::OP_Invalid }, + { 0x3AFD, opcode::OP_Invalid }, + { 0x3AFE, opcode::OP_Invalid }, + { 0x3AFF, opcode::OP_ShiftLeft }, + { 0x3B00, opcode::OP_SizeOf }, + { 0x3B01, opcode::OP_SelfEvalFieldVariableRef }, + { 0x3B02, opcode::OP_LessThanOrEqualTo }, + { 0x3B03, opcode::OP_Invalid }, + { 0x3B04, opcode::OP_Invalid }, + { 0x3B05, opcode::OP_BoolComplement }, + { 0x3B06, opcode::OP_EmptyArray }, + { 0x3B07, opcode::OP_Invalid }, + { 0x3B08, opcode::OP_EvalArray }, + { 0x3B09, opcode::OP_EvalLocalVariableCached }, + { 0x3B0A, opcode::OP_BoolNot }, + { 0x3B0B, opcode::OP_ShiftRight }, + { 0x3B0C, opcode::OP_GetFloat }, + { 0x3B0D, opcode::OP_Invalid }, + { 0x3B0E, opcode::OP_Invalid }, + { 0x3B0F, opcode::OP_LessThanOrEqualTo }, + { 0x3B10, opcode::OP_Modulus }, + { 0x3B11, opcode::OP_GetWorld }, + { 0x3B12, opcode::OP_ScriptMethodCall }, + { 0x3B13, opcode::OP_GetZero }, + { 0x3B14, opcode::OP_Invalid }, + { 0x3B15, opcode::OP_ScriptMethodThreadCall }, + { 0x3B16, opcode::OP_Dec }, + { 0x3B17, opcode::OP_GetVector }, + { 0x3B18, opcode::OP_Equal }, + { 0x3B19, opcode::OP_Invalid }, + { 0x3B1A, opcode::OP_ShiftLeft }, + { 0x3B1B, opcode::OP_ClearArray }, + { 0x3B1C, opcode::OP_LevelEvalFieldVariableRef }, + { 0x3B1D, opcode::OP_GetAnimObject }, + { 0x3B1E, opcode::OP_Invalid }, + { 0x3B1F, opcode::OP_SetVariableField }, + { 0x3B20, opcode::OP_SafeDecTop }, + { 0x3B21, opcode::OP_SelfEvalFieldVariableRef }, + { 0x3B22, opcode::OP_WaitTillFrameEnd }, + { 0x3B23, opcode::OP_EvalArrayRef }, + { 0x3B24, opcode::OP_GetAnim }, + { 0x3B25, opcode::OP_GetClassesObject }, + { 0x3B26, opcode::OP_RealWait }, + { 0x3B27, opcode::OP_GetLevelObject }, + { 0x3B28, opcode::OP_Invalid }, + { 0x3B29, opcode::OP_Invalid }, + { 0x3B2A, opcode::OP_Invalid }, + { 0x3B2B, opcode::OP_Invalid }, + { 0x3B2C, opcode::OP_ScriptMethodCall }, + { 0x3B2D, opcode::OP_GetGame }, + { 0x3B2E, opcode::OP_WaitTill }, + { 0x3B2F, opcode::OP_Notify }, + { 0x3B30, opcode::OP_ClearArray }, + { 0x3B31, opcode::OP_DecTop }, + { 0x3B32, opcode::OP_Invalid }, + { 0x3B33, opcode::OP_JumpOnTrueExpr }, + { 0x3B34, opcode::OP_Plus }, + { 0x3B35, opcode::OP_GetLevelObject }, + { 0x3B36, opcode::OP_ClearFieldVariable }, + { 0x3B37, opcode::OP_ScriptMethodThreadCall }, + { 0x3B38, opcode::OP_GetTime }, + { 0x3B39, opcode::OP_EndSwitch }, + { 0x3B3A, opcode::OP_Invalid }, + { 0x3B3B, opcode::OP_GetLevel }, + { 0x3B3C, opcode::OP_SafeSetVariableFieldCached }, + { 0x3B3D, opcode::OP_WaitTill }, + { 0x3B3E, opcode::OP_Dec }, + { 0x3B3F, opcode::OP_VectorScale }, + { 0x3B40, opcode::OP_JumpOnTrue }, + { 0x3B41, opcode::OP_Invalid }, + { 0x3B42, opcode::OP_GetWorld }, + { 0x3B43, opcode::OP_GetNegUnsignedShort }, + { 0x3B44, opcode::OP_Invalid }, + { 0x3B45, opcode::OP_EvalArray }, + { 0x3B46, opcode::OP_Invalid }, + { 0x3B47, opcode::OP_ScriptThreadCall }, + { 0x3B48, opcode::OP_LevelEvalFieldVariable }, + { 0x3B49, opcode::OP_GetAnim }, + { 0x3B4A, opcode::OP_GetByte }, + { 0x3B4B, opcode::OP_Invalid }, + { 0x3B4C, opcode::OP_GetUndefined }, + { 0x3B4D, opcode::OP_JumpOnTrueExpr }, + { 0x3B4E, opcode::OP_EndSwitch }, + { 0x3B4F, opcode::OP_Invalid }, + { 0x3B50, opcode::OP_Invalid }, + { 0x3B51, opcode::OP_Invalid }, + { 0x3B52, opcode::OP_Return }, + { 0x3B53, opcode::OP_Invalid }, + { 0x3B54, opcode::OP_Invalid }, + { 0x3B55, opcode::OP_Invalid }, + { 0x3B56, opcode::OP_Invalid }, + { 0x3B57, opcode::OP_Invalid }, + { 0x3B58, opcode::OP_Invalid }, + { 0x3B59, opcode::OP_Invalid }, + { 0x3B5A, opcode::OP_GetLevel }, + { 0x3B5B, opcode::OP_GetFunction }, + { 0x3B5C, opcode::OP_LevelEvalFieldVariableRef }, + { 0x3B5D, opcode::OP_ProfileStart }, + { 0x3B5E, opcode::OP_Minus }, + { 0x3B5F, opcode::OP_GetIString }, + { 0x3B60, opcode::OP_Invalid }, + { 0x3B61, opcode::OP_GetAPIFunction }, + { 0x3B62, opcode::OP_Invalid }, + { 0x3B63, opcode::OP_JumpOnTrue }, + { 0x3B64, opcode::OP_FirstArrayKey }, + { 0x3B65, opcode::OP_ProfileStart }, + { 0x3B66, opcode::OP_GetVector }, + { 0x3B67, opcode::OP_GetVector }, + { 0x3B68, opcode::OP_Invalid }, + { 0x3B69, opcode::OP_Invalid }, + { 0x3B6A, opcode::OP_Switch }, + { 0x3B6B, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x3B6C, opcode::OP_Invalid }, + { 0x3B6D, opcode::OP_GetString }, + { 0x3B6E, opcode::OP_SizeOf }, + { 0x3B6F, opcode::OP_EvalLocalVariableRefCached }, + { 0x3B70, opcode::OP_CastFieldObject }, + { 0x3B71, opcode::OP_Invalid }, + { 0x3B72, opcode::OP_SelfEvalFieldVariableRef }, + { 0x3B73, opcode::OP_IsDefined }, + { 0x3B74, opcode::OP_SelfEvalFieldVariableRef }, + { 0x3B75, opcode::OP_GetAnimation }, + { 0x3B76, opcode::OP_GetAnim }, + { 0x3B77, opcode::OP_Invalid }, + { 0x3B78, opcode::OP_Invalid }, + { 0x3B79, opcode::OP_Jump }, + { 0x3B7A, opcode::OP_CastFieldObject }, + { 0x3B7B, opcode::OP_EvalLocalVariableCached }, + { 0x3B7C, opcode::OP_Invalid }, + { 0x3B7D, opcode::OP_GetAnimation }, + { 0x3B7E, opcode::OP_Invalid }, + { 0x3B7F, opcode::OP_GetGame }, + { 0x3B80, opcode::OP_GetInteger }, + { 0x3B81, opcode::OP_Invalid }, + { 0x3B82, opcode::OP_Invalid }, + { 0x3B83, opcode::OP_ClearFieldVariable }, + { 0x3B84, opcode::OP_Invalid }, + { 0x3B85, opcode::OP_Jump }, + { 0x3B86, opcode::OP_EndOn }, + { 0x3B87, opcode::OP_Invalid }, + { 0x3B88, opcode::OP_Invalid }, + { 0x3B89, opcode::OP_Inc }, + { 0x3B8A, opcode::OP_EmptyArray }, + { 0x3B8B, opcode::OP_Invalid }, + { 0x3B8C, opcode::OP_Invalid }, + { 0x3B8D, opcode::OP_ClearFieldVariable }, + { 0x3B8E, opcode::OP_GetSelf }, + { 0x3B8F, opcode::OP_ScriptFunctionCall }, + { 0x3B90, opcode::OP_ShiftRight }, + { 0x3B91, opcode::OP_GetTime }, + { 0x3B92, opcode::OP_SafeSetVariableFieldCached }, + { 0x3B93, opcode::OP_Invalid }, + { 0x3B94, opcode::OP_Invalid }, + { 0x3B95, opcode::OP_SafeSetVariableFieldCached }, + { 0x3B96, opcode::OP_BoolComplement }, + { 0x3B97, opcode::OP_EvalFieldVariable }, + { 0x3B98, opcode::OP_BoolNot }, + { 0x3B99, opcode::OP_Invalid }, + { 0x3B9A, opcode::OP_DevblockBegin }, + { 0x3B9B, opcode::OP_Bit_And }, + { 0x3B9C, opcode::OP_EvalFieldVariable }, + { 0x3B9D, opcode::OP_EndOn }, + { 0x3B9E, opcode::OP_JumpOnFalse }, + { 0x3B9F, opcode::OP_Invalid }, + { 0x3BA0, opcode::OP_JumpOnTrueExpr }, + { 0x3BA1, opcode::OP_GetGameRef }, + { 0x3BA2, opcode::OP_Invalid }, + { 0x3BA3, opcode::OP_Invalid }, + { 0x3BA4, opcode::OP_GetFloat }, + { 0x3BA5, opcode::OP_GetFunction }, + { 0x3BA6, opcode::OP_Invalid }, + { 0x3BA7, opcode::OP_ProfileStop }, + { 0x3BA8, opcode::OP_Invalid }, + { 0x3BA9, opcode::OP_Switch }, + { 0x3BAA, opcode::OP_Invalid }, + { 0x3BAB, opcode::OP_CallBuiltinMethod }, + { 0x3BAC, opcode::OP_Invalid }, + { 0x3BAD, opcode::OP_Invalid }, + { 0x3BAE, opcode::OP_EmptyArray }, + { 0x3BAF, opcode::OP_GetAnimation }, + { 0x3BB0, opcode::OP_JumpOnTrue }, + { 0x3BB1, opcode::OP_ScriptMethodThreadCall }, + { 0x3BB2, opcode::OP_Multiply }, + { 0x3BB3, opcode::OP_Invalid }, + { 0x3BB4, opcode::OP_SafeCreateLocalVariables }, + { 0x3BB5, opcode::OP_Invalid }, + { 0x3BB6, opcode::OP_GetAnimObject }, + { 0x3BB7, opcode::OP_SuperEqual }, + { 0x3BB8, opcode::OP_GetWorldObject }, + { 0x3BB9, opcode::OP_LessThan }, + { 0x3BBA, opcode::OP_Equal }, + { 0x3BBB, opcode::OP_GetLevelObject }, + { 0x3BBC, opcode::OP_CallBuiltinMethod }, + { 0x3BBD, opcode::OP_GetSelfObject }, + { 0x3BBE, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x3BBF, opcode::OP_GetByte }, + { 0x3BC0, opcode::OP_Invalid }, + { 0x3BC1, opcode::OP_Invalid }, + { 0x3BC2, opcode::OP_Invalid }, + { 0x3BC3, opcode::OP_Invalid }, + { 0x3BC4, opcode::OP_Invalid }, + { 0x3BC5, opcode::OP_Invalid }, + { 0x3BC6, opcode::OP_Invalid }, + { 0x3BC7, opcode::OP_Invalid }, + { 0x3BC8, opcode::OP_Invalid }, + { 0x3BC9, opcode::OP_Invalid }, + { 0x3BCA, opcode::OP_ClearFieldVariable }, + { 0x3BCB, opcode::OP_ScriptMethodCallPointer }, + { 0x3BCC, opcode::OP_Minus }, + { 0x3BCD, opcode::OP_CallBuiltinMethod }, + { 0x3BCE, opcode::OP_JumpOnTrue }, + { 0x3BCF, opcode::OP_JumpOnFalse }, + { 0x3BD0, opcode::OP_LevelEvalFieldVariable }, + { 0x3BD1, opcode::OP_GetFloat }, + { 0x3BD2, opcode::OP_Invalid }, + { 0x3BD3, opcode::OP_Invalid }, + { 0x3BD4, opcode::OP_VectorConstant }, + { 0x3BD5, opcode::OP_Invalid }, + { 0x3BD6, opcode::OP_LevelEvalFieldVariable }, + { 0x3BD7, opcode::OP_GetAPIFunction }, + { 0x3BD8, opcode::OP_EmptyArray }, + { 0x3BD9, opcode::OP_SelfEvalFieldVariable }, + { 0x3BDA, opcode::OP_LevelEvalFieldVariable }, + { 0x3BDB, opcode::OP_GetUndefined }, + { 0x3BDC, opcode::OP_GetLevel }, + { 0x3BDD, opcode::OP_GetUndefined }, + { 0x3BDE, opcode::OP_ClearArray }, + { 0x3BDF, opcode::OP_SuperEqual }, + { 0x3BE0, opcode::OP_Invalid }, + { 0x3BE1, opcode::OP_Invalid }, + { 0x3BE2, opcode::OP_Invalid }, + { 0x3BE3, opcode::OP_ShiftLeft }, + { 0x3BE4, opcode::OP_EvalLocalVariableRefCached }, + { 0x3BE5, opcode::OP_GetClassesObject }, + { 0x3BE6, opcode::OP_Invalid }, + { 0x3BE7, opcode::OP_JumpOnTrue }, + { 0x3BE8, opcode::OP_Invalid }, + { 0x3BE9, opcode::OP_GetFloat }, + { 0x3BEA, opcode::OP_GetSelf }, + { 0x3BEB, opcode::OP_EvalArray }, + { 0x3BEC, opcode::OP_Invalid }, + { 0x3BED, opcode::OP_EmptyArray }, + { 0x3BEE, opcode::OP_GetHash }, + { 0x3BEF, opcode::OP_Invalid }, + { 0x3BF0, opcode::OP_JumpOnFalseExpr }, + { 0x3BF1, opcode::OP_Invalid }, + { 0x3BF2, opcode::OP_GetLevel }, + { 0x3BF3, opcode::OP_ScriptThreadCallPointer }, + { 0x3BF4, opcode::OP_Invalid }, + { 0x3BF5, opcode::OP_Invalid }, + { 0x3BF6, opcode::OP_Invalid }, + { 0x3BF7, opcode::OP_Invalid }, + { 0x3BF8, opcode::OP_Invalid }, + { 0x3BF9, opcode::OP_Invalid }, + { 0x3BFA, opcode::OP_Bit_Xor }, + { 0x3BFB, opcode::OP_Invalid }, + { 0x3BFC, opcode::OP_GetAnimation }, + { 0x3BFD, opcode::OP_Invalid }, + { 0x3BFE, opcode::OP_EvalLocalVariableCached }, + { 0x3BFF, opcode::OP_EvalLocalVariableCached }, + { 0x3C00, opcode::OP_Invalid }, + { 0x3C01, opcode::OP_DecTop }, + { 0x3C02, opcode::OP_EvalFieldVariable }, + { 0x3C03, opcode::OP_Invalid }, + { 0x3C04, opcode::OP_GetSelf }, + { 0x3C05, opcode::OP_WaitTill }, + { 0x3C06, opcode::OP_Invalid }, + { 0x3C07, opcode::OP_Invalid }, + { 0x3C08, opcode::OP_Minus }, + { 0x3C09, opcode::OP_ScriptThreadCallClass }, + { 0x3C0A, opcode::OP_Invalid }, + { 0x3C0B, opcode::OP_GetByte }, + { 0x3C0C, opcode::OP_GetVector }, + { 0x3C0D, opcode::OP_Invalid }, + { 0x3C0E, opcode::OP_RealWait }, + { 0x3C0F, opcode::OP_GetAPIFunction }, + { 0x3C10, opcode::OP_Minus }, + { 0x3C11, opcode::OP_Invalid }, + { 0x3C12, opcode::OP_NextArrayKey }, + { 0x3C13, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x3C14, opcode::OP_SelfEvalFieldVariable }, + { 0x3C15, opcode::OP_Invalid }, + { 0x3C16, opcode::OP_Bit_Xor }, + { 0x3C17, opcode::OP_EvalLocalVariableRefCached }, + { 0x3C18, opcode::OP_Invalid }, + { 0x3C19, opcode::OP_ShiftRight }, + { 0x3C1A, opcode::OP_SelfEvalFieldVariable }, + { 0x3C1B, opcode::OP_Invalid }, + { 0x3C1C, opcode::OP_Invalid }, + { 0x3C1D, opcode::OP_Invalid }, + { 0x3C1E, opcode::OP_NextArrayKey }, + { 0x3C1F, opcode::OP_ShiftLeft }, + { 0x3C20, opcode::OP_Invalid }, + { 0x3C21, opcode::OP_Notify }, + { 0x3C22, opcode::OP_JumpOnFalse }, + { 0x3C23, opcode::OP_LessThan }, + { 0x3C24, opcode::OP_EvalArray }, + { 0x3C25, opcode::OP_GetGameRef }, + { 0x3C26, opcode::OP_LevelEvalFieldVariable }, + { 0x3C27, opcode::OP_DecTop }, + { 0x3C28, opcode::OP_GetGame }, + { 0x3C29, opcode::OP_ScriptThreadCallPointer }, + { 0x3C2A, opcode::OP_NextArrayKey }, + { 0x3C2B, opcode::OP_Minus }, + { 0x3C2C, opcode::OP_SafeDecTop }, + { 0x3C2D, opcode::OP_GetUnsignedShort }, + { 0x3C2E, opcode::OP_Switch }, + { 0x3C2F, opcode::OP_Invalid }, + { 0x3C30, opcode::OP_GetString }, + { 0x3C31, opcode::OP_EvalArray }, + { 0x3C32, opcode::OP_GetFloat }, + { 0x3C33, opcode::OP_Switch }, + { 0x3C34, opcode::OP_Switch }, + { 0x3C35, opcode::OP_GetSelf }, + { 0x3C36, opcode::OP_NotEqual }, + { 0x3C37, opcode::OP_Invalid }, + { 0x3C38, opcode::OP_Vector }, + { 0x3C39, opcode::OP_Invalid }, + { 0x3C3A, opcode::OP_Minus }, + { 0x3C3B, opcode::OP_GetNegUnsignedShort }, + { 0x3C3C, opcode::OP_Invalid }, + { 0x3C3D, opcode::OP_GetSelfObject }, + { 0x3C3E, opcode::OP_Invalid }, + { 0x3C3F, opcode::OP_Inc }, + { 0x3C40, opcode::OP_Invalid }, + { 0x3C41, opcode::OP_GetAnim }, + { 0x3C42, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x3C43, opcode::OP_Divide }, + { 0x3C44, opcode::OP_Invalid }, + { 0x3C45, opcode::OP_GetUintptr }, + { 0x3C46, opcode::OP_Invalid }, + { 0x3C47, opcode::OP_EvalFieldVariableRef }, + { 0x3C48, opcode::OP_Invalid }, + { 0x3C49, opcode::OP_ProfileStart }, + { 0x3C4A, opcode::OP_Invalid }, + { 0x3C4B, opcode::OP_GetTime }, + { 0x3C4C, opcode::OP_Invalid }, + { 0x3C4D, opcode::OP_SafeSetVariableFieldCached }, + { 0x3C4E, opcode::OP_SuperNotEqual }, + { 0x3C4F, opcode::OP_GetInteger }, + { 0x3C50, opcode::OP_Invalid }, + { 0x3C51, opcode::OP_Invalid }, + { 0x3C52, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x3C53, opcode::OP_GetLevel }, + { 0x3C54, opcode::OP_Jump }, + { 0x3C55, opcode::OP_GetAnim }, + { 0x3C56, opcode::OP_Invalid }, + { 0x3C57, opcode::OP_Invalid }, + { 0x3C58, opcode::OP_Invalid }, + { 0x3C59, opcode::OP_GetSelfObject }, + { 0x3C5A, opcode::OP_Invalid }, + { 0x3C5B, opcode::OP_GetVector }, + { 0x3C5C, opcode::OP_GetWorldObject }, + { 0x3C5D, opcode::OP_Invalid }, + { 0x3C5E, opcode::OP_GetSelf }, + { 0x3C5F, opcode::OP_New }, + { 0x3C60, opcode::OP_Invalid }, + { 0x3C61, opcode::OP_Bit_Xor }, + { 0x3C62, opcode::OP_Invalid }, + { 0x3C63, opcode::OP_WaitTill }, + { 0x3C64, opcode::OP_BoolNot }, + { 0x3C65, opcode::OP_BoolComplement }, + { 0x3C66, opcode::OP_ScriptFunctionCallClass }, + { 0x3C67, opcode::OP_ScriptThreadCallPointer }, + { 0x3C68, opcode::OP_EmptyArray }, + { 0x3C69, opcode::OP_JumpOnFalseExpr }, + { 0x3C6A, opcode::OP_Notify }, + { 0x3C6B, opcode::OP_FirstArrayKey }, + { 0x3C6C, opcode::OP_Bit_Or }, + { 0x3C6D, opcode::OP_ScriptFunctionCallPointer }, + { 0x3C6E, opcode::OP_Invalid }, + { 0x3C6F, opcode::OP_GetZero }, + { 0x3C70, opcode::OP_EndSwitch }, + { 0x3C71, opcode::OP_Invalid }, + { 0x3C72, opcode::OP_Invalid }, + { 0x3C73, opcode::OP_EndOn }, + { 0x3C74, opcode::OP_VectorScale }, + { 0x3C75, opcode::OP_LevelEvalFieldVariable }, + { 0x3C76, opcode::OP_EvalLocalVariableCached }, + { 0x3C77, opcode::OP_Invalid }, + { 0x3C78, opcode::OP_BoolNot }, + { 0x3C79, opcode::OP_Invalid }, + { 0x3C7A, opcode::OP_GetIString }, + { 0x3C7B, opcode::OP_SizeOf }, + { 0x3C7C, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x3C7D, opcode::OP_Invalid }, + { 0x3C7E, opcode::OP_Invalid }, + { 0x3C7F, opcode::OP_Invalid }, + { 0x3C80, opcode::OP_Invalid }, + { 0x3C81, opcode::OP_LevelEvalFieldVariable }, + { 0x3C82, opcode::OP_Dec }, + { 0x3C83, opcode::OP_Multiply }, + { 0x3C84, opcode::OP_Invalid }, + { 0x3C85, opcode::OP_Invalid }, + { 0x3C86, opcode::OP_ClearFieldVariable }, + { 0x3C87, opcode::OP_WaitTillFrameEnd }, + { 0x3C88, opcode::OP_EvalLocalVariableCached }, + { 0x3C89, opcode::OP_VectorScale }, + { 0x3C8A, opcode::OP_EvalLocalVariableCached }, + { 0x3C8B, opcode::OP_Switch }, + { 0x3C8C, opcode::OP_Invalid }, + { 0x3C8D, opcode::OP_ScriptFunctionCallPointer }, + { 0x3C8E, opcode::OP_JumpOnTrueExpr }, + { 0x3C8F, opcode::OP_SelfEvalFieldVariable }, + { 0x3C90, opcode::OP_ScriptMethodCall }, + { 0x3C91, opcode::OP_Invalid }, + { 0x3C92, opcode::OP_Invalid }, + { 0x3C93, opcode::OP_EvalFieldVariable }, + { 0x3C94, opcode::OP_SafeSetVariableFieldCached }, + { 0x3C95, opcode::OP_Invalid }, + { 0x3C96, opcode::OP_Invalid }, + { 0x3C97, opcode::OP_Invalid }, + { 0x3C98, opcode::OP_JumpOnFalse }, + { 0x3C99, opcode::OP_EvalFieldVariable }, + { 0x3C9A, opcode::OP_LessThanOrEqualTo }, + { 0x3C9B, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x3C9C, opcode::OP_Invalid }, + { 0x3C9D, opcode::OP_Invalid }, + { 0x3C9E, opcode::OP_ScriptFunctionCallClass }, + { 0x3C9F, opcode::OP_Invalid }, + { 0x3CA0, opcode::OP_ClearArray }, + { 0x3CA1, opcode::OP_GetVector }, + { 0x3CA2, opcode::OP_New }, + { 0x3CA3, opcode::OP_Invalid }, + { 0x3CA4, opcode::OP_GetInteger }, + { 0x3CA5, opcode::OP_Invalid }, + { 0x3CA6, opcode::OP_Plus }, + { 0x3CA7, opcode::OP_GetAnim }, + { 0x3CA8, opcode::OP_Invalid }, + { 0x3CA9, opcode::OP_Return }, + { 0x3CAA, opcode::OP_GetIString }, + { 0x3CAB, opcode::OP_Multiply }, + { 0x3CAC, opcode::OP_GetUndefined }, + { 0x3CAD, opcode::OP_WaitTillFrameEnd }, + { 0x3CAE, opcode::OP_SetVariableField }, + { 0x3CAF, opcode::OP_Invalid }, + { 0x3CB0, opcode::OP_ClearFieldVariable }, + { 0x3CB1, opcode::OP_LessThanOrEqualTo }, + { 0x3CB2, opcode::OP_ClearArray }, + { 0x3CB3, opcode::OP_Invalid }, + { 0x3CB4, opcode::OP_Multiply }, + { 0x3CB5, opcode::OP_GetClassesObject }, + { 0x3CB6, opcode::OP_GetTime }, + { 0x3CB7, opcode::OP_Invalid }, + { 0x3CB8, opcode::OP_GetGame }, + { 0x3CB9, opcode::OP_NextArrayKey }, + { 0x3CBA, opcode::OP_GetUnsignedShort }, + { 0x3CBB, opcode::OP_Invalid }, + { 0x3CBC, opcode::OP_GetAnim }, + { 0x3CBD, opcode::OP_Switch }, + { 0x3CBE, opcode::OP_Invalid }, + { 0x3CBF, opcode::OP_GetSelf }, + { 0x3CC0, opcode::OP_ShiftRight }, + { 0x3CC1, opcode::OP_CastFieldObject }, + { 0x3CC2, opcode::OP_Multiply }, + { 0x3CC3, opcode::OP_WaitTillMatch }, + { 0x3CC4, opcode::OP_Invalid }, + { 0x3CC5, opcode::OP_Invalid }, + { 0x3CC6, opcode::OP_Return }, + { 0x3CC7, opcode::OP_Invalid }, + { 0x3CC8, opcode::OP_Multiply }, + { 0x3CC9, opcode::OP_GetUndefined }, + { 0x3CCA, opcode::OP_Modulus }, + { 0x3CCB, opcode::OP_BoolComplement }, + { 0x3CCC, opcode::OP_GetAPIFunction }, + { 0x3CCD, opcode::OP_SafeSetVariableFieldCached }, + { 0x3CCE, opcode::OP_Invalid }, + { 0x3CCF, opcode::OP_GetFloat }, + { 0x3CD0, opcode::OP_GetLevel }, + { 0x3CD1, opcode::OP_EvalLocalVariableRefCached }, + { 0x3CD2, opcode::OP_Invalid }, + { 0x3CD3, opcode::OP_ScriptMethodCallPointer }, + { 0x3CD4, opcode::OP_CastFieldObject }, + { 0x3CD5, opcode::OP_GetWorldObject }, + { 0x3CD6, opcode::OP_Invalid }, + { 0x3CD7, opcode::OP_Invalid }, + { 0x3CD8, opcode::OP_GetAnim }, + { 0x3CD9, opcode::OP_Invalid }, + { 0x3CDA, opcode::OP_Invalid }, + { 0x3CDB, opcode::OP_GreaterThan }, + { 0x3CDC, opcode::OP_GetFunction }, + { 0x3CDD, opcode::OP_Invalid }, + { 0x3CDE, opcode::OP_GetFloat }, + { 0x3CDF, opcode::OP_Invalid }, + { 0x3CE0, opcode::OP_Invalid }, + { 0x3CE1, opcode::OP_ScriptThreadCallClass }, + { 0x3CE2, opcode::OP_EvalLocalVariableRefCached }, + { 0x3CE3, opcode::OP_Invalid }, + { 0x3CE4, opcode::OP_ScriptFunctionCall }, + { 0x3CE5, opcode::OP_GetZero }, + { 0x3CE6, opcode::OP_Invalid }, + { 0x3CE7, opcode::OP_GetSelf }, + { 0x3CE8, opcode::OP_FirstArrayKey }, + { 0x3CE9, opcode::OP_EvalArray }, + { 0x3CEA, opcode::OP_Invalid }, + { 0x3CEB, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x3CEC, opcode::OP_Switch }, + { 0x3CED, opcode::OP_JumpOnFalse }, + { 0x3CEE, opcode::OP_Invalid }, + { 0x3CEF, opcode::OP_Invalid }, + { 0x3CF0, opcode::OP_GetNegUnsignedShort }, + { 0x3CF1, opcode::OP_Invalid }, + { 0x3CF2, opcode::OP_Invalid }, + { 0x3CF3, opcode::OP_WaitTill }, + { 0x3CF4, opcode::OP_Invalid }, + { 0x3CF5, opcode::OP_GetUndefined }, + { 0x3CF6, opcode::OP_RealWait }, + { 0x3CF7, opcode::OP_JumpOnFalseExpr }, + { 0x3CF8, opcode::OP_Invalid }, + { 0x3CF9, opcode::OP_GetSelfObject }, + { 0x3CFA, opcode::OP_ScriptThreadCallClass }, + { 0x3CFB, opcode::OP_Invalid }, + { 0x3CFC, opcode::OP_Invalid }, + { 0x3CFD, opcode::OP_Invalid }, + { 0x3CFE, opcode::OP_ScriptFunctionCall }, + { 0x3CFF, opcode::OP_JumpOnFalse }, + { 0x3D00, opcode::OP_GetWorld }, + { 0x3D01, opcode::OP_Plus }, + { 0x3D02, opcode::OP_Invalid }, + { 0x3D03, opcode::OP_SelfEvalFieldVariableRef }, + { 0x3D04, opcode::OP_ScriptThreadCallClass }, + { 0x3D05, opcode::OP_GetIString }, + { 0x3D06, opcode::OP_JumpOnTrueExpr }, + { 0x3D07, opcode::OP_GetClassesObject }, + { 0x3D08, opcode::OP_Minus }, + { 0x3D09, opcode::OP_Invalid }, + { 0x3D0A, opcode::OP_GetNegUnsignedShort }, + { 0x3D0B, opcode::OP_Invalid }, + { 0x3D0C, opcode::OP_Invalid }, + { 0x3D0D, opcode::OP_ClearArray }, + { 0x3D0E, opcode::OP_GetGame }, + { 0x3D0F, opcode::OP_GreaterThanOrEqualTo }, + { 0x3D10, opcode::OP_EvalArray }, + { 0x3D11, opcode::OP_BoolComplement }, + { 0x3D12, opcode::OP_Bit_Xor }, + { 0x3D13, opcode::OP_WaitTill }, + { 0x3D14, opcode::OP_Invalid }, + { 0x3D15, opcode::OP_ProfileStart }, + { 0x3D16, opcode::OP_EvalFieldVariableRef }, + { 0x3D17, opcode::OP_Invalid }, + { 0x3D18, opcode::OP_BoolNot }, + { 0x3D19, opcode::OP_GetHash }, + { 0x3D1A, opcode::OP_Invalid }, + { 0x3D1B, opcode::OP_GetLevelObject }, + { 0x3D1C, opcode::OP_ProfileStart }, + { 0x3D1D, opcode::OP_Invalid }, + { 0x3D1E, opcode::OP_GetNegUnsignedShort }, + { 0x3D1F, opcode::OP_FirstArrayKey }, + { 0x3D20, opcode::OP_Invalid }, + { 0x3D21, opcode::OP_RealWait }, + { 0x3D22, opcode::OP_Invalid }, + { 0x3D23, opcode::OP_GetFloat }, + { 0x3D24, opcode::OP_SetVariableField }, + { 0x3D25, opcode::OP_Invalid }, + { 0x3D26, opcode::OP_JumpOnTrue }, + { 0x3D27, opcode::OP_Invalid }, + { 0x3D28, opcode::OP_Invalid }, + { 0x3D29, opcode::OP_Wait }, + { 0x3D2A, opcode::OP_EvalArray }, + { 0x3D2B, opcode::OP_GetClassesObject }, + { 0x3D2C, opcode::OP_WaitTillMatch }, + { 0x3D2D, opcode::OP_New }, + { 0x3D2E, opcode::OP_Invalid }, + { 0x3D2F, opcode::OP_EvalArray }, + { 0x3D30, opcode::OP_NotEqual }, + { 0x3D31, opcode::OP_Invalid }, + { 0x3D32, opcode::OP_NotEqual }, + { 0x3D33, opcode::OP_Invalid }, + { 0x3D34, opcode::OP_Invalid }, + { 0x3D35, opcode::OP_Invalid }, + { 0x3D36, opcode::OP_GetUintptr }, + { 0x3D37, opcode::OP_ClearArray }, + { 0x3D38, opcode::OP_Invalid }, + { 0x3D39, opcode::OP_LessThan }, + { 0x3D3A, opcode::OP_Invalid }, + { 0x3D3B, opcode::OP_Invalid }, + { 0x3D3C, opcode::OP_GreaterThan }, + { 0x3D3D, opcode::OP_GetString }, + { 0x3D3E, opcode::OP_BoolComplement }, + { 0x3D3F, opcode::OP_DevblockBegin }, + { 0x3D40, opcode::OP_GetSelfObject }, + { 0x3D41, opcode::OP_Return }, + { 0x3D42, opcode::OP_ScriptThreadCallClass }, + { 0x3D43, opcode::OP_Plus }, + { 0x3D44, opcode::OP_GetLevel }, + { 0x3D45, opcode::OP_Invalid }, + { 0x3D46, opcode::OP_Invalid }, + { 0x3D47, opcode::OP_Invalid }, + { 0x3D48, opcode::OP_Invalid }, + { 0x3D49, opcode::OP_Invalid }, + { 0x3D4A, opcode::OP_GetFloat }, + { 0x3D4B, opcode::OP_ShiftRight }, + { 0x3D4C, opcode::OP_Bit_Xor }, + { 0x3D4D, opcode::OP_GetHash }, + { 0x3D4E, opcode::OP_SafeDecTop }, + { 0x3D4F, opcode::OP_Invalid }, + { 0x3D50, opcode::OP_LevelEvalFieldVariableRef }, + { 0x3D51, opcode::OP_SizeOf }, + { 0x3D52, opcode::OP_Switch }, + { 0x3D53, opcode::OP_ShiftLeft }, + { 0x3D54, opcode::OP_Dec }, + { 0x3D55, opcode::OP_EvalLocalVariableCached }, + { 0x3D56, opcode::OP_Invalid }, + { 0x3D57, opcode::OP_Invalid }, + { 0x3D58, opcode::OP_EvalLocalVariableRefCached }, + { 0x3D59, opcode::OP_DevblockBegin }, + { 0x3D5A, opcode::OP_Inc }, + { 0x3D5B, opcode::OP_GetSelfObject }, + { 0x3D5C, opcode::OP_Invalid }, + { 0x3D5D, opcode::OP_Invalid }, + { 0x3D5E, opcode::OP_LevelEvalFieldVariable }, + { 0x3D5F, opcode::OP_GetZero }, + { 0x3D60, opcode::OP_New }, + { 0x3D61, opcode::OP_SelfEvalFieldVariable }, + { 0x3D62, opcode::OP_GetWorldObject }, + { 0x3D63, opcode::OP_Invalid }, + { 0x3D64, opcode::OP_Invalid }, + { 0x3D65, opcode::OP_GetGameRef }, + { 0x3D66, opcode::OP_SizeOf }, + { 0x3D67, opcode::OP_GetUndefined }, + { 0x3D68, opcode::OP_Invalid }, + { 0x3D69, opcode::OP_Invalid }, + { 0x3D6A, opcode::OP_Invalid }, + { 0x3D6B, opcode::OP_Minus }, + { 0x3D6C, opcode::OP_GetAnimation }, + { 0x3D6D, opcode::OP_GetSelfObject }, + { 0x3D6E, opcode::OP_Invalid }, + { 0x3D6F, opcode::OP_Invalid }, + { 0x3D70, opcode::OP_ScriptMethodThreadCall }, + { 0x3D71, opcode::OP_SafeSetVariableFieldCached }, + { 0x3D72, opcode::OP_Invalid }, + { 0x3D73, opcode::OP_Invalid }, + { 0x3D74, opcode::OP_JumpOnFalseExpr }, + { 0x3D75, opcode::OP_Invalid }, + { 0x3D76, opcode::OP_Invalid }, + { 0x3D77, opcode::OP_ScriptMethodThreadCall }, + { 0x3D78, opcode::OP_Invalid }, + { 0x3D79, opcode::OP_Invalid }, + { 0x3D7A, opcode::OP_LessThan }, + { 0x3D7B, opcode::OP_GetLevelObject }, + { 0x3D7C, opcode::OP_ClearFieldVariable }, + { 0x3D7D, opcode::OP_Invalid }, + { 0x3D7E, opcode::OP_Invalid }, + { 0x3D7F, opcode::OP_Invalid }, + { 0x3D80, opcode::OP_GetClasses }, + { 0x3D81, opcode::OP_Wait }, + { 0x3D82, opcode::OP_JumpOnTrue }, + { 0x3D83, opcode::OP_DecTop }, + { 0x3D84, opcode::OP_GetUndefined }, + { 0x3D85, opcode::OP_Dec }, + { 0x3D86, opcode::OP_Invalid }, + { 0x3D87, opcode::OP_GetWorldObject }, + { 0x3D88, opcode::OP_SafeSetWaittillVariableFieldCached }, + { 0x3D89, opcode::OP_SafeSetVariableFieldCached }, + { 0x3D8A, opcode::OP_Invalid }, + { 0x3D8B, opcode::OP_WaitTillFrameEnd }, + { 0x3D8C, opcode::OP_DevblockBegin }, + { 0x3D8D, opcode::OP_SuperEqual }, + { 0x3D8E, opcode::OP_ScriptFunctionCallPointer }, + { 0x3D8F, opcode::OP_CastFieldObject }, + { 0x3D90, opcode::OP_SuperEqual }, + { 0x3D91, opcode::OP_GetVector }, + { 0x3D92, opcode::OP_SizeOf }, + { 0x3D93, opcode::OP_Invalid }, + { 0x3D94, opcode::OP_GetString }, + { 0x3D95, opcode::OP_Invalid }, + { 0x3D96, opcode::OP_Invalid }, + { 0x3D97, opcode::OP_Wait }, + { 0x3D98, opcode::OP_Invalid }, + { 0x3D99, opcode::OP_EvalFieldVariable }, + { 0x3D9A, opcode::OP_Invalid }, + { 0x3D9B, opcode::OP_Plus }, + { 0x3D9C, opcode::OP_Invalid }, + { 0x3D9D, opcode::OP_BoolComplement }, + { 0x3D9E, opcode::OP_GetZero }, + { 0x3D9F, opcode::OP_Invalid }, + { 0x3DA0, opcode::OP_EndSwitch }, + { 0x3DA1, opcode::OP_GetClasses }, + { 0x3DA2, opcode::OP_Invalid }, + { 0x3DA3, opcode::OP_Invalid }, + { 0x3DA4, opcode::OP_Invalid }, + { 0x3DA5, opcode::OP_SafeDecTop }, + { 0x3DA6, opcode::OP_DevblockBegin }, + { 0x3DA7, opcode::OP_GetString }, + { 0x3DA8, opcode::OP_Invalid }, + { 0x3DA9, opcode::OP_JumpOnTrue }, + { 0x3DAA, opcode::OP_GetTime }, + { 0x3DAB, opcode::OP_Switch }, + { 0x3DAC, opcode::OP_ScriptThreadCallClass }, + { 0x3DAD, opcode::OP_Invalid }, + { 0x3DAE, opcode::OP_SafeDecTop }, + { 0x3DAF, opcode::OP_Invalid }, + { 0x3DB0, opcode::OP_Plus }, + { 0x3DB1, opcode::OP_GetVector }, + { 0x3DB2, opcode::OP_GetAnim }, + { 0x3DB3, opcode::OP_ShiftRight }, + { 0x3DB4, opcode::OP_GetAnimObject }, + { 0x3DB5, opcode::OP_EvalFieldVariableRef }, + { 0x3DB6, opcode::OP_WaitTill }, + { 0x3DB7, opcode::OP_Invalid }, + { 0x3DB8, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x3DB9, opcode::OP_Invalid }, + { 0x3DBA, opcode::OP_SafeSetVariableFieldCached }, + { 0x3DBB, opcode::OP_Invalid }, + { 0x3DBC, opcode::OP_EndOn }, + { 0x3DBD, opcode::OP_GetGame }, + { 0x3DBE, opcode::OP_Invalid }, + { 0x3DBF, opcode::OP_Invalid }, + { 0x3DC0, opcode::OP_Invalid }, + { 0x3DC1, opcode::OP_EvalLocalVariableRefCached }, + { 0x3DC2, opcode::OP_SafeDecTop }, + { 0x3DC3, opcode::OP_Invalid }, + { 0x3DC4, opcode::OP_GetString }, + { 0x3DC5, opcode::OP_GetClassesObject }, + { 0x3DC6, opcode::OP_GetLevelObject }, + { 0x3DC7, opcode::OP_Invalid }, + { 0x3DC8, opcode::OP_ScriptMethodThreadCall }, + { 0x3DC9, opcode::OP_FirstArrayKey }, + { 0x3DCA, opcode::OP_Invalid }, + { 0x3DCB, opcode::OP_Invalid }, + { 0x3DCC, opcode::OP_Invalid }, + { 0x3DCD, opcode::OP_Invalid }, + { 0x3DCE, opcode::OP_Invalid }, + { 0x3DCF, opcode::OP_EvalLocalVariableCached }, + { 0x3DD0, opcode::OP_SelfEvalFieldVariable }, + { 0x3DD1, opcode::OP_SetVariableField }, + { 0x3DD2, opcode::OP_Invalid }, + { 0x3DD3, opcode::OP_EvalArray }, + { 0x3DD4, opcode::OP_EndOn }, + { 0x3DD5, opcode::OP_GetClassesObject }, + { 0x3DD6, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x3DD7, opcode::OP_Invalid }, + { 0x3DD8, opcode::OP_GetUintptr }, + { 0x3DD9, opcode::OP_GetAnim }, + { 0x3DDA, opcode::OP_EvalFieldVariable }, + { 0x3DDB, opcode::OP_ProfileStart }, + { 0x3DDC, opcode::OP_ClearFieldVariable }, + { 0x3DDD, opcode::OP_LevelEvalFieldVariable }, + { 0x3DDE, opcode::OP_DevblockBegin }, + { 0x3DDF, opcode::OP_GetLevel }, + { 0x3DE0, opcode::OP_GetUintptr }, + { 0x3DE1, opcode::OP_Invalid }, + { 0x3DE2, opcode::OP_SafeSetVariableFieldCached }, + { 0x3DE3, opcode::OP_Invalid }, + { 0x3DE4, opcode::OP_LevelEvalFieldVariable }, + { 0x3DE5, opcode::OP_ShiftRight }, + { 0x3DE6, opcode::OP_SelfEvalFieldVariableRef }, + { 0x3DE7, opcode::OP_WaitTillMatch }, + { 0x3DE8, opcode::OP_GetAPIFunction }, + { 0x3DE9, opcode::OP_JumpOnFalseExpr }, + { 0x3DEA, opcode::OP_Invalid }, + { 0x3DEB, opcode::OP_Notify }, + { 0x3DEC, opcode::OP_SetVariableField }, + { 0x3DED, opcode::OP_Invalid }, + { 0x3DEE, opcode::OP_Wait }, + { 0x3DEF, opcode::OP_LevelEvalFieldVariable }, + { 0x3DF0, opcode::OP_Invalid }, + { 0x3DF1, opcode::OP_WaitTillFrameEnd }, + { 0x3DF2, opcode::OP_GreaterThanOrEqualTo }, + { 0x3DF3, opcode::OP_NotEqual }, + { 0x3DF4, opcode::OP_Invalid }, + { 0x3DF5, opcode::OP_GetUndefined }, + { 0x3DF6, opcode::OP_GetGameRef }, + { 0x3DF7, opcode::OP_SelfEvalFieldVariable }, + { 0x3DF8, opcode::OP_JumpOnTrueExpr }, + { 0x3DF9, opcode::OP_Jump }, + { 0x3DFA, opcode::OP_Invalid }, + { 0x3DFB, opcode::OP_Divide }, + { 0x3DFC, opcode::OP_EvalLocalVariableRefCached }, + { 0x3DFD, opcode::OP_JumpOnTrueExpr }, + { 0x3DFE, opcode::OP_EvalFieldVariableRef }, + { 0x3DFF, opcode::OP_Wait }, + { 0x3E00, opcode::OP_Invalid }, + { 0x3E01, opcode::OP_WaitTillFrameEnd }, + { 0x3E02, opcode::OP_Invalid }, + { 0x3E03, opcode::OP_Jump }, + { 0x3E04, opcode::OP_GetHash }, + { 0x3E05, opcode::OP_Invalid }, + { 0x3E06, opcode::OP_Dec }, + { 0x3E07, opcode::OP_DevblockBegin }, + { 0x3E08, opcode::OP_GetWorldObject }, + { 0x3E09, opcode::OP_GetUndefined }, + { 0x3E0A, opcode::OP_Inc }, + { 0x3E0B, opcode::OP_Invalid }, + { 0x3E0C, opcode::OP_Invalid }, + { 0x3E0D, opcode::OP_Invalid }, + { 0x3E0E, opcode::OP_Invalid }, + { 0x3E0F, opcode::OP_Invalid }, + { 0x3E10, opcode::OP_Invalid }, + { 0x3E11, opcode::OP_SafeSetVariableFieldCached }, + { 0x3E12, opcode::OP_VectorScale }, + { 0x3E13, opcode::OP_Notify }, + { 0x3E14, opcode::OP_GetGameRef }, + { 0x3E15, opcode::OP_ScriptThreadCallClass }, + { 0x3E16, opcode::OP_Invalid }, + { 0x3E17, opcode::OP_JumpOnTrue }, + { 0x3E18, opcode::OP_SuperEqual }, + { 0x3E19, opcode::OP_GetAnim }, + { 0x3E1A, opcode::OP_Invalid }, + { 0x3E1B, opcode::OP_Invalid }, + { 0x3E1C, opcode::OP_ClearArray }, + { 0x3E1D, opcode::OP_Invalid }, + { 0x3E1E, opcode::OP_Invalid }, + { 0x3E1F, opcode::OP_Invalid }, + { 0x3E20, opcode::OP_SuperEqual }, + { 0x3E21, opcode::OP_Invalid }, + { 0x3E22, opcode::OP_GetByte }, + { 0x3E23, opcode::OP_GetWorld }, + { 0x3E24, opcode::OP_Modulus }, + { 0x3E25, opcode::OP_Invalid }, + { 0x3E26, opcode::OP_Invalid }, + { 0x3E27, opcode::OP_GreaterThanOrEqualTo }, + { 0x3E28, opcode::OP_DecTop }, + { 0x3E29, opcode::OP_GetSelf }, + { 0x3E2A, opcode::OP_Invalid }, + { 0x3E2B, opcode::OP_Multiply }, + { 0x3E2C, opcode::OP_Minus }, + { 0x3E2D, opcode::OP_Invalid }, + { 0x3E2E, opcode::OP_SafeDecTop }, + { 0x3E2F, opcode::OP_Invalid }, + { 0x3E30, opcode::OP_Invalid }, + { 0x3E31, opcode::OP_Invalid }, + { 0x3E32, opcode::OP_GetFloat }, + { 0x3E33, opcode::OP_Divide }, + { 0x3E34, opcode::OP_BoolComplement }, + { 0x3E35, opcode::OP_Invalid }, + { 0x3E36, opcode::OP_IsDefined }, + { 0x3E37, opcode::OP_Bit_And }, + { 0x3E38, opcode::OP_DecTop }, + { 0x3E39, opcode::OP_EvalArray }, + { 0x3E3A, opcode::OP_GetSelf }, + { 0x3E3B, opcode::OP_WaitTillFrameEnd }, + { 0x3E3C, opcode::OP_Invalid }, + { 0x3E3D, opcode::OP_ScriptMethodCall }, + { 0x3E3E, opcode::OP_Invalid }, + { 0x3E3F, opcode::OP_EvalFieldVariable }, + { 0x3E40, opcode::OP_Invalid }, + { 0x3E41, opcode::OP_Invalid }, + { 0x3E42, opcode::OP_Invalid }, + { 0x3E43, opcode::OP_ScriptMethodCall }, + { 0x3E44, opcode::OP_ScriptFunctionCallClass }, + { 0x3E45, opcode::OP_GetUnsignedShort }, + { 0x3E46, opcode::OP_Invalid }, + { 0x3E47, opcode::OP_ProfileStart }, + { 0x3E48, opcode::OP_Invalid }, + { 0x3E49, opcode::OP_GetByte }, + { 0x3E4A, opcode::OP_Invalid }, + { 0x3E4B, opcode::OP_Invalid }, + { 0x3E4C, opcode::OP_Invalid }, + { 0x3E4D, opcode::OP_WaitTillFrameEnd }, + { 0x3E4E, opcode::OP_EvalFieldVariableRef }, + { 0x3E4F, opcode::OP_RealWait }, + { 0x3E50, opcode::OP_Invalid }, + { 0x3E51, opcode::OP_Invalid }, + { 0x3E52, opcode::OP_BoolNot }, + { 0x3E53, opcode::OP_WaitTill }, + { 0x3E54, opcode::OP_Plus }, + { 0x3E55, opcode::OP_Invalid }, + { 0x3E56, opcode::OP_Invalid }, + { 0x3E57, opcode::OP_Plus }, + { 0x3E58, opcode::OP_Invalid }, + { 0x3E59, opcode::OP_Invalid }, + { 0x3E5A, opcode::OP_Invalid }, + { 0x3E5B, opcode::OP_NextArrayKey }, + { 0x3E5C, opcode::OP_EvalFieldVariableRef }, + { 0x3E5D, opcode::OP_GetByte }, + { 0x3E5E, opcode::OP_Jump }, + { 0x3E5F, opcode::OP_ClearArray }, + { 0x3E60, opcode::OP_Invalid }, + { 0x3E61, opcode::OP_ClearFieldVariable }, + { 0x3E62, opcode::OP_Invalid }, + { 0x3E63, opcode::OP_Invalid }, + { 0x3E64, opcode::OP_New }, + { 0x3E65, opcode::OP_JumpOnFalseExpr }, + { 0x3E66, opcode::OP_Invalid }, + { 0x3E67, opcode::OP_Invalid }, + { 0x3E68, opcode::OP_Invalid }, + { 0x3E69, opcode::OP_ScriptThreadCallPointer }, + { 0x3E6A, opcode::OP_GetLevelObject }, + { 0x3E6B, opcode::OP_SizeOf }, + { 0x3E6C, opcode::OP_Invalid }, + { 0x3E6D, opcode::OP_Invalid }, + { 0x3E6E, opcode::OP_Invalid }, + { 0x3E6F, opcode::OP_GetString }, + { 0x3E70, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x3E71, opcode::OP_Invalid }, + { 0x3E72, opcode::OP_Invalid }, + { 0x3E73, opcode::OP_Multiply }, + { 0x3E74, opcode::OP_Invalid }, + { 0x3E75, opcode::OP_SetVariableField }, + { 0x3E76, opcode::OP_JumpOnTrueExpr }, + { 0x3E77, opcode::OP_Invalid }, + { 0x3E78, opcode::OP_Invalid }, + { 0x3E79, opcode::OP_VectorScale }, + { 0x3E7A, opcode::OP_Invalid }, + { 0x3E7B, opcode::OP_GetSelfObject }, + { 0x3E7C, opcode::OP_ScriptThreadCallPointer }, + { 0x3E7D, opcode::OP_Invalid }, + { 0x3E7E, opcode::OP_SafeCreateLocalVariables }, + { 0x3E7F, opcode::OP_Invalid }, + { 0x3E80, opcode::OP_Invalid }, + { 0x3E81, opcode::OP_ScriptMethodCall }, + { 0x3E82, opcode::OP_Invalid }, + { 0x3E83, opcode::OP_FirstArrayKey }, + { 0x3E84, opcode::OP_ScriptMethodThreadCall }, + { 0x3E85, opcode::OP_Invalid }, + { 0x3E86, opcode::OP_ScriptMethodThreadCall }, + { 0x3E87, opcode::OP_SizeOf }, + { 0x3E88, opcode::OP_JumpOnTrueExpr }, + { 0x3E89, opcode::OP_GetTime }, + { 0x3E8A, opcode::OP_Switch }, + { 0x3E8B, opcode::OP_EmptyArray }, + { 0x3E8C, opcode::OP_CastFieldObject }, + { 0x3E8D, opcode::OP_GetFloat }, + { 0x3E8E, opcode::OP_WaitTillFrameEnd }, + { 0x3E8F, opcode::OP_Invalid }, + { 0x3E90, opcode::OP_Invalid }, + { 0x3E91, opcode::OP_GetHash }, + { 0x3E92, opcode::OP_Invalid }, + { 0x3E93, opcode::OP_Inc }, + { 0x3E94, opcode::OP_Invalid }, + { 0x3E95, opcode::OP_Invalid }, + { 0x3E96, opcode::OP_GreaterThan }, + { 0x3E97, opcode::OP_EmptyArray }, + { 0x3E98, opcode::OP_EndSwitch }, + { 0x3E99, opcode::OP_GetSelfObject }, + { 0x3E9A, opcode::OP_Multiply }, + { 0x3E9B, opcode::OP_Invalid }, + { 0x3E9C, opcode::OP_NextArrayKey }, + { 0x3E9D, opcode::OP_GetUintptr }, + { 0x3E9E, opcode::OP_Invalid }, + { 0x3E9F, opcode::OP_Invalid }, + { 0x3EA0, opcode::OP_NotEqual }, + { 0x3EA1, opcode::OP_Jump }, + { 0x3EA2, opcode::OP_GetWorld }, + { 0x3EA3, opcode::OP_JumpOnFalseExpr }, + { 0x3EA4, opcode::OP_RealWait }, + { 0x3EA5, opcode::OP_JumpOnFalse }, + { 0x3EA6, opcode::OP_Invalid }, + { 0x3EA7, opcode::OP_BoolNot }, + { 0x3EA8, opcode::OP_Invalid }, + { 0x3EA9, opcode::OP_Multiply }, + { 0x3EAA, opcode::OP_Plus }, + { 0x3EAB, opcode::OP_EndOn }, + { 0x3EAC, opcode::OP_EvalFieldVariable }, + { 0x3EAD, opcode::OP_JumpOnFalse }, + { 0x3EAE, opcode::OP_CallBuiltinMethod }, + { 0x3EAF, opcode::OP_Invalid }, + { 0x3EB0, opcode::OP_Invalid }, + { 0x3EB1, opcode::OP_Invalid }, + { 0x3EB2, opcode::OP_SuperEqual }, + { 0x3EB3, opcode::OP_Minus }, + { 0x3EB4, opcode::OP_Invalid }, + { 0x3EB5, opcode::OP_EvalLocalVariableRefCached }, + { 0x3EB6, opcode::OP_Equal }, + { 0x3EB7, opcode::OP_GetHash }, + { 0x3EB8, opcode::OP_EvalArray }, + { 0x3EB9, opcode::OP_EvalLocalVariableCached }, + { 0x3EBA, opcode::OP_Invalid }, + { 0x3EBB, opcode::OP_GetUintptr }, + { 0x3EBC, opcode::OP_SafeCreateLocalVariables }, + { 0x3EBD, opcode::OP_Invalid }, + { 0x3EBE, opcode::OP_Invalid }, + { 0x3EBF, opcode::OP_BoolNot }, + { 0x3EC0, opcode::OP_Invalid }, + { 0x3EC1, opcode::OP_Dec }, + { 0x3EC2, opcode::OP_RealWait }, + { 0x3EC3, opcode::OP_SafeDecTop }, + { 0x3EC4, opcode::OP_ProfileStart }, + { 0x3EC5, opcode::OP_SafeSetVariableFieldCached }, + { 0x3EC6, opcode::OP_GetByte }, + { 0x3EC7, opcode::OP_SafeDecTop }, + { 0x3EC8, opcode::OP_Invalid }, + { 0x3EC9, opcode::OP_Invalid }, + { 0x3ECA, opcode::OP_GetInteger }, + { 0x3ECB, opcode::OP_Invalid }, + { 0x3ECC, opcode::OP_Invalid }, + { 0x3ECD, opcode::OP_ScriptThreadCallPointer }, + { 0x3ECE, opcode::OP_WaitTill }, + { 0x3ECF, opcode::OP_EvalLocalVariableCached }, + { 0x3ED0, opcode::OP_Invalid }, + { 0x3ED1, opcode::OP_Multiply }, + { 0x3ED2, opcode::OP_BoolComplement }, + { 0x3ED3, opcode::OP_EvalArray }, + { 0x3ED4, opcode::OP_LevelEvalFieldVariable }, + { 0x3ED5, opcode::OP_Invalid }, + { 0x3ED6, opcode::OP_CastBool }, + { 0x3ED7, opcode::OP_Invalid }, + { 0x3ED8, opcode::OP_Invalid }, + { 0x3ED9, opcode::OP_GetString }, + { 0x3EDA, opcode::OP_Invalid }, + { 0x3EDB, opcode::OP_ProfileStop }, + { 0x3EDC, opcode::OP_Invalid }, + { 0x3EDD, opcode::OP_SuperEqual }, + { 0x3EDE, opcode::OP_WaitTillFrameEnd }, + { 0x3EDF, opcode::OP_EvalLocalVariableRefCached }, + { 0x3EE0, opcode::OP_SizeOf }, + { 0x3EE1, opcode::OP_Inc }, + { 0x3EE2, opcode::OP_Invalid }, + { 0x3EE3, opcode::OP_Invalid }, + { 0x3EE4, opcode::OP_Invalid }, + { 0x3EE5, opcode::OP_Invalid }, + { 0x3EE6, opcode::OP_GetGameRef }, + { 0x3EE7, opcode::OP_Jump }, + { 0x3EE8, opcode::OP_Switch }, + { 0x3EE9, opcode::OP_DevblockBegin }, + { 0x3EEA, opcode::OP_GetNegByte }, + { 0x3EEB, opcode::OP_Invalid }, + { 0x3EEC, opcode::OP_GetClasses }, + { 0x3EED, opcode::OP_EmptyArray }, + { 0x3EEE, opcode::OP_Invalid }, + { 0x3EEF, opcode::OP_SuperNotEqual }, + { 0x3EF0, opcode::OP_ShiftRight }, + { 0x3EF1, opcode::OP_ScriptFunctionCallClass }, + { 0x3EF2, opcode::OP_VectorConstant }, + { 0x3EF3, opcode::OP_Invalid }, + { 0x3EF4, opcode::OP_ShiftLeft }, + { 0x3EF5, opcode::OP_LevelEvalFieldVariable }, + { 0x3EF6, opcode::OP_SizeOf }, + { 0x3EF7, opcode::OP_Invalid }, + { 0x3EF8, opcode::OP_Invalid }, + { 0x3EF9, opcode::OP_EndSwitch }, + { 0x3EFA, opcode::OP_Invalid }, + { 0x3EFB, opcode::OP_BoolNot }, + { 0x3EFC, opcode::OP_GetClasses }, + { 0x3EFD, opcode::OP_GetGame }, + { 0x3EFE, opcode::OP_Invalid }, + { 0x3EFF, opcode::OP_Invalid }, + { 0x3F00, opcode::OP_Invalid }, + { 0x3F01, opcode::OP_Invalid }, + { 0x3F02, opcode::OP_SelfEvalFieldVariable }, + { 0x3F03, opcode::OP_ScriptThreadCall }, + { 0x3F04, opcode::OP_Invalid }, + { 0x3F05, opcode::OP_Invalid }, + { 0x3F06, opcode::OP_GetFunction }, + { 0x3F07, opcode::OP_ScriptFunctionCallPointer }, + { 0x3F08, opcode::OP_Invalid }, + { 0x3F09, opcode::OP_Invalid }, + { 0x3F0A, opcode::OP_SuperNotEqual }, + { 0x3F0B, opcode::OP_GetNegUnsignedShort }, + { 0x3F0C, opcode::OP_JumpOnFalse }, + { 0x3F0D, opcode::OP_EvalFieldVariable }, + { 0x3F0E, opcode::OP_Bit_Xor }, + { 0x3F0F, opcode::OP_CastBool }, + { 0x3F10, opcode::OP_ClearArray }, + { 0x3F11, opcode::OP_GetAnim }, + { 0x3F12, opcode::OP_Invalid }, + { 0x3F13, opcode::OP_GetUndefined }, + { 0x3F14, opcode::OP_Invalid }, + { 0x3F15, opcode::OP_GetWorldObject }, + { 0x3F16, opcode::OP_SelfEvalFieldVariableRef }, + { 0x3F17, opcode::OP_SelfEvalFieldVariableRef }, + { 0x3F18, opcode::OP_ScriptMethodThreadCall }, + { 0x3F19, opcode::OP_Invalid }, + { 0x3F1A, opcode::OP_New }, + { 0x3F1B, opcode::OP_GetWorldObject }, + { 0x3F1C, opcode::OP_New }, + { 0x3F1D, opcode::OP_Invalid }, + { 0x3F1E, opcode::OP_Invalid }, + { 0x3F1F, opcode::OP_ClearArray }, + { 0x3F20, opcode::OP_Invalid }, + { 0x3F21, opcode::OP_GetGame }, + { 0x3F22, opcode::OP_Invalid }, + { 0x3F23, opcode::OP_ScriptMethodCallPointer }, + { 0x3F24, opcode::OP_GetSelfObject }, + { 0x3F25, opcode::OP_ClearFieldVariable }, + { 0x3F26, opcode::OP_Invalid }, + { 0x3F27, opcode::OP_GetLevel }, + { 0x3F28, opcode::OP_Return }, + { 0x3F29, opcode::OP_Invalid }, + { 0x3F2A, opcode::OP_Invalid }, + { 0x3F2B, opcode::OP_GetSelf }, + { 0x3F2C, opcode::OP_Invalid }, + { 0x3F2D, opcode::OP_New }, + { 0x3F2E, opcode::OP_DevblockBegin }, + { 0x3F2F, opcode::OP_GetSelfObject }, + { 0x3F30, opcode::OP_NextArrayKey }, + { 0x3F31, opcode::OP_Invalid }, + { 0x3F32, opcode::OP_WaitTillFrameEnd }, + { 0x3F33, opcode::OP_ScriptMethodCallPointer }, + { 0x3F34, opcode::OP_GetFunction }, + { 0x3F35, opcode::OP_GetAnimObject }, + { 0x3F36, opcode::OP_Invalid }, + { 0x3F37, opcode::OP_Invalid }, + { 0x3F38, opcode::OP_EvalLocalVariableRefCached }, + { 0x3F39, opcode::OP_Plus }, + { 0x3F3A, opcode::OP_Invalid }, + { 0x3F3B, opcode::OP_Invalid }, + { 0x3F3C, opcode::OP_Invalid }, + { 0x3F3D, opcode::OP_LevelEvalFieldVariableRef }, + { 0x3F3E, opcode::OP_Invalid }, + { 0x3F3F, opcode::OP_Switch }, + { 0x3F40, opcode::OP_WaitTillMatch }, + { 0x3F41, opcode::OP_RealWait }, + { 0x3F42, opcode::OP_Invalid }, + { 0x3F43, opcode::OP_EvalArrayRef }, + { 0x3F44, opcode::OP_GetZero }, + { 0x3F45, opcode::OP_Invalid }, + { 0x3F46, opcode::OP_Bit_And }, + { 0x3F47, opcode::OP_VectorConstant }, + { 0x3F48, opcode::OP_WaitTill }, + { 0x3F49, opcode::OP_Invalid }, + { 0x3F4A, opcode::OP_RealWait }, + { 0x3F4B, opcode::OP_Invalid }, + { 0x3F4C, opcode::OP_Wait }, + { 0x3F4D, opcode::OP_Invalid }, + { 0x3F4E, opcode::OP_ScriptMethodCallPointer }, + { 0x3F4F, opcode::OP_ClearFieldVariable }, + { 0x3F50, opcode::OP_LevelEvalFieldVariable }, + { 0x3F51, opcode::OP_Invalid }, + { 0x3F52, opcode::OP_Modulus }, + { 0x3F53, opcode::OP_Invalid }, + { 0x3F54, opcode::OP_EvalArrayRef }, + { 0x3F55, opcode::OP_NotEqual }, + { 0x3F56, opcode::OP_GetUnsignedShort }, + { 0x3F57, opcode::OP_Invalid }, + { 0x3F58, opcode::OP_Switch }, + { 0x3F59, opcode::OP_Invalid }, + { 0x3F5A, opcode::OP_ProfileStop }, + { 0x3F5B, opcode::OP_GetAnimObject }, + { 0x3F5C, opcode::OP_GetWorldObject }, + { 0x3F5D, opcode::OP_Invalid }, + { 0x3F5E, opcode::OP_EmptyArray }, + { 0x3F5F, opcode::OP_Invalid }, + { 0x3F60, opcode::OP_VectorScale }, + { 0x3F61, opcode::OP_JumpOnFalse }, + { 0x3F62, opcode::OP_Wait }, + { 0x3F63, opcode::OP_Invalid }, + { 0x3F64, opcode::OP_WaitTillMatch }, + { 0x3F65, opcode::OP_Invalid }, + { 0x3F66, opcode::OP_ShiftLeft }, + { 0x3F67, opcode::OP_ScriptMethodCallPointer }, + { 0x3F68, opcode::OP_Invalid }, + { 0x3F69, opcode::OP_WaitTillFrameEnd }, + { 0x3F6A, opcode::OP_Invalid }, + { 0x3F6B, opcode::OP_GetNegUnsignedShort }, + { 0x3F6C, opcode::OP_CallBuiltinMethod }, + { 0x3F6D, opcode::OP_Invalid }, + { 0x3F6E, opcode::OP_GetAnimObject }, + { 0x3F6F, opcode::OP_Invalid }, + { 0x3F70, opcode::OP_Invalid }, + { 0x3F71, opcode::OP_Return }, + { 0x3F72, opcode::OP_CastFieldObject }, + { 0x3F73, opcode::OP_ScriptFunctionCallPointer }, + { 0x3F74, opcode::OP_LevelEvalFieldVariable }, + { 0x3F75, opcode::OP_Invalid }, + { 0x3F76, opcode::OP_BoolComplement }, + { 0x3F77, opcode::OP_CastFieldObject }, + { 0x3F78, opcode::OP_GetSelf }, + { 0x3F79, opcode::OP_ClearArray }, + { 0x3F7A, opcode::OP_EndSwitch }, + { 0x3F7B, opcode::OP_GetIString }, + { 0x3F7C, opcode::OP_GreaterThanOrEqualTo }, + { 0x3F7D, opcode::OP_Modulus }, + { 0x3F7E, opcode::OP_Invalid }, + { 0x3F7F, opcode::OP_Inc }, + { 0x3F80, opcode::OP_SetVariableField }, + { 0x3F81, opcode::OP_Invalid }, + { 0x3F82, opcode::OP_GetUnsignedShort }, + { 0x3F83, opcode::OP_Invalid }, + { 0x3F84, opcode::OP_ShiftLeft }, + { 0x3F85, opcode::OP_EvalFieldVariableRef }, + { 0x3F86, opcode::OP_GetByte }, + { 0x3F87, opcode::OP_VectorConstant }, + { 0x3F88, opcode::OP_EmptyArray }, + { 0x3F89, opcode::OP_Invalid }, + { 0x3F8A, opcode::OP_GetWorld }, + { 0x3F8B, opcode::OP_Invalid }, + { 0x3F8C, opcode::OP_Invalid }, + { 0x3F8D, opcode::OP_JumpOnFalse }, + { 0x3F8E, opcode::OP_Invalid }, + { 0x3F8F, opcode::OP_WaitTill }, + { 0x3F90, opcode::OP_GetVector }, + { 0x3F91, opcode::OP_GetAnim }, + { 0x3F92, opcode::OP_ShiftLeft }, + { 0x3F93, opcode::OP_VectorScale }, + { 0x3F94, opcode::OP_SelfEvalFieldVariable }, + { 0x3F95, opcode::OP_Invalid }, + { 0x3F96, opcode::OP_WaitTill }, + { 0x3F97, opcode::OP_EndOn }, + { 0x3F98, opcode::OP_EvalLocalVariableRefCached }, + { 0x3F99, opcode::OP_ClearFieldVariable }, + { 0x3F9A, opcode::OP_Invalid }, + { 0x3F9B, opcode::OP_EvalLocalVariableRefCached }, + { 0x3F9C, opcode::OP_GetUnsignedShort }, + { 0x3F9D, opcode::OP_Invalid }, + { 0x3F9E, opcode::OP_Invalid }, + { 0x3F9F, opcode::OP_ShiftLeft }, + { 0x3FA0, opcode::OP_Invalid }, + { 0x3FA1, opcode::OP_NotEqual }, + { 0x3FA2, opcode::OP_EvalLocalVariableRefCached }, + { 0x3FA3, opcode::OP_Invalid }, + { 0x3FA4, opcode::OP_Invalid }, + { 0x3FA5, opcode::OP_LessThanOrEqualTo }, + { 0x3FA6, opcode::OP_GetVector }, + { 0x3FA7, opcode::OP_NextArrayKey }, + { 0x3FA8, opcode::OP_LessThan }, + { 0x3FA9, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x3FAA, opcode::OP_GetVector }, + { 0x3FAB, opcode::OP_Equal }, + { 0x3FAC, opcode::OP_GreaterThanOrEqualTo }, + { 0x3FAD, opcode::OP_Invalid }, + { 0x3FAE, opcode::OP_GetIString }, + { 0x3FAF, opcode::OP_Invalid }, + { 0x3FB0, opcode::OP_Bit_Xor }, + { 0x3FB1, opcode::OP_SelfEvalFieldVariable }, + { 0x3FB2, opcode::OP_EvalArrayRef }, + { 0x3FB3, opcode::OP_ScriptFunctionCallClass }, + { 0x3FB4, opcode::OP_Invalid }, + { 0x3FB5, opcode::OP_SafeDecTop }, + { 0x3FB6, opcode::OP_EvalArray }, + { 0x3FB7, opcode::OP_Invalid }, + { 0x3FB8, opcode::OP_Invalid }, + { 0x3FB9, opcode::OP_NextArrayKey }, + { 0x3FBA, opcode::OP_JumpOnTrue }, + { 0x3FBB, opcode::OP_BoolNot }, + { 0x3FBC, opcode::OP_Invalid }, + { 0x3FBD, opcode::OP_Invalid }, + { 0x3FBE, opcode::OP_Vector }, + { 0x3FBF, opcode::OP_Invalid }, + { 0x3FC0, opcode::OP_ShiftRight }, + { 0x3FC1, opcode::OP_Invalid }, + { 0x3FC2, opcode::OP_Bit_Xor }, + { 0x3FC3, opcode::OP_GetClasses }, + { 0x3FC4, opcode::OP_Invalid }, + { 0x3FC5, opcode::OP_EvalLocalVariableCached }, + { 0x3FC6, opcode::OP_SizeOf }, + { 0x3FC7, opcode::OP_EmptyArray }, + { 0x3FC8, opcode::OP_WaitTill }, + { 0x3FC9, opcode::OP_SelfEvalFieldVariableRef }, + { 0x3FCA, opcode::OP_GetAnimObject }, + { 0x3FCB, opcode::OP_FirstArrayKey }, + { 0x3FCC, opcode::OP_Switch }, + { 0x3FCD, opcode::OP_ScriptMethodThreadCallPointer }, + { 0x3FCE, opcode::OP_ShiftLeft }, + { 0x3FCF, opcode::OP_Invalid }, + { 0x3FD0, opcode::OP_GetNegUnsignedShort }, + { 0x3FD1, opcode::OP_Invalid }, + { 0x3FD2, opcode::OP_Invalid }, + { 0x3FD3, opcode::OP_CastBool }, + { 0x3FD4, opcode::OP_GetUintptr }, + { 0x3FD5, opcode::OP_ScriptMethodThreadCall }, + { 0x3FD6, opcode::OP_GetIString }, + { 0x3FD7, opcode::OP_GetLevel }, + { 0x3FD8, opcode::OP_FirstArrayKey }, + { 0x3FD9, opcode::OP_Modulus }, + { 0x3FDA, opcode::OP_GetSelfObject }, + { 0x3FDB, opcode::OP_Invalid }, + { 0x3FDC, opcode::OP_NotEqual }, + { 0x3FDD, opcode::OP_GetByte }, + { 0x3FDE, opcode::OP_Invalid }, + { 0x3FDF, opcode::OP_ShiftRight }, + { 0x3FE0, opcode::OP_Invalid }, + { 0x3FE1, opcode::OP_GetWorldObject }, + { 0x3FE2, opcode::OP_Invalid }, + { 0x3FE3, opcode::OP_Invalid }, + { 0x3FE4, opcode::OP_ScriptThreadCallClass }, + { 0x3FE5, opcode::OP_ProfileStart }, + { 0x3FE6, opcode::OP_GreaterThan }, + { 0x3FE7, opcode::OP_JumpOnFalseExpr }, + { 0x3FE8, opcode::OP_Invalid }, + { 0x3FE9, opcode::OP_GetAnim }, + { 0x3FEA, opcode::OP_Invalid }, + { 0x3FEB, opcode::OP_GetClasses }, + { 0x3FEC, opcode::OP_New }, + { 0x3FED, opcode::OP_Invalid }, + { 0x3FEE, opcode::OP_ScriptThreadCallClass }, + { 0x3FEF, opcode::OP_GetSelfObject }, + { 0x3FF0, opcode::OP_GetClasses }, + { 0x3FF1, opcode::OP_Invalid }, + { 0x3FF2, opcode::OP_LessThanOrEqualTo }, + { 0x3FF3, opcode::OP_Invalid }, + { 0x3FF4, opcode::OP_GetUnsignedShort }, + { 0x3FF5, opcode::OP_GetHash }, + { 0x3FF6, opcode::OP_Minus }, + { 0x3FF7, opcode::OP_IsDefined }, + { 0x3FF8, opcode::OP_LessThanOrEqualTo }, + { 0x3FF9, opcode::OP_Invalid }, + { 0x3FFA, opcode::OP_Invalid }, + { 0x3FFB, opcode::OP_Invalid }, + { 0x3FFC, opcode::OP_Invalid }, + { 0x3FFD, opcode::OP_GetVector }, + { 0x3FFE, opcode::OP_GetWorld }, + { 0x3FFF, opcode::OP_EmptyArray }, }}; } // namespace xsk::arc::t7 diff --git a/src/arc/engine/t7_hash.cpp b/src/arc/engine/t7_hash.cpp index 23cbc965..3f8ff9e4 100644 --- a/src/arc/engine/t7_hash.cpp +++ b/src/arc/engine/t7_hash.cpp @@ -43,12 +43,14 @@ extern std::array, hash_count> const hash_list { 0x9E8B905B, "__chance" }, { 0x0780CE43, "__clientfacialanimationslist" }, { 0xD4F49BA0, "__clientfacialanimationsthinkstarted" }, + { 0x9B385CA5, "__constructor" }, { 0xF5A9BA65, "__create_client_hud_elem" }, { 0xC3E36C3C, "__def" }, { 0x2633B922, "__default" }, { 0xCB96917F, "__default1" }, { 0x598F2244, "__default2" }, { 0xD31F0F7B, "__delta" }, + { 0x5FBA2032, "__destructor" }, { 0x2AD2861E, "__do_last_step__" }, { 0x23A342B8, "__e" }, { 0x23D5C676, "__ent" }, @@ -3515,6 +3517,7 @@ extern std::array, hash_count> const hash_list { 0x3086DAA7, "_helicopter_gunner" }, { 0xAE68C2F1, "_helicopter_player" }, { 0x623206BA, "_helicopter_sounds" }, + { 0x795DF34D, "_hero_catch_up_teleport_" }, { 0xE1CAC31A, "_hero_weapons" }, { 0x4D5B3B7C, "_hidden" }, { 0x91589476, "_hide_hud_count" }, @@ -9401,6 +9404,7 @@ extern std::array, hash_count> const hash_list { 0xBC27A54D, "abomb_targets" }, { 0xB4B62264, "abomination" }, { 0xDF918999, "abort" }, + { 0x577494DC, "abort forfeit" }, { 0x8A6D95B8, "abort_approach" }, { 0xB02DC2C7, "abort_chain" }, { 0xBF23185E, "abort_death_watch" }, @@ -9428,6 +9432,7 @@ extern std::array, hash_count> const hash_list { 0x2ECF4B3E, "abound" }, { 0x575675D4, "about" }, { 0x311D5773, "about_to_die" }, + { 0xB9A2E2CB, "about_to_fire" }, { 0xF892DEC0, "about_to_shoot" }, { 0xB87057A8, "aboutotlaunch" }, { 0x47D871AC, "abouttobebreached" }, @@ -14166,6 +14171,7 @@ extern std::array, hash_count> const hash_list { 0xBCDA1AD4, "aivsaimeleecombat" }, { 0x6E8328CE, "aivsaimeleeinitialize" }, { 0x32BC8627, "aivsaimeleerangesq" }, + { 0x20B9DF71, "aivsaimeleewinner" }, { 0x4495F04F, "aiweapon" }, { 0xFD2120AE, "ajoining" }, { 0x8C496009, "ak" }, @@ -18054,6 +18060,7 @@ extern std::array, hash_count> const hash_list { 0x448E6DC8, "asking" }, { 0xC865E646, "asm" }, { 0x0BCA5382, "asm_alias_attribute" }, + { 0x6F82574C, "asm_complete" }, { 0x1A8B762F, "asm_death_notify" }, { 0x9C192458, "asm_faller_deathout_notetrack" }, { 0x55A1B5F2, "asm_faller_melee_notetrack" }, @@ -18077,6 +18084,7 @@ extern std::array, hash_count> const hash_list { 0x1951F8D4, "asm_state_running" }, { 0x007ED8D0, "asm_state_terminated" }, { 0x86C8881C, "asm_state_transition_complete" }, + { 0x1AE8BD76, "asm_terminated" }, { 0x4DA9AAE3, "asm_thrasher_melee_notetrack" }, { 0xBDCCC6EB, "asm_zombie_crush_notetrack" }, { 0x9B4512F1, "asm_zombie_dog_melee_notetrack" }, @@ -22919,6 +22927,7 @@ extern std::array, hash_count> const hash_list { 0x7C4E05D3, "bgb_blow_bubble_fx_name" }, { 0xE4E15C9A, "bgb_current_cf_name" }, { 0x26B90C53, "bgb_display_cf_name" }, + { 0xA3D84497, "bgb_flavor_hexed_give_" }, { 0xEBE6EB3D, "bgb_idle_eyes_active" }, { 0x3F330E54, "bgb_in_plain_sight_active" }, { 0x1D83009C, "bgb_in_use" }, @@ -22947,6 +22956,7 @@ extern std::array, hash_count> const hash_list { 0x00C0E28B, "bgb_timer_manual_lerp_threshold" }, { 0xADE8E118, "bgb_token" }, { 0xE6DEC57E, "bgb_tone_death" }, + { 0xAE9023A9, "bgb_update_give_" }, { 0x37224D3F, "bgbar" }, { 0xA5DB58C6, "bgbignorefearinheadlights" }, { 0xBE22AE54, "bgelm" }, @@ -24278,6 +24288,7 @@ extern std::array, hash_count> const hash_list { 0x190777ED, "bodycolors" }, { 0x51D70D80, "bodydamagedmap" }, { 0x4E96B6ED, "bodydamagetags" }, + { 0xFCD109C7, "bodyfall large" }, { 0xB4036965, "bodyfallcb" }, { 0x375AC166, "bodyguard_bezerk" }, { 0x260A8649, "bodyguard_died" }, @@ -30269,6 +30280,7 @@ extern std::array, hash_count> const hash_list { 0x89CFDADB, "canbleed" }, { 0x19A075AE, "canblindfire" }, { 0xA1AE3CCB, "cancel" }, + { 0xAD4A3C97, "cancel speaking" }, { 0x9A0A3264, "cancel_anim_reach_hudson_melee" }, { 0xEAE92172, "cancel_button_press" }, { 0xDDE283EB, "cancel_button_think" }, @@ -31144,6 +31156,7 @@ extern std::array, hash_count> const hash_list { 0x9B615544, "cclass" }, { 0x6E63CD5E, "cclass_power" }, { 0x10667BA3, "ccn" }, + { 0x4A129F22, "ccom_lock_being_targeted" }, { 0x74810FD1, "ccontainer" }, { 0xB281BE26, "ccs" }, { 0x5A38BDDD, "cctv" }, @@ -45011,6 +45024,7 @@ extern std::array, hash_count> const hash_list { 0x75ECA6B5, "custom_think" }, { 0x4F70B82F, "custom_tower_trap_fires_func" }, { 0x05B04D4D, "custom_trapped_zombies" }, + { 0x154A271A, "custom_traversal_anim_finished" }, { 0x5B0C67F2, "custom_traversal_cleanup" }, { 0xB876B1D8, "custom_treasure_chest_glowfx" }, { 0x997A4627, "custom_umbra_hotfix" }, @@ -45255,6 +45269,7 @@ extern std::array, hash_count> const hash_list { 0x72F01E20, "dam_type" }, { 0xA1409ACB, "dam_types" }, { 0xF9348FDA, "damage" }, + { 0x2B25E23D, "damage state" }, { 0x2D49FAE7, "damage1" }, { 0xBB428BAC, "damage2" }, { 0xE1450615, "damage3" }, @@ -48456,6 +48471,7 @@ extern std::array, hash_count> const hash_list { 0x7BDF1958, "destent" }, { 0xB3B2AB6E, "destfov" }, { 0xF571697F, "destination" }, + { 0x9B1F1E2D, "destination reached" }, { 0x68BDA8D7, "destination_name" }, { 0x4F010B4E, "destination_node" }, { 0xE6C9F7F1, "destination_nodes" }, @@ -48468,6 +48484,7 @@ extern std::array, hash_count> const hash_list { 0x84389823, "destinationpoint" }, { 0x25C54C86, "destinations" }, { 0x6835E75F, "destinationvec" }, + { 0xDF1F87C9, "destintation reached" }, { 0x459CCA09, "destiny" }, { 0x56375830, "destname" }, { 0xF95CF5A1, "destnode" }, @@ -51123,6 +51140,7 @@ extern std::array, hash_count> const hash_list { 0x4BAB3A56, "dlc3_teleporter" }, { 0x5EC9856D, "dlc3_threadcalls" }, { 0x37C12215, "dlc3_threadcalls2" }, + { 0xCEF0D8AE, "dlc3_zombie_five_teleports" }, { 0x01FFF241, "dlc5" }, { 0xC1E325A0, "dlg" }, { 0xB2D1F001, "dlg_easy_rhino_done" }, @@ -52569,6 +52587,7 @@ extern std::array, hash_count> const hash_list { 0xF8857CCC, "donate" }, { 0xAF0772E0, "donated" }, { 0x355070E1, "done" }, + { 0x90F83311, "done speaking" }, { 0xCC4C335B, "done_aimaware" }, { 0xDF245174, "done_animating" }, { 0x0102C0A5, "done_avoiding" }, @@ -52759,6 +52778,7 @@ extern std::array, hash_count> const hash_list { 0x1585184F, "door_align" }, { 0x4ABFFE9E, "door_align_node" }, { 0xE641AF94, "door_anglesmod" }, + { 0x27E6C447, "door_anim" }, { 0x07F84216, "door_anim_node" }, { 0xFC29021A, "door_b" }, { 0xB12CEB8D, "door_b_open" }, @@ -57581,6 +57601,7 @@ extern std::array, hash_count> const hash_list { 0x3C6BCDE6, "encryption" }, { 0x2E848D0F, "encure" }, { 0x03FC1574, "end" }, + { 0x18E2BBBB, "end line sound" }, { 0x6412E650, "end04" }, { 0x3F23B514, "end04_fade_out_black" }, { 0xD43651CE, "end04_start_drag" }, @@ -57616,6 +57637,8 @@ extern std::array, hash_count> const hash_list { 0xC5C17B1F, "end_anim_thread" }, { 0x2F2E297B, "end_arena_migs" }, { 0x3A271186, "end_array" }, + { 0xE8F330BF, "end_asm_terminated_thread" }, + { 0xF3B632F7, "end_asm_timeout_thread" }, { 0x61CC13FB, "end_at_node" }, { 0x63F079B8, "end_at_num_guys" }, { 0x44FD873A, "end_attack_thread" }, @@ -57810,6 +57833,7 @@ extern std::array, hash_count> const hash_list { 0x6F193E90, "end_hunt" }, { 0xBCAA5A3D, "end_idle" }, { 0xDDE01E26, "end_igc" }, + { 0x893FBBB3, "end_immolating_thread" }, { 0x48926C19, "end_in_tube_rumble" }, { 0x4ED8D59D, "end_index" }, { 0xD93563AC, "end_intro_flak" }, @@ -62125,6 +62149,7 @@ extern std::array, hash_count> const hash_list { 0xC4F68E68, "evt_1_torture" }, { 0x4AD37599, "evt_blizzard_gust" }, { 0x22AA8F1C, "evt_c4_det" }, + { 0x56449443, "evt_carpenter_end" }, { 0x3419DF0E, "evt_dragovich_drown_loop" }, { 0x1CC34FB1, "evt_jet_flyby2" }, { 0xAF3E5437, "evt_numbers" }, @@ -63298,6 +63323,7 @@ extern std::array, hash_count> const hash_list { 0x0225046E, "eyepos" }, { 0x2215B799, "eyeposition" }, { 0xFE56760B, "eyes" }, + { 0xC1896D90, "eyes look now" }, { 0x770277DC, "eyes_on_the_wall" }, { 0x900FEC00, "eyes_spawned" }, { 0xF5478868, "eyesatenemy" }, @@ -64154,6 +64180,7 @@ extern std::array, hash_count> const hash_list { 0x104646F5, "fallanim" }, { 0x641392AD, "fallanimstatedef" }, { 0x748DB797, "fallback" }, + { 0x05D4B3A4, "fallback initiated " }, { 0xBD260C57, "fallback_430" }, { 0x20207AE5, "fallback_add_previous_group" }, { 0x2B3B637C, "fallback_ai" }, @@ -65200,6 +65227,7 @@ extern std::array, hash_count> const hash_list { 0xD96F4AB1, "finishcustomtraversallistener" }, { 0xC92C5DD5, "finishdualhardpointlocationusage" }, { 0x6301ECEB, "finished" }, + { 0xF42B7E06, "finished spawning" }, { 0xEA8AB8FA, "finished_boarding" }, { 0xF8D5F1EC, "finished_custom_animmode" }, { 0xA3E6B080, "finished_eating" }, @@ -66034,6 +66062,7 @@ extern std::array, hash_count> const hash_list { 0xB70EF5E0, "fl_flag" }, { 0xCC0982E9, "flacked" }, { 0xAD23E503, "flag" }, + { 0x4008E0D0, "flag check is running" }, { 0xCCA6AFE0, "flag1" }, { 0x3EAE1F1B, "flag2" }, { 0x18ABA4B2, "flag3" }, @@ -67869,6 +67898,7 @@ extern std::array, hash_count> const hash_list { 0x485A51AE, "foreverever" }, { 0x0F5E573A, "foreverrr" }, { 0xBC7C993A, "forfeit" }, + { 0xD343F3A0, "forfeit in progress" }, { 0x4DFB2196, "forfeit_count" }, { 0xE0F2E2E6, "forfeit_delay" }, { 0xB0BCD5CD, "forfeited" }, @@ -71240,6 +71270,7 @@ extern std::array, hash_count> const hash_list { 0x40F8302A, "gastrap_mask_off" }, { 0x06092F9D, "gasusage" }, { 0x7D67C678, "gate" }, + { 0x91FF5153, "gate opened" }, { 0xA83842C1, "gate1" }, { 0x4CE1AFE2, "gate1_origin" }, { 0xCE3ABD2A, "gate2" }, @@ -74883,6 +74914,7 @@ extern std::array, hash_count> const hash_list { 0xAA49E925, "girl_dance4" }, { 0xF87746FE, "girls" }, { 0x5B0ED0BA, "give" }, + { 0xE4AE4515, "give up" }, { 0x870B5138, "give_ability_now" }, { 0x52C9C74A, "give_achievement" }, { 0xAFAF20EB, "give_additional_primary_weapon_perk" }, @@ -75513,6 +75545,9 @@ extern std::array, hash_count> const hash_list { 0xEBF7D9AF, "goal_type" }, { 0xA5F4CEB5, "goal_volume" }, { 0xE13533BE, "goal_volume_init" }, + { 0xB61DFA9E, "goal_wait_notify_lase" }, + { 0x6A517A0A, "goal_watcher_patrol" }, + { 0x6FB6A6D3, "goal_watcher_target" }, { 0xA68AD6E5, "goal_when_cantsee" }, { 0xFF3CC935, "goal_world_offset" }, { 0xA2463F80, "goal_yaw" }, @@ -75712,6 +75747,7 @@ extern std::array, hash_count> const hash_list { 0x9C0A6350, "goslowmo" }, { 0x34B24FD0, "gospeed" }, { 0x3F6AA549, "got" }, + { 0xA5FB63C6, "got known enemy2" }, { 0x804F5C21, "got_a_tomahawk_kill" }, { 0x9443D9E6, "got_ability" }, { 0x6BA63C86, "got_ai" }, @@ -75735,6 +75771,7 @@ extern std::array, hash_count> const hash_list { 0xE42A4FFC, "gotime" }, { 0xF3C1F5D9, "gotnewhighscore" }, { 0x3447CCBC, "goto" }, + { 0x1F355AD7, "goto next fallback" }, { 0x7317DA2E, "goto_barge" }, { 0xC74D9E62, "goto_current_colorindex" }, { 0x75B50151, "goto_func" }, @@ -79698,6 +79735,7 @@ extern std::array, hash_count> const hash_list { 0x42E82B74, "hero_append" }, { 0xF6F77532, "hero_attacks_enemy" }, { 0x2E0D60CD, "hero_call_sniper_pos" }, + { 0x89827D0F, "hero_catch_up_teleport" }, { 0xBD1509CA, "hero_chain_start" }, { 0xE3D84590, "hero_chain_trig" }, { 0x61ABC45D, "hero_clientfield_power" }, @@ -82536,6 +82574,7 @@ extern std::array, hash_count> const hash_list { 0x3D2667AF, "ifadetime" }, { 0x410114EA, "iff" }, { 0x03CEDE31, "iff_override" }, + { 0x6EB14BB1, "iff_override_reverted" }, { 0xF5C12ECD, "ifiretime" }, { 0x03B6577D, "ifirstbreachers" }, { 0x28768E77, "iflashfuse" }, @@ -88835,6 +88874,7 @@ extern std::array, hash_count> const hash_list { 0x5366694F, "jungle_stealth_skipto_clean_up" }, { 0x12D18B52, "jungle_stealth_spawn_funcs" }, { 0x05AEADF3, "junk" }, + { 0xBF60BC80, "junk purchased" }, { 0x5ED1B490, "junk1" }, { 0xD0D923CB, "junk2" }, { 0xAAD6A962, "junk3" }, @@ -89854,6 +89894,7 @@ extern std::array, hash_count> const hash_list { 0x7155C0B3, "killdtpmonitor" }, { 0x48F5BB3A, "kille_ridge_vcs_quickly" }, { 0x39D3D8BA, "killed" }, + { 0x9696A8AD, "killed all targets" }, { 0x12B3B846, "killed_50cal" }, { 0x6ECC9F0E, "killed_a_player" }, { 0x404982D1, "killed_a_zombie_player" }, @@ -90929,6 +90970,9 @@ extern std::array, hash_count> const hash_list { 0xC0938265, "larry_the_limper_tweaktech_halved" }, { 0xDE893D08, "larry_thread" }, { 0x047339A4, "lase" }, + { 0x50B88A46, "lase_goal" }, + { 0x565DAAC6, "lase_points" }, + { 0xB39FFFD7, "lase_points_loop" }, { 0x91410B6E, "laser" }, { 0x9603D750, "laser_awareness" }, { 0x120B1E9B, "laser_death_thread_stop" }, @@ -93794,6 +93838,8 @@ extern std::array, hash_count> const hash_list { 0x0365B14C, "lockers" }, { 0xFB301981, "lockheliheight" }, { 0x30FF42E0, "locking" }, + { 0xB081980B, "locking on" }, + { 0xE1494B46, "locking on hacking" }, { 0xAE1DF088, "locking_on" }, { 0xEE40CEC9, "locking_on_cleared" }, { 0xA6523740, "locking_on_hacking" }, @@ -93982,6 +94028,7 @@ extern std::array, hash_count> const hash_list { 0x4E427F1A, "longs" }, { 0x8EC8835A, "longshots" }, { 0x73D41D3C, "look" }, + { 0x9A1A418C, "look now" }, { 0x3F16A0D6, "look2" }, { 0x02D6B2F4, "look2alert_cornerl" }, { 0x5B07C260, "look4" }, @@ -100062,6 +100109,8 @@ extern std::array, hash_count> const hash_list { 0xDB6D9FE2, "missedsightchecks" }, { 0x0565DDD1, "misses" }, { 0x4A93C703, "missile" }, + { 0xB0C5EA03, "missile fired" }, + { 0x2FF1AD5E, "missile ready" }, { 0x737DC418, "missile01_end" }, { 0x18CD813B, "missile01_start" }, { 0x349D8C9B, "missile02_end" }, @@ -106560,6 +106609,7 @@ extern std::array, hash_count> const hash_list { 0x893CBBF1, "nevski_door_node" }, { 0xEB6D7513, "nevsky" }, { 0xD4305EFD, "new" }, + { 0x3790D3C8, "new debug_vehiclesetspeed" }, { 0x58F8ECE5, "new2" }, { 0x67E94495, "new_aatarget" }, { 0x4FFCA9E2, "new_ability" }, @@ -107597,6 +107647,7 @@ extern std::array, hash_count> const hash_list { 0xE39956D0, "nnodes" }, { 0x10667DF0, "nnw" }, { 0x06BEE09C, "no" }, + { 0x46D36511, "no valid boards" }, { 0x3DA5BD09, "no3d" }, { 0xE931BC28, "no_accuracy" }, { 0x32A28D44, "no_airstrike_ammo" }, @@ -115545,6 +115596,7 @@ extern std::array, hash_count> const hash_list { 0x5F4354B9, "patches" }, { 0xA832A6BF, "patching" }, { 0xD9A41C78, "path" }, + { 0xDF5908AC, "path start" }, { 0xC8B618B8, "path1end" }, { 0xB5410FDB, "path1start" }, { 0x1951E3F1, "path2end" }, @@ -115790,6 +115842,7 @@ extern std::array, hash_count> const hash_list { 0x04DBAFFA, "patrol_guys" }, { 0x54DFC4BC, "patrol_init" }, { 0x36E51EDE, "patrol_init_custom" }, + { 0x8D1875DC, "patrol_lase_goal_waiter" }, { 0x1B9E35BC, "patrol_loop" }, { 0xA2D2DAEA, "patrol_loop_then_retreat" }, { 0x04776A45, "patrol_main" }, @@ -122731,6 +122784,7 @@ extern std::array, hash_count> const hash_list { 0x48F2CA23, "power_occupied" }, { 0x5E20D7B6, "power_off" }, { 0xB5078790, "power_off_callback" }, + { 0x5060BE39, "power_off_done" }, { 0xB012591F, "power_off_func" }, { 0xE22A8AA8, "power_on" }, { 0xAC043BAC, "power_on_all" }, @@ -122817,6 +122871,10 @@ extern std::array, hash_count> const hash_list { 0x568A1EF0, "powertoadd" }, { 0x366C6CDB, "powertoremove" }, { 0x0A6DB0B7, "powerup" }, + { 0xAB83A4DB, "powerup bonfire sale" }, + { 0x3B3C2756, "powerup fire sale" }, + { 0x6E291DA5, "powerup instakill_" }, + { 0x041C2BF1, "powerup points scaled_" }, { 0x39F3CA14, "powerup_any_team" }, { 0x9211EE00, "powerup_areas" }, { 0xF687758D, "powerup_array" }, @@ -123864,6 +123922,7 @@ extern std::array, hash_count> const hash_list { 0xD4633AC5, "primaries" }, { 0xEC008070, "primarily" }, { 0x43C330DD, "primary" }, + { 0x907788C7, "primary acquired" }, { 0xDFB9CC32, "primary_ai_switchtarget" }, { 0x0CBE7357, "primary_alarm" }, { 0x175A80F7, "primary_attachment" }, @@ -127721,6 +127780,8 @@ extern std::array, hash_count> const hash_list { 0xE4631170, "recaptured" }, { 0x9124D82C, "receive" }, { 0xD145B0C0, "received" }, + { 0x02528173, "received award" }, + { 0xF0FA2450, "received teammessage" }, { 0xD8457870, "receiveddialog" }, { 0x1565F655, "receivedtext" }, { 0x157C35C6, "receiver" }, @@ -130174,6 +130235,7 @@ extern std::array, hash_count> const hash_list { 0xBBE04EFF, "resumetimer" }, { 0xE7089A23, "resumetimerdiscardoverride" }, { 0x9EC0F145, "resuming" }, + { 0xEEAEC2A0, "resuming speed" }, { 0x810A3167, "resupply" }, { 0x183E8A4C, "resurfacetime" }, { 0xEEC6038F, "resurrct" }, @@ -136855,6 +136917,7 @@ extern std::array, hash_count> const hash_list { 0x20A9A491, "secondaries" }, { 0x17B5521C, "secondarray" }, { 0x1CE98AB1, "secondary" }, + { 0x519AF70B, "secondary acquired" }, { 0x356CEB5B, "secondary_attachment" }, { 0x607A33C4, "secondary_attachment_flag" }, { 0xAFF3A9EE, "secondary_attachment_mask" }, @@ -137838,6 +137901,7 @@ extern std::array, hash_count> const hash_list { 0xE0BEB6EE, "sessionstate" }, { 0xB2E5A818, "sessionteam" }, { 0x74D6B22F, "set" }, + { 0x47341E47, "set name and rank" }, { 0xD68111E4, "set1" }, { 0x4888811F, "set2" }, { 0x000F7196, "set2dicon" }, @@ -142741,6 +142805,7 @@ extern std::array, hash_count> const hash_list { 0x9899333A, "shuoldnt" }, { 0xFF326A3F, "shut" }, { 0xB9133872, "shut_down_chopper_support" }, + { 0x777B79D1, "shut_off" }, { 0x1F78A85D, "shut_off_all_looping_sounds" }, { 0xA491838E, "shut_off_boat" }, { 0x9329F246, "shut_off_fx" }, @@ -149829,6 +149894,7 @@ extern std::array, hash_count> const hash_list { 0x8979D298, "stark" }, { 0xF93E58C0, "stars" }, { 0x034FB19F, "start" }, + { 0x6D76E1DB, "start fx" }, { 0xCFE91694, "start1" }, { 0x41F085CF, "start2" }, { 0x29BF9105, "start3dcinematic" }, @@ -150617,6 +150683,7 @@ extern std::array, hash_count> const hash_list { 0x4EF23677, "start_underwater_anim" }, { 0x00C468D4, "start_underwater_snapshot" }, { 0xF96FA4C4, "start_unhide_players" }, + { 0x8D400B59, "start_up" }, { 0x4A52F6BF, "start_val" }, { 0x5AFAD49D, "start_value" }, { 0x30FEF6D9, "start_van_crash" }, @@ -151744,6 +151811,16 @@ extern std::array, hash_count> const hash_list { 0x7CF47DAA, "stool" }, { 0xB25F4852, "stoolpush" }, { 0xFCF56AB5, "stop" }, + { 0xCE9DE5D2, "stop all gunfireloopfx" }, + { 0x87140C16, "stop current floodspawner" }, + { 0xDE2CA008, "stop debug " }, + { 0xAA09DE02, "stop debugline " }, + { 0xF9604459, "stop fx" }, + { 0x38F853E7, "stop hover" }, + { 0x117FE2F2, "stop path" }, + { 0xD175A918, "stop random_spread" }, + { 0xF886F54C, "stop sound" }, + { 0xF6285749, "stop trail" }, { 0x6518A180, "stop2_exposed" }, { 0x7B3C0817, "stop3dcinematic" }, { 0x31D06908, "stop_" }, @@ -152249,6 +152326,7 @@ extern std::array, hash_count> const hash_list { 0xC85E4D82, "stop_helicopter_attack" }, { 0x8472F674, "stop_helmet_loop" }, { 0x0BDB88D2, "stop_here" }, + { 0x8882DAA6, "stop_hero_catch_up_teleport" }, { 0x13E77708, "stop_hero_movement" }, { 0x939895A9, "stop_hero_rain" }, { 0x5192DB11, "stop_heroberlin_talk" }, @@ -152945,6 +153023,7 @@ extern std::array, hash_count> const hash_list { 0xF2040CC4, "stopped" }, { 0x7EFBE79C, "stopped_anim" }, { 0x627B1CAB, "stopped_at_node" }, + { 0xDEC53302, "stopped_firing" }, { 0xC1047831, "stopped_opening" }, { 0x62FC8F8D, "stopped_use_turret" }, { 0xD5FF12DE, "stopped_using_remote" }, @@ -155656,6 +155735,7 @@ extern std::array, hash_count> const hash_list { 0xF13B8B33, "swiped" }, { 0xB7165F0C, "swipes" }, { 0x8F6EDCBD, "switch" }, + { 0x11675B4C, "switch group" }, { 0x7425001D, "switch_activated" }, { 0x7BE2D810, "switch_ambient_packages" }, { 0x94CDFFA1, "switch_and_takeover" }, @@ -158400,6 +158480,7 @@ extern std::array, hash_count> const hash_list { 0x693F168F, "tells" }, { 0x8A54AE0F, "telltimer" }, { 0xF8F608DB, "temp" }, + { 0x0CC2DDC9, "temp proceed" }, { 0x00751CE8, "temp1" }, { 0x727C8C23, "temp2" }, { 0x4C7A11BA, "temp3" }, @@ -158650,6 +158731,7 @@ extern std::array, hash_count> const hash_list { 0xA8168EB3, "terminal_model" }, { 0xE2FDDD30, "terminals" }, { 0xF04E14FE, "terminate" }, + { 0x974DE41E, "terminate_all_the_things" }, { 0x42453C48, "terminate_all_turrets_firing" }, { 0xE090D26C, "terminate_cm_watcher" }, { 0xD372FE9C, "terminatebsm" }, @@ -163941,6 +164023,7 @@ extern std::array, hash_count> const hash_list { 0x544DE2C5, "turnyaw" }, { 0xF4240167, "turrent" }, { 0x37B990DB, "turret" }, + { 0x849F87BA, "turret reloading" }, { 0xCE4434E8, "turret1" }, { 0x404BA423, "turret2" }, { 0x1A4929BA, "turret3" }, @@ -165974,6 +166057,7 @@ extern std::array, hash_count> const hash_list { 0xA61D27D2, "updateteamtime" }, { 0xB81E4071, "updateteamuavstatus" }, { 0x7C5DCE1E, "updateteamvehicles" }, + { 0x359CF118, "updatethread specialiststatabilityusage" }, { 0x89539239, "updatetiestats" }, { 0x4809D0B5, "updatetime" }, { 0xB5371B9B, "updatetimeplayedcapdvar" }, @@ -168806,6 +168890,7 @@ extern std::array, hash_count> const hash_list { 0xC75394F8, "vehiclegearmodels" }, { 0x4C357EB5, "vehiclegeartags" }, { 0x02AE0CB4, "vehiclegroup" }, + { 0xEDB7D25E, "vehiclegroup spawned" }, { 0x408B946E, "vehiclegunner" }, { 0x27AA40D5, "vehiclehackertoolradius" }, { 0xED627D44, "vehiclehackertooltimems" }, @@ -168929,6 +169014,8 @@ extern std::array, hash_count> const hash_list { 0xF3C8FB41, "velocity1" }, { 0x19CB75AA, "velocity2" }, { 0x3FCDF013, "velocity3" }, + { 0x9C1AC1CB, "velocity_approach" }, + { 0x9744842A, "velocity_approach_early_out" }, { 0xD46895D5, "velocity_func" }, { 0x0B02FD9F, "velocity_length" }, { 0x829E8366, "velocity_normal" }, @@ -171898,6 +171985,7 @@ extern std::array, hash_count> const hash_list { 0xD83EAE68, "waittill_crash_done_or_stopped" }, { 0x8DAF7251, "waittill_damage_and_notify" }, { 0x21FE06CC, "waittill_dead" }, + { 0x27BC4415, "waittill_dead guy died" }, { 0xCFF9A825, "waittill_dead_guy_dead_or_dying" }, { 0x5491EDE6, "waittill_dead_or_dying" }, { 0xBFB394E5, "waittill_dead_or_dying_thread" }, @@ -176882,6 +176970,7 @@ extern std::array, hash_count> const hash_list { 0x3BA768C3, "zm_bgb_machine_static_gumballs_piece_index" }, { 0xE137315D, "zm_bgb_machine_targetname" }, { 0xFB6D5153, "zm_bgb_near_death_experience" }, + { 0xF9C8C638, "zm_bgb_near_death_experience_1p_fx_stop_" }, { 0x048B6019, "zm_bgb_secret_shopper" }, { 0x144DE88E, "zm_bgb_unbearable" }, { 0x5F7CF93D, "zm_bgb_wall_power_used" }, diff --git a/src/arc/engine/t8.cpp b/src/arc/engine/t8.cpp new file mode 100644 index 00000000..7523eedb --- /dev/null +++ b/src/arc/engine/t8.cpp @@ -0,0 +1,32 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "xsk/arc/engine/t8.hpp" + +namespace xsk::arc::t8 +{ + +extern std::array, code_count> const code_list; +// extern std::array, hash_count> const hash_list; + +context::context() : arc::context(props::v3, engine::t8, endian::little, system::pc, header_magic) +{ + code_map_.reserve(code_list.size()); + code_map_rev_.reserve(code_list.size()); + // hash_map_.reserve(hash_list.size()); + + for (auto const& entry : code_list) + { + code_map_.insert({ entry.first, entry.second }); + code_map_rev_.insert({ entry.second, entry.first }); + } + + // for (auto const& entry : hash_list) + // { + // hash_map_.insert({ entry.first, entry.second }); + // } +} + +} // namespace xsk::arc::t8 diff --git a/src/arc/engine/t7_dvar.cpp b/src/arc/engine/t8_code.cpp similarity index 51% rename from src/arc/engine/t7_dvar.cpp rename to src/arc/engine/t8_code.cpp index a1bbce49..bbf0f027 100644 --- a/src/arc/engine/t7_dvar.cpp +++ b/src/arc/engine/t8_code.cpp @@ -3,13 +3,13 @@ // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. -#include "xsk/arc/engine/t7.hpp" +#include "xsk/arc/engine/t8.hpp" -namespace xsk::arc::t7 +namespace xsk::arc::t8 { -extern std::array, dvar_count> const dvar_list +extern std::array, code_count> const code_list {{ }}; -} // namespace xsk::arc::t7 +} // namespace xsk::arc::t8 diff --git a/src/arc/engine/t9.cpp b/src/arc/engine/t9.cpp new file mode 100644 index 00000000..ec26dc6d --- /dev/null +++ b/src/arc/engine/t9.cpp @@ -0,0 +1,32 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "xsk/arc/engine/t9.hpp" + +namespace xsk::arc::t9 +{ + +extern std::array, code_count> const code_list; +// extern std::array, hash_count> const hash_list; + +context::context() : arc::context(props::v3, engine::t9, endian::little, system::pc, header_magic) +{ + code_map_.reserve(code_list.size()); + code_map_rev_.reserve(code_list.size()); + // hash_map_.reserve(hash_list.size()); + + for (auto const& entry : code_list) + { + code_map_.insert({ entry.first, entry.second }); + code_map_rev_.insert({ entry.second, entry.first }); + } + + // for (auto const& entry : hash_list) + // { + // hash_map_.insert({ entry.first, entry.second }); + // } +} + +} // namespace xsk::arc::t9 diff --git a/src/arc/engine/t9_code.cpp b/src/arc/engine/t9_code.cpp new file mode 100644 index 00000000..6cf05dec --- /dev/null +++ b/src/arc/engine/t9_code.cpp @@ -0,0 +1,15 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "xsk/arc/engine/t9.hpp" + +namespace xsk::arc::t9 +{ + +extern std::array, code_count> const code_list +{{ +}}; + +} // namespace xsk::arc::t9 diff --git a/src/arc/lexer.cpp b/src/arc/lexer.cpp new file mode 100644 index 00000000..0c8d1685 --- /dev/null +++ b/src/arc/lexer.cpp @@ -0,0 +1,618 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "xsk/stdinc.hpp" +#include "xsk/utils/string.hpp" +#include "xsk/arc/lexer.hpp" +#include "xsk/arc/context.hpp" + +namespace xsk::arc +{ + +lexer::lexer(context const* ctx, std::string const& name, char const* data, usize size) : ctx_{ ctx }, reader_{ data, size }, loc_{ &name }, buflen_{ 0 }, spacing_{ spacing::null }, indev_{ false } +{ +} + +auto lexer::lex() -> token +{ + buflen_ = 0; + + while (true) + { + auto& last = reader_.last_byte; + auto& curr = reader_.curr_byte; + auto path = false; + auto localize = false; + loc_.step(); + + if (reader_.ended()) + { + if (indev_) + throw comp_error(loc_, "unmatched devblock start ('/#')"); + + if (curr == 0 && last != '\n') + { + curr = -1; + return token{ token::NEWLINE, spacing_, loc_ }; + } + else + return token{ token::EOS, spacing_, loc_ }; + } + + if (last == 0 || last == '\n') + spacing_ = spacing::null; + else if (last == ' ' || last == '\t') + spacing_ = (spacing_ == spacing::null) ? spacing::empty : spacing::back; + else + spacing_ = spacing::none; + + advance(); + + switch (last) + { + case ' ': + case '\t': + case '\r': + loc_.step(); + continue; + case '\n': + loc_.lines(); + loc_.step(); + return token{ token::NEWLINE, spacing_, loc_ }; + case '\\': + throw comp_error(loc_, "invalid token ('\\')"); + case '/': + if (curr != '=' && curr != '#' && curr != '@' && curr != '*' && curr != '/') + return token{ token::DIV, spacing_, loc_ }; + + advance(); + + if (last == '=') + return token{ token::DIVEQ, spacing_, loc_ }; + + if (last == '#') + { + if (indev_) + throw comp_error(loc_, "cannot recurse devblock ('/#')"); + + if (ctx_->build() == build::dev) + { + indev_ = true; + return token{ token::DEVBEGIN, spacing_, loc_ }; + } + else + { + while (true) + { + if (reader_.ended()) + throw comp_error(loc_, "unmatched devblock start ('/#')"); + + if (curr == '\n') + { + loc_.lines(); + loc_.step(); + } + else if (last == '#' && curr == '/') + { + advance(); + break; + } + + advance(); + } + } + } + else if (last == '@') + { + while (true) + { + if (reader_.ended()) + throw comp_error(loc_, "unmatched script doc comment start ('/@')"); + + if (curr == '\n') + { + loc_.lines(); + loc_.step(); + } + else if (last == '@' && curr == '/') + { + advance(); + break; + } + + advance(); + } + } + else if (last == '*') + { + while (true) + { + if (reader_.ended()) + throw comp_error(loc_, "unmatched multiline comment start ('/*')"); + + if (curr == '\n') + { + loc_.lines(); + loc_.step(); + } + else if (last == '*' && curr == '/') + { + advance(); + break; + } + + advance(); + } + } + else if (last == '/') + { + while (true) + { + if (reader_.ended()) + break; + + if (curr == '\n') + break; + + advance(); + } + } + continue; + case '#': + if (curr == '/') + { + if (!indev_) + throw comp_error(loc_, "unmatched devblock end ('#/')"); + + advance(); + indev_ = false; + return token{ token::DEVEND, spacing_, loc_ }; + } + + return token{ token::SHARP, spacing_, loc_ }; + case '*': + if (curr != '=' && curr != '/') + return token{ token::STAR, spacing_, loc_ }; + + advance(); + + if (last == '=') + return token{ token::STAREQ, spacing_, loc_ }; + + throw comp_error(loc_, "unmatched multiline comment end ('*/')"); + case '"': + goto lex_string; + case '.': + if (curr == '.') + { + advance(); + + if (curr != '.') + return token{ token::DOUBLEDOT, spacing_, loc_ }; + + advance(); + return token{ token::ELLIPSIS, spacing_, loc_ }; + } + + if (curr < '0' || curr > '9') + return token{ token::DOT, spacing_, loc_ }; + goto lex_number; + case '(': + return token{ token::LPAREN, spacing_, loc_ }; + case ')': + return token{ token::RPAREN, spacing_, loc_ }; + case '{': + return token{ token::LBRACE, spacing_, loc_ }; + case '}': + return token{ token::RBRACE, spacing_, loc_ }; + case '[': + return token{ token::LBRACKET, spacing_, loc_ }; + case ']': + return token{ token::RBRACKET, spacing_, loc_ }; + case ',': + return token{ token::COMMA, spacing_, loc_ }; + case ';': + return token{ token::SEMICOLON, spacing_, loc_ }; + case ':': + if (curr != ':') + return token{ token::COLON, spacing_, loc_ }; + + advance(); + return token{ token::DOUBLECOLON, spacing_, loc_ }; + case '?': + return token{ token::QMARK, spacing_, loc_ }; + case '=': + if (curr != '=') + return token{ token::ASSIGN, spacing_, loc_ }; + + advance(); + return token{ token::EQ, spacing_, loc_ }; + case '+': + if (curr != '+' && curr != '=') + return token{ token::PLUS, spacing_, loc_ }; + + advance(); + + if (last == '+') + return token{ token::INC, spacing_, loc_ }; + + return token{ token::PLUSEQ, spacing_, loc_ }; + case '-': + if (curr != '-' && curr != '=') + return token{ token::MINUS, spacing_, loc_ }; + + advance(); + + if (last == '-') + return token{ token::DEC, spacing_, loc_ }; + + return token{ token::MINUSEQ, spacing_, loc_ }; + case '%': + if (curr != '=') + return token{ token::MOD, spacing_, loc_ }; + + advance(); + + return token{ token::MODEQ, spacing_, loc_ }; + case '|': + if (curr != '|' && curr != '=') + return token{ token::BITOR, spacing_, loc_ }; + + advance(); + + if (last == '|') + return token{ token::OR, spacing_, loc_ }; + + return token{ token::BITOREQ, spacing_, loc_ }; + case '&': + if (curr != '&' && curr != '=' && curr != '"') + return token{ token::BITAND, spacing_, loc_ }; + + advance(); + + if (last == '&') + return token{ token::AND, spacing_, loc_ }; + + if (last == '=') + return token{ token::BITANDEQ, spacing_, loc_ }; + + localize = true; + goto lex_string; + case '^': + if (curr != '=') + return token{ token::BITEXOR, spacing_, loc_ }; + + advance(); + return token{ token::BITEXOREQ, spacing_, loc_ }; + case '!': + if (curr != '=') + return token{ token::BANG, spacing_, loc_ }; + + advance(); + return token{ token::NE, spacing_, loc_ }; + case '~': + return token{ token::TILDE, spacing_, loc_ }; + case '<': + if (curr != '<' && curr != '=') + return token{ token::LT, spacing_, loc_ }; + + advance(); + if (last == '=') + return token{ token::LE, spacing_, loc_ }; + + if (curr != '=') + return token{ token::SHL, spacing_, loc_ }; + + advance(); + return token{ token::SHLEQ, spacing_, loc_ }; + case '>': + if (curr != '>' && curr != '=') + return token{ token::GT, spacing_, loc_ }; + + advance(); + + if (last == '=') + return token{ token::GE, spacing_, loc_ }; + + if (curr != '=') + return token{ token::SHR, spacing_, loc_ }; + + advance(); + return token{ token::SHREQ, spacing_, loc_ }; + default: + if (last >= '0' && last <= '9') + goto lex_number; + else if (last == '_' || (last >= 'A' && last <= 'Z') || (last >= 'a' && last <= 'z')) + goto lex_name; + + throw comp_error(loc_, fmt::format("bad token: '{}'", last)); + } + +lex_string: + while (true) + { + if (reader_.ended()) + throw comp_error(loc_, "unmatched string start ('\"')"); + + if (curr == '"') + { + advance(); + break; + } + + if (curr == '\n') + throw comp_error(loc_, "unterminated string literal"); + + if (curr == '\\') + { + advance(); + + if (reader_.ended()) + throw comp_error(loc_, "invalid token ('\')"); + + char c = curr; + switch (curr) + { + case 't': c = '\t'; break; + case 'r': c = '\r'; break; + case 'n': c = '\n'; break; + case '"': c = '\"'; break; + case '\\': c = '\\'; break; + default: break; + } + + push(c); + } + else + push(curr); + + advance(); + } + + if (localize) + return token{ token::ISTRING, spacing_, loc_, std::string{ &buffer_[0], buflen_ } }; + + return token{ token::STRING, spacing_, loc_, std::string{ &buffer_[0], buflen_ } }; + +lex_name: + push(last); + + while (true) + { + if (reader_.ended()) + break; + + if (!(curr == '\\' || curr == '_' || (curr > 64 && curr < 91) || (curr > 96 && curr < 123) || (curr > 47 && curr < 58))) + break; + + if (curr == '\\') + { + if (last == '\\') + throw comp_error(loc_, "invalid path '\\\\'"); + + path = true; + push('/'); + } + else + push(curr); + + advance(); + } + + if (path) + { + if (buffer_[buflen_ - 1] == '/') + throw comp_error(loc_, "invalid path end '\\'"); + + return token{ token::PATH, spacing_, loc_, ctx_->make_token(std::string_view{ &buffer_[0], buflen_ }) }; + } + + return token{ token::NAME, spacing_, loc_, std::string{ &buffer_[0], buflen_ } }; + +lex_number: + if (last == '.' || last != '0' || (last == '0' && (curr != 'o' && curr != 'b' && curr != 'x'))) + { + push(last); + + auto dot = last == '.' ? 1 : 0; + auto flt = 0; + + while (true) + { + if (reader_.ended()) + break; + + if (curr == '\'' && (last == '\'' || last == 'f' || last == '.')) + throw comp_error(loc_, "invalid number literal"); + + if ((curr == '.' || curr == 'f') && last == '\'') + throw comp_error(loc_, "invalid number literal"); + + if (curr == '\'') + { + advance(); + continue; + } + + if (curr == 'f') + flt++; + else if (curr == '.') + dot++; + else if (!(curr > 47 && curr < 58)) + break; + + push(curr); + advance(); + } + + if (last == '\'') + throw comp_error(loc_, "invalid number literal"); + + if (dot > 1 || flt > 1 || (flt && buffer_[buflen_ - 1] != 'f')) + throw comp_error(loc_, "invalid number literal"); + + if (dot || flt) + return token{ token::FLT, spacing_, loc_, std::string{ &buffer_[0], buflen_ } }; + + return token{ token::INT, spacing_, loc_, std::string{ &buffer_[0], buflen_ } }; + } + else if (curr == 'o') + { + advance(); + + while (true) + { + if (reader_.ended()) + break; + + if ((curr == '\'' && (last == '\'' || last == 'o')) || (curr == 'o' && last == '\'')) + throw comp_error(loc_, "invalid octal literal"); + + if (curr == '\'') + { + advance(); + continue; + } + + if (!(curr > 47 && curr < 56)) + break; + + push(curr); + advance(); + } + + if (last == '\'' || buflen_ <= 0) + throw comp_error(loc_, "invalid octal literal"); + + push('\0'); + + return token{ token::INT, spacing_, loc_, utils::string::oct_to_dec(&buffer_[0]) }; + } + else if (curr == 'b') + { + push(last); + push(curr); + advance(); + + while (true) + { + if (reader_.ended()) + break; + + if ((curr == '\'' && (last == '\'' || last == 'b')) || (curr == 'b' && last == '\'')) + throw comp_error(loc_, "invalid binary literal"); + + if (curr == '\'') + { + advance(); + continue; + } + + if (curr != '0' && curr != '1') + break; + + push(curr); + advance(); + } + + if (last == '\'' || buflen_ < 3) + throw comp_error(loc_, "invalid binary literal"); + + push('\0'); + + return token{ token::INT, spacing_, loc_, utils::string::bin_to_dec(&buffer_[0]) }; + } + else if (curr == 'x') + { + push(last); + push(curr); + advance(); + + while (true) + { + if (reader_.ended()) + break; + + if ((curr == '\'' && (last == '\'' || last == 'x')) || (curr == 'x' && last == '\'')) + throw comp_error(loc_, "invalid hexadecimal literal"); + + if (curr == '\'') + { + advance(); + continue; + } + + if (!((curr > 47 && curr < 58) || (curr > 64 && curr < 71) || (curr > 96 && curr < 103))) + break; + + push(curr); + advance(); + } + + if (last == '\'' || buflen_ < 3) + throw comp_error(loc_, "invalid hexadecimal literal"); + + push('\0'); + + return token{ token::INT, spacing_, loc_, utils::string::hex_to_dec(&buffer_[0]) }; + } + + throw error("UNEXPECTED LEXER INTERNAL ERROR"); + } +} + +auto lexer::push(char c) -> void +{ + if (buflen_ >= 0x1000) + throw error("lexer: max literal size exceeded"); + + buffer_[buflen_++] = c; +} + +auto lexer::advance() -> void +{ + reader_.advance(); + loc_.end.column++; + + if (reader_.curr_byte == '\\') [[unlikely]] + linewrap(); +} + +auto lexer::linewrap() -> void +{ + while (reader_.curr_byte == '\\') + { + if (reader_.available == 1) + throw comp_error(loc_, "invalid token ('\\')"); + + if (reader_.buffer_pos[1] != '\r' && reader_.buffer_pos[1] != '\n') + break; + + if (reader_.buffer_pos[1] == '\r') + { + if (reader_.available <= 3 || reader_.buffer_pos[2] != '\n') + throw comp_error(loc_, "invalid token ('\\')"); + + reader_.buffer_pos += 3; + reader_.available -= 3; + } + + if ((reader_.buffer_pos[1] == '\n')) + { + if (reader_.available == 2) + throw comp_error(loc_, "invalid token ('\\')"); + + reader_.buffer_pos += 2; + reader_.available -= 2; + } + + reader_.curr_byte = reader_.available ? *reader_.buffer_pos : 0; + + loc_.lines(); + loc_.step(); + } +} + +} // namespace xsk::arc diff --git a/src/arc/parser.cpp b/src/arc/parser.cpp new file mode 100644 index 00000000..b06d5632 --- /dev/null +++ b/src/arc/parser.cpp @@ -0,0 +1,5753 @@ +// A Bison parser, made by GNU Bison 3.8.2. + +// Skeleton implementation for Bison LALR(1) parsers in C++ + +// Copyright (C) 2002-2015, 2018-2021 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. + +// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, +// especially those whose name start with YY_ or yy_. They are +// private implementation details that can be changed or removed. + +// "%code top" blocks. +#line 41 "parser.ypp" + +#include "xsk/stdinc.hpp" +#include "xsk/arc/parser.hpp" +#include "xsk/arc/preprocessor.hpp" +using namespace xsk::arc; +namespace xsk::arc +{ + auto ARClex(context const* ctx_, preprocessor& ppr) -> parser::symbol_type; + auto parse_switch(stmt_switch& stm) -> void; +} + +#line 51 "parser.cpp" + +// Take the name prefix into account. +#define yylex ARClex + + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include // FIXME: INFRINGES ON USER NAME SPACE. +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + + +// Whether we are compiled with exception support. +#ifndef YY_EXCEPTIONS +# if defined __GNUC__ && !defined __EXCEPTIONS +# define YY_EXCEPTIONS 0 +# else +# define YY_EXCEPTIONS 1 +# endif +#endif + +#define YYRHSLOC(Rhs, K) ((Rhs)[K].location) +/* 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). */ + +# ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).begin = YYRHSLOC (Rhs, 1).begin; \ + (Current).end = YYRHSLOC (Rhs, N).end; \ + } \ + else \ + { \ + (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ + } \ + while (false) +# endif + + +// Enable debugging if requested. +#if ARCDEBUG + +// A pseudo ostream that takes yydebug_ into account. +# define YYCDEBUG if (yydebug_) (*yycdebug_) + +# define YY_SYMBOL_PRINT(Title, Symbol) \ + do { \ + if (yydebug_) \ + { \ + *yycdebug_ << Title << ' '; \ + yy_print_ (*yycdebug_, Symbol); \ + *yycdebug_ << '\n'; \ + } \ + } while (false) + +# define YY_REDUCE_PRINT(Rule) \ + do { \ + if (yydebug_) \ + yy_reduce_print_ (Rule); \ + } while (false) + +# define YY_STACK_PRINT() \ + do { \ + if (yydebug_) \ + yy_stack_print_ (); \ + } while (false) + +#else // !ARCDEBUG + +# define YYCDEBUG if (false) std::cerr +# define YY_SYMBOL_PRINT(Title, Symbol) YY_USE (Symbol) +# define YY_REDUCE_PRINT(Rule) static_cast (0) +# define YY_STACK_PRINT() static_cast (0) + +#endif // !ARCDEBUG + +#define yyerrok (yyerrstatus_ = 0) +#define yyclearin (yyla.clear ()) + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab +#define YYRECOVERING() (!!yyerrstatus_) + +#line 13 "parser.ypp" +namespace xsk { namespace arc { +#line 153 "parser.cpp" + + /// Build a parser object. + parser::parser (xsk::arc::context const* ctx__yyarg, xsk::arc::preprocessor& ppr_yyarg, xsk::arc::program::ptr& ast_yyarg, std::uint32_t index_yyarg) +#if ARCDEBUG + : yydebug_ (false), + yycdebug_ (&std::cerr), +#else + : +#endif + yy_lac_established_ (false), + ctx_ (ctx__yyarg), + ppr (ppr_yyarg), + ast (ast_yyarg), + index (index_yyarg) + {} + + parser::~parser () + {} + + parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW + {} + + /*---------. + | symbol. | + `---------*/ + + + + // by_state. + parser::by_state::by_state () YY_NOEXCEPT + : state (empty_state) + {} + + parser::by_state::by_state (const by_state& that) YY_NOEXCEPT + : state (that.state) + {} + + void + parser::by_state::clear () YY_NOEXCEPT + { + state = empty_state; + } + + void + parser::by_state::move (by_state& that) + { + state = that.state; + that.clear (); + } + + parser::by_state::by_state (state_type s) YY_NOEXCEPT + : state (s) + {} + + parser::symbol_kind_type + parser::by_state::kind () const YY_NOEXCEPT + { + if (state == empty_state) + return symbol_kind::S_YYEMPTY; + else + return YY_CAST (symbol_kind_type, yystos_[+state]); + } + + parser::stack_symbol_type::stack_symbol_type () + {} + + parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) + : super_type (YY_MOVE (that.state), YY_MOVE (that.location)) + { + switch (that.kind ()) + { + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_pointer: // expr_pointer + value.YY_MOVE_OR_COPY< call::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_declaration: // declaration + value.YY_MOVE_OR_COPY< decl::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_decl_function: // decl_function + value.YY_MOVE_OR_COPY< decl_function::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_decl_usingtree: // decl_usingtree + value.YY_MOVE_OR_COPY< decl_usingtree::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_or_empty: // expr_or_empty + case symbol_kind::S_expr_increment: // expr_increment + case symbol_kind::S_expr_decrement: // expr_decrement + case symbol_kind::S_expr_assign: // expr_assign + case symbol_kind::S_expr_ternary: // expr_ternary + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + case symbol_kind::S_expr_parameters_default: // expr_parameters_default + case symbol_kind::S_expr_object: // expr_object + value.YY_MOVE_OR_COPY< expr::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_abs: // expr_abs + value.YY_MOVE_OR_COPY< expr_abs::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_angleclamp180: // expr_angleclamp180 + value.YY_MOVE_OR_COPY< expr_angleclamp180::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_anglestoforward: // expr_anglestoforward + value.YY_MOVE_OR_COPY< expr_anglestoforward::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_anglestoright: // expr_anglestoright + value.YY_MOVE_OR_COPY< expr_anglestoright::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_anglestoup: // expr_anglestoup + value.YY_MOVE_OR_COPY< expr_anglestoup::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_anim: // expr_anim + value.YY_MOVE_OR_COPY< expr_anim::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_animation: // expr_animation + value.YY_MOVE_OR_COPY< expr_animation::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_animtree: // expr_animtree + value.YY_MOVE_OR_COPY< expr_animtree::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty + value.YY_MOVE_OR_COPY< expr_arguments::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_array: // expr_array + value.YY_MOVE_OR_COPY< expr_array::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + value.YY_MOVE_OR_COPY< expr_call::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_complement: // expr_complement + value.YY_MOVE_OR_COPY< expr_complement::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_empty_array: // expr_empty_array + value.YY_MOVE_OR_COPY< expr_empty_array::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_false: // expr_false + value.YY_MOVE_OR_COPY< expr_false::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_field: // expr_field + value.YY_MOVE_OR_COPY< expr_field::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_float: // expr_float + value.YY_MOVE_OR_COPY< expr_float::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_game: // expr_game + value.YY_MOVE_OR_COPY< expr_game::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_getdvar: // expr_getdvar + value.YY_MOVE_OR_COPY< expr_getdvar::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_getdvarcoloralpha: // expr_getdvarcoloralpha + value.YY_MOVE_OR_COPY< expr_getdvarcoloralpha::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_getdvarcolorblue: // expr_getdvarcolorblue + value.YY_MOVE_OR_COPY< expr_getdvarcolorblue::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_getdvarcolorgreen: // expr_getdvarcolorgreen + value.YY_MOVE_OR_COPY< expr_getdvarcolorgreen::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_getdvarcolorred: // expr_getdvarcolorred + value.YY_MOVE_OR_COPY< expr_getdvarcolorred::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_getdvarfloat: // expr_getdvarfloat + value.YY_MOVE_OR_COPY< expr_getdvarfloat::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_getdvarint: // expr_getdvarint + value.YY_MOVE_OR_COPY< expr_getdvarint::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_getdvarvector: // expr_getdvarvector + value.YY_MOVE_OR_COPY< expr_getdvarvector::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_getfirstarraykey: // expr_getfirstarraykey + value.YY_MOVE_OR_COPY< expr_getfirstarraykey::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_getnextarraykey: // expr_getnextarraykey + value.YY_MOVE_OR_COPY< expr_getnextarraykey::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_gettime: // expr_gettime + value.YY_MOVE_OR_COPY< expr_gettime::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_hash: // expr_hash + value.YY_MOVE_OR_COPY< expr_hash::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize + case symbol_kind::S_expr_identifier: // expr_identifier + value.YY_MOVE_OR_COPY< expr_identifier::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_integer: // expr_integer + value.YY_MOVE_OR_COPY< expr_integer::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_isdefined: // expr_isdefined + value.YY_MOVE_OR_COPY< expr_isdefined::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_istring: // expr_istring + value.YY_MOVE_OR_COPY< expr_istring::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_level: // expr_level + value.YY_MOVE_OR_COPY< expr_level::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_method: // expr_method + value.YY_MOVE_OR_COPY< expr_method::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_negate: // expr_negate + value.YY_MOVE_OR_COPY< expr_negate::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_not: // expr_not + value.YY_MOVE_OR_COPY< expr_not::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_parameters: // expr_parameters + value.YY_MOVE_OR_COPY< expr_parameters::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_paren: // expr_paren + value.YY_MOVE_OR_COPY< expr_paren::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_path: // expr_path + value.YY_MOVE_OR_COPY< expr_path::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_reference: // expr_reference + value.YY_MOVE_OR_COPY< expr_reference::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_self: // expr_self + value.YY_MOVE_OR_COPY< expr_self::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_size: // expr_size + value.YY_MOVE_OR_COPY< expr_size::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_string: // expr_string + value.YY_MOVE_OR_COPY< expr_string::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_true: // expr_true + value.YY_MOVE_OR_COPY< expr_true::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_undefined: // expr_undefined + value.YY_MOVE_OR_COPY< expr_undefined::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_vector: // expr_vector + value.YY_MOVE_OR_COPY< expr_vector::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_vectorscale: // expr_vectorscale + value.YY_MOVE_OR_COPY< expr_vectorscale::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_vectortoangles: // expr_vectortoangles + value.YY_MOVE_OR_COPY< expr_vectortoangles::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.YY_MOVE_OR_COPY< include::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.YY_MOVE_OR_COPY< program::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_PATH: // "path" + case symbol_kind::S_IDENTIFIER: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_HASHSTR: // "hash string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "integer" + value.YY_MOVE_OR_COPY< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_stmt_or_dev: // stmt_or_dev + value.YY_MOVE_OR_COPY< stmt::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.YY_MOVE_OR_COPY< stmt_break::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.YY_MOVE_OR_COPY< stmt_case::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_comp: // stmt_comp + value.YY_MOVE_OR_COPY< stmt_comp::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.YY_MOVE_OR_COPY< stmt_continue::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.YY_MOVE_OR_COPY< stmt_default::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_dev: // stmt_dev + value.YY_MOVE_OR_COPY< stmt_dev::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_dowhile: // stmt_dowhile + value.YY_MOVE_OR_COPY< stmt_dowhile::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.YY_MOVE_OR_COPY< stmt_endon::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_expr: // stmt_expr + case symbol_kind::S_stmt_call: // stmt_call + case symbol_kind::S_stmt_const: // stmt_const + case symbol_kind::S_stmt_assign: // stmt_assign + value.YY_MOVE_OR_COPY< stmt_expr::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.YY_MOVE_OR_COPY< stmt_for::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.YY_MOVE_OR_COPY< stmt_foreach::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.YY_MOVE_OR_COPY< stmt_if::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.YY_MOVE_OR_COPY< stmt_ifelse::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_list: // stmt_list + case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list + value.YY_MOVE_OR_COPY< stmt_list::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.YY_MOVE_OR_COPY< stmt_notify::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin + value.YY_MOVE_OR_COPY< stmt_prof_begin::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_prof_end: // stmt_prof_end + value.YY_MOVE_OR_COPY< stmt_prof_end::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.YY_MOVE_OR_COPY< stmt_return::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.YY_MOVE_OR_COPY< stmt_switch::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.YY_MOVE_OR_COPY< stmt_wait::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.YY_MOVE_OR_COPY< stmt_waittill::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.YY_MOVE_OR_COPY< stmt_waittillframeend::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.YY_MOVE_OR_COPY< stmt_waittillmatch::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.YY_MOVE_OR_COPY< stmt_while::ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + +#if 201103L <= YY_CPLUSPLUS + // that is emptied. + that.state = empty_state; +#endif + } + + parser::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that) + : super_type (s, YY_MOVE (that.location)) + { + switch (that.kind ()) + { + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_pointer: // expr_pointer + value.move< call::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_declaration: // declaration + value.move< decl::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_decl_function: // decl_function + value.move< decl_function::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_decl_usingtree: // decl_usingtree + value.move< decl_usingtree::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_or_empty: // expr_or_empty + case symbol_kind::S_expr_increment: // expr_increment + case symbol_kind::S_expr_decrement: // expr_decrement + case symbol_kind::S_expr_assign: // expr_assign + case symbol_kind::S_expr_ternary: // expr_ternary + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + case symbol_kind::S_expr_parameters_default: // expr_parameters_default + case symbol_kind::S_expr_object: // expr_object + value.move< expr::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_abs: // expr_abs + value.move< expr_abs::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_angleclamp180: // expr_angleclamp180 + value.move< expr_angleclamp180::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_anglestoforward: // expr_anglestoforward + value.move< expr_anglestoforward::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_anglestoright: // expr_anglestoright + value.move< expr_anglestoright::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_anglestoup: // expr_anglestoup + value.move< expr_anglestoup::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_anim: // expr_anim + value.move< expr_anim::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_animation: // expr_animation + value.move< expr_animation::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_animtree: // expr_animtree + value.move< expr_animtree::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty + value.move< expr_arguments::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_array: // expr_array + value.move< expr_array::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_call: // expr_call + value.move< expr_call::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_complement: // expr_complement + value.move< expr_complement::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_empty_array: // expr_empty_array + value.move< expr_empty_array::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_false: // expr_false + value.move< expr_false::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_field: // expr_field + value.move< expr_field::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_float: // expr_float + value.move< expr_float::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_game: // expr_game + value.move< expr_game::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_getdvar: // expr_getdvar + value.move< expr_getdvar::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_getdvarcoloralpha: // expr_getdvarcoloralpha + value.move< expr_getdvarcoloralpha::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_getdvarcolorblue: // expr_getdvarcolorblue + value.move< expr_getdvarcolorblue::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_getdvarcolorgreen: // expr_getdvarcolorgreen + value.move< expr_getdvarcolorgreen::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_getdvarcolorred: // expr_getdvarcolorred + value.move< expr_getdvarcolorred::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_getdvarfloat: // expr_getdvarfloat + value.move< expr_getdvarfloat::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_getdvarint: // expr_getdvarint + value.move< expr_getdvarint::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_getdvarvector: // expr_getdvarvector + value.move< expr_getdvarvector::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_getfirstarraykey: // expr_getfirstarraykey + value.move< expr_getfirstarraykey::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_getnextarraykey: // expr_getnextarraykey + value.move< expr_getnextarraykey::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_gettime: // expr_gettime + value.move< expr_gettime::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_hash: // expr_hash + value.move< expr_hash::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize + case symbol_kind::S_expr_identifier: // expr_identifier + value.move< expr_identifier::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_integer: // expr_integer + value.move< expr_integer::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_isdefined: // expr_isdefined + value.move< expr_isdefined::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_istring: // expr_istring + value.move< expr_istring::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_level: // expr_level + value.move< expr_level::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_method: // expr_method + value.move< expr_method::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_negate: // expr_negate + value.move< expr_negate::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_not: // expr_not + value.move< expr_not::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_parameters: // expr_parameters + value.move< expr_parameters::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_paren: // expr_paren + value.move< expr_paren::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_path: // expr_path + value.move< expr_path::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_reference: // expr_reference + value.move< expr_reference::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_self: // expr_self + value.move< expr_self::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_size: // expr_size + value.move< expr_size::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_string: // expr_string + value.move< expr_string::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_true: // expr_true + value.move< expr_true::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_undefined: // expr_undefined + value.move< expr_undefined::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_vector: // expr_vector + value.move< expr_vector::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_vectorscale: // expr_vectorscale + value.move< expr_vectorscale::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_vectortoangles: // expr_vectortoangles + value.move< expr_vectortoangles::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.move< include::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_program: // program + value.move< program::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_PATH: // "path" + case symbol_kind::S_IDENTIFIER: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_HASHSTR: // "hash string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "integer" + value.move< std::string > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_stmt_or_dev: // stmt_or_dev + value.move< stmt::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_comp: // stmt_comp + value.move< stmt_comp::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_dev: // stmt_dev + value.move< stmt_dev::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_dowhile: // stmt_dowhile + value.move< stmt_dowhile::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_expr: // stmt_expr + case symbol_kind::S_stmt_call: // stmt_call + case symbol_kind::S_stmt_const: // stmt_const + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_expr::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_list: // stmt_list + case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list + value.move< stmt_list::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin + value.move< stmt_prof_begin::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_prof_end: // stmt_prof_end + value.move< stmt_prof_end::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while::ptr > (YY_MOVE (that.value)); + break; + + default: + break; + } + + // that is emptied. + that.kind_ = symbol_kind::S_YYEMPTY; + } + +#if YY_CPLUSPLUS < 201103L + parser::stack_symbol_type& + parser::stack_symbol_type::operator= (const stack_symbol_type& that) + { + state = that.state; + switch (that.kind ()) + { + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_pointer: // expr_pointer + value.copy< call::ptr > (that.value); + break; + + case symbol_kind::S_declaration: // declaration + value.copy< decl::ptr > (that.value); + break; + + case symbol_kind::S_decl_function: // decl_function + value.copy< decl_function::ptr > (that.value); + break; + + case symbol_kind::S_decl_usingtree: // decl_usingtree + value.copy< decl_usingtree::ptr > (that.value); + break; + + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_or_empty: // expr_or_empty + case symbol_kind::S_expr_increment: // expr_increment + case symbol_kind::S_expr_decrement: // expr_decrement + case symbol_kind::S_expr_assign: // expr_assign + case symbol_kind::S_expr_ternary: // expr_ternary + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + case symbol_kind::S_expr_parameters_default: // expr_parameters_default + case symbol_kind::S_expr_object: // expr_object + value.copy< expr::ptr > (that.value); + break; + + case symbol_kind::S_expr_abs: // expr_abs + value.copy< expr_abs::ptr > (that.value); + break; + + case symbol_kind::S_expr_angleclamp180: // expr_angleclamp180 + value.copy< expr_angleclamp180::ptr > (that.value); + break; + + case symbol_kind::S_expr_anglestoforward: // expr_anglestoforward + value.copy< expr_anglestoforward::ptr > (that.value); + break; + + case symbol_kind::S_expr_anglestoright: // expr_anglestoright + value.copy< expr_anglestoright::ptr > (that.value); + break; + + case symbol_kind::S_expr_anglestoup: // expr_anglestoup + value.copy< expr_anglestoup::ptr > (that.value); + break; + + case symbol_kind::S_expr_anim: // expr_anim + value.copy< expr_anim::ptr > (that.value); + break; + + case symbol_kind::S_expr_animation: // expr_animation + value.copy< expr_animation::ptr > (that.value); + break; + + case symbol_kind::S_expr_animtree: // expr_animtree + value.copy< expr_animtree::ptr > (that.value); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty + value.copy< expr_arguments::ptr > (that.value); + break; + + case symbol_kind::S_expr_array: // expr_array + value.copy< expr_array::ptr > (that.value); + break; + + case symbol_kind::S_expr_call: // expr_call + value.copy< expr_call::ptr > (that.value); + break; + + case symbol_kind::S_expr_complement: // expr_complement + value.copy< expr_complement::ptr > (that.value); + break; + + case symbol_kind::S_expr_empty_array: // expr_empty_array + value.copy< expr_empty_array::ptr > (that.value); + break; + + case symbol_kind::S_expr_false: // expr_false + value.copy< expr_false::ptr > (that.value); + break; + + case symbol_kind::S_expr_field: // expr_field + value.copy< expr_field::ptr > (that.value); + break; + + case symbol_kind::S_expr_float: // expr_float + value.copy< expr_float::ptr > (that.value); + break; + + case symbol_kind::S_expr_game: // expr_game + value.copy< expr_game::ptr > (that.value); + break; + + case symbol_kind::S_expr_getdvar: // expr_getdvar + value.copy< expr_getdvar::ptr > (that.value); + break; + + case symbol_kind::S_expr_getdvarcoloralpha: // expr_getdvarcoloralpha + value.copy< expr_getdvarcoloralpha::ptr > (that.value); + break; + + case symbol_kind::S_expr_getdvarcolorblue: // expr_getdvarcolorblue + value.copy< expr_getdvarcolorblue::ptr > (that.value); + break; + + case symbol_kind::S_expr_getdvarcolorgreen: // expr_getdvarcolorgreen + value.copy< expr_getdvarcolorgreen::ptr > (that.value); + break; + + case symbol_kind::S_expr_getdvarcolorred: // expr_getdvarcolorred + value.copy< expr_getdvarcolorred::ptr > (that.value); + break; + + case symbol_kind::S_expr_getdvarfloat: // expr_getdvarfloat + value.copy< expr_getdvarfloat::ptr > (that.value); + break; + + case symbol_kind::S_expr_getdvarint: // expr_getdvarint + value.copy< expr_getdvarint::ptr > (that.value); + break; + + case symbol_kind::S_expr_getdvarvector: // expr_getdvarvector + value.copy< expr_getdvarvector::ptr > (that.value); + break; + + case symbol_kind::S_expr_getfirstarraykey: // expr_getfirstarraykey + value.copy< expr_getfirstarraykey::ptr > (that.value); + break; + + case symbol_kind::S_expr_getnextarraykey: // expr_getnextarraykey + value.copy< expr_getnextarraykey::ptr > (that.value); + break; + + case symbol_kind::S_expr_gettime: // expr_gettime + value.copy< expr_gettime::ptr > (that.value); + break; + + case symbol_kind::S_expr_hash: // expr_hash + value.copy< expr_hash::ptr > (that.value); + break; + + case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize + case symbol_kind::S_expr_identifier: // expr_identifier + value.copy< expr_identifier::ptr > (that.value); + break; + + case symbol_kind::S_expr_integer: // expr_integer + value.copy< expr_integer::ptr > (that.value); + break; + + case symbol_kind::S_expr_isdefined: // expr_isdefined + value.copy< expr_isdefined::ptr > (that.value); + break; + + case symbol_kind::S_expr_istring: // expr_istring + value.copy< expr_istring::ptr > (that.value); + break; + + case symbol_kind::S_expr_level: // expr_level + value.copy< expr_level::ptr > (that.value); + break; + + case symbol_kind::S_expr_method: // expr_method + value.copy< expr_method::ptr > (that.value); + break; + + case symbol_kind::S_expr_negate: // expr_negate + value.copy< expr_negate::ptr > (that.value); + break; + + case symbol_kind::S_expr_not: // expr_not + value.copy< expr_not::ptr > (that.value); + break; + + case symbol_kind::S_expr_parameters: // expr_parameters + value.copy< expr_parameters::ptr > (that.value); + break; + + case symbol_kind::S_expr_paren: // expr_paren + value.copy< expr_paren::ptr > (that.value); + break; + + case symbol_kind::S_expr_path: // expr_path + value.copy< expr_path::ptr > (that.value); + break; + + case symbol_kind::S_expr_reference: // expr_reference + value.copy< expr_reference::ptr > (that.value); + break; + + case symbol_kind::S_expr_self: // expr_self + value.copy< expr_self::ptr > (that.value); + break; + + case symbol_kind::S_expr_size: // expr_size + value.copy< expr_size::ptr > (that.value); + break; + + case symbol_kind::S_expr_string: // expr_string + value.copy< expr_string::ptr > (that.value); + break; + + case symbol_kind::S_expr_true: // expr_true + value.copy< expr_true::ptr > (that.value); + break; + + case symbol_kind::S_expr_undefined: // expr_undefined + value.copy< expr_undefined::ptr > (that.value); + break; + + case symbol_kind::S_expr_vector: // expr_vector + value.copy< expr_vector::ptr > (that.value); + break; + + case symbol_kind::S_expr_vectorscale: // expr_vectorscale + value.copy< expr_vectorscale::ptr > (that.value); + break; + + case symbol_kind::S_expr_vectortoangles: // expr_vectortoangles + value.copy< expr_vectortoangles::ptr > (that.value); + break; + + case symbol_kind::S_include: // include + value.copy< include::ptr > (that.value); + break; + + case symbol_kind::S_program: // program + value.copy< program::ptr > (that.value); + break; + + case symbol_kind::S_PATH: // "path" + case symbol_kind::S_IDENTIFIER: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_HASHSTR: // "hash string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "integer" + value.copy< std::string > (that.value); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_stmt_or_dev: // stmt_or_dev + value.copy< stmt::ptr > (that.value); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.copy< stmt_break::ptr > (that.value); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.copy< stmt_case::ptr > (that.value); + break; + + case symbol_kind::S_stmt_comp: // stmt_comp + value.copy< stmt_comp::ptr > (that.value); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.copy< stmt_continue::ptr > (that.value); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.copy< stmt_default::ptr > (that.value); + break; + + case symbol_kind::S_stmt_dev: // stmt_dev + value.copy< stmt_dev::ptr > (that.value); + break; + + case symbol_kind::S_stmt_dowhile: // stmt_dowhile + value.copy< stmt_dowhile::ptr > (that.value); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.copy< stmt_endon::ptr > (that.value); + break; + + case symbol_kind::S_stmt_expr: // stmt_expr + case symbol_kind::S_stmt_call: // stmt_call + case symbol_kind::S_stmt_const: // stmt_const + case symbol_kind::S_stmt_assign: // stmt_assign + value.copy< stmt_expr::ptr > (that.value); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.copy< stmt_for::ptr > (that.value); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.copy< stmt_foreach::ptr > (that.value); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.copy< stmt_if::ptr > (that.value); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.copy< stmt_ifelse::ptr > (that.value); + break; + + case symbol_kind::S_stmt_list: // stmt_list + case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list + value.copy< stmt_list::ptr > (that.value); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.copy< stmt_notify::ptr > (that.value); + break; + + case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin + value.copy< stmt_prof_begin::ptr > (that.value); + break; + + case symbol_kind::S_stmt_prof_end: // stmt_prof_end + value.copy< stmt_prof_end::ptr > (that.value); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.copy< stmt_return::ptr > (that.value); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.copy< stmt_switch::ptr > (that.value); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.copy< stmt_wait::ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.copy< stmt_waittill::ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.copy< stmt_waittillframeend::ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.copy< stmt_waittillmatch::ptr > (that.value); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.copy< stmt_while::ptr > (that.value); + break; + + default: + break; + } + + location = that.location; + return *this; + } + + parser::stack_symbol_type& + parser::stack_symbol_type::operator= (stack_symbol_type& that) + { + state = that.state; + switch (that.kind ()) + { + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_pointer: // expr_pointer + value.move< call::ptr > (that.value); + break; + + case symbol_kind::S_declaration: // declaration + value.move< decl::ptr > (that.value); + break; + + case symbol_kind::S_decl_function: // decl_function + value.move< decl_function::ptr > (that.value); + break; + + case symbol_kind::S_decl_usingtree: // decl_usingtree + value.move< decl_usingtree::ptr > (that.value); + break; + + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_or_empty: // expr_or_empty + case symbol_kind::S_expr_increment: // expr_increment + case symbol_kind::S_expr_decrement: // expr_decrement + case symbol_kind::S_expr_assign: // expr_assign + case symbol_kind::S_expr_ternary: // expr_ternary + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + case symbol_kind::S_expr_parameters_default: // expr_parameters_default + case symbol_kind::S_expr_object: // expr_object + value.move< expr::ptr > (that.value); + break; + + case symbol_kind::S_expr_abs: // expr_abs + value.move< expr_abs::ptr > (that.value); + break; + + case symbol_kind::S_expr_angleclamp180: // expr_angleclamp180 + value.move< expr_angleclamp180::ptr > (that.value); + break; + + case symbol_kind::S_expr_anglestoforward: // expr_anglestoforward + value.move< expr_anglestoforward::ptr > (that.value); + break; + + case symbol_kind::S_expr_anglestoright: // expr_anglestoright + value.move< expr_anglestoright::ptr > (that.value); + break; + + case symbol_kind::S_expr_anglestoup: // expr_anglestoup + value.move< expr_anglestoup::ptr > (that.value); + break; + + case symbol_kind::S_expr_anim: // expr_anim + value.move< expr_anim::ptr > (that.value); + break; + + case symbol_kind::S_expr_animation: // expr_animation + value.move< expr_animation::ptr > (that.value); + break; + + case symbol_kind::S_expr_animtree: // expr_animtree + value.move< expr_animtree::ptr > (that.value); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty + value.move< expr_arguments::ptr > (that.value); + break; + + case symbol_kind::S_expr_array: // expr_array + value.move< expr_array::ptr > (that.value); + break; + + case symbol_kind::S_expr_call: // expr_call + value.move< expr_call::ptr > (that.value); + break; + + case symbol_kind::S_expr_complement: // expr_complement + value.move< expr_complement::ptr > (that.value); + break; + + case symbol_kind::S_expr_empty_array: // expr_empty_array + value.move< expr_empty_array::ptr > (that.value); + break; + + case symbol_kind::S_expr_false: // expr_false + value.move< expr_false::ptr > (that.value); + break; + + case symbol_kind::S_expr_field: // expr_field + value.move< expr_field::ptr > (that.value); + break; + + case symbol_kind::S_expr_float: // expr_float + value.move< expr_float::ptr > (that.value); + break; + + case symbol_kind::S_expr_game: // expr_game + value.move< expr_game::ptr > (that.value); + break; + + case symbol_kind::S_expr_getdvar: // expr_getdvar + value.move< expr_getdvar::ptr > (that.value); + break; + + case symbol_kind::S_expr_getdvarcoloralpha: // expr_getdvarcoloralpha + value.move< expr_getdvarcoloralpha::ptr > (that.value); + break; + + case symbol_kind::S_expr_getdvarcolorblue: // expr_getdvarcolorblue + value.move< expr_getdvarcolorblue::ptr > (that.value); + break; + + case symbol_kind::S_expr_getdvarcolorgreen: // expr_getdvarcolorgreen + value.move< expr_getdvarcolorgreen::ptr > (that.value); + break; + + case symbol_kind::S_expr_getdvarcolorred: // expr_getdvarcolorred + value.move< expr_getdvarcolorred::ptr > (that.value); + break; + + case symbol_kind::S_expr_getdvarfloat: // expr_getdvarfloat + value.move< expr_getdvarfloat::ptr > (that.value); + break; + + case symbol_kind::S_expr_getdvarint: // expr_getdvarint + value.move< expr_getdvarint::ptr > (that.value); + break; + + case symbol_kind::S_expr_getdvarvector: // expr_getdvarvector + value.move< expr_getdvarvector::ptr > (that.value); + break; + + case symbol_kind::S_expr_getfirstarraykey: // expr_getfirstarraykey + value.move< expr_getfirstarraykey::ptr > (that.value); + break; + + case symbol_kind::S_expr_getnextarraykey: // expr_getnextarraykey + value.move< expr_getnextarraykey::ptr > (that.value); + break; + + case symbol_kind::S_expr_gettime: // expr_gettime + value.move< expr_gettime::ptr > (that.value); + break; + + case symbol_kind::S_expr_hash: // expr_hash + value.move< expr_hash::ptr > (that.value); + break; + + case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize + case symbol_kind::S_expr_identifier: // expr_identifier + value.move< expr_identifier::ptr > (that.value); + break; + + case symbol_kind::S_expr_integer: // expr_integer + value.move< expr_integer::ptr > (that.value); + break; + + case symbol_kind::S_expr_isdefined: // expr_isdefined + value.move< expr_isdefined::ptr > (that.value); + break; + + case symbol_kind::S_expr_istring: // expr_istring + value.move< expr_istring::ptr > (that.value); + break; + + case symbol_kind::S_expr_level: // expr_level + value.move< expr_level::ptr > (that.value); + break; + + case symbol_kind::S_expr_method: // expr_method + value.move< expr_method::ptr > (that.value); + break; + + case symbol_kind::S_expr_negate: // expr_negate + value.move< expr_negate::ptr > (that.value); + break; + + case symbol_kind::S_expr_not: // expr_not + value.move< expr_not::ptr > (that.value); + break; + + case symbol_kind::S_expr_parameters: // expr_parameters + value.move< expr_parameters::ptr > (that.value); + break; + + case symbol_kind::S_expr_paren: // expr_paren + value.move< expr_paren::ptr > (that.value); + break; + + case symbol_kind::S_expr_path: // expr_path + value.move< expr_path::ptr > (that.value); + break; + + case symbol_kind::S_expr_reference: // expr_reference + value.move< expr_reference::ptr > (that.value); + break; + + case symbol_kind::S_expr_self: // expr_self + value.move< expr_self::ptr > (that.value); + break; + + case symbol_kind::S_expr_size: // expr_size + value.move< expr_size::ptr > (that.value); + break; + + case symbol_kind::S_expr_string: // expr_string + value.move< expr_string::ptr > (that.value); + break; + + case symbol_kind::S_expr_true: // expr_true + value.move< expr_true::ptr > (that.value); + break; + + case symbol_kind::S_expr_undefined: // expr_undefined + value.move< expr_undefined::ptr > (that.value); + break; + + case symbol_kind::S_expr_vector: // expr_vector + value.move< expr_vector::ptr > (that.value); + break; + + case symbol_kind::S_expr_vectorscale: // expr_vectorscale + value.move< expr_vectorscale::ptr > (that.value); + break; + + case symbol_kind::S_expr_vectortoangles: // expr_vectortoangles + value.move< expr_vectortoangles::ptr > (that.value); + break; + + case symbol_kind::S_include: // include + value.move< include::ptr > (that.value); + break; + + case symbol_kind::S_program: // program + value.move< program::ptr > (that.value); + break; + + case symbol_kind::S_PATH: // "path" + case symbol_kind::S_IDENTIFIER: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_HASHSTR: // "hash string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "integer" + value.move< std::string > (that.value); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_stmt_or_dev: // stmt_or_dev + value.move< stmt::ptr > (that.value); + break; + + case symbol_kind::S_stmt_break: // stmt_break + value.move< stmt_break::ptr > (that.value); + break; + + case symbol_kind::S_stmt_case: // stmt_case + value.move< stmt_case::ptr > (that.value); + break; + + case symbol_kind::S_stmt_comp: // stmt_comp + value.move< stmt_comp::ptr > (that.value); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + value.move< stmt_continue::ptr > (that.value); + break; + + case symbol_kind::S_stmt_default: // stmt_default + value.move< stmt_default::ptr > (that.value); + break; + + case symbol_kind::S_stmt_dev: // stmt_dev + value.move< stmt_dev::ptr > (that.value); + break; + + case symbol_kind::S_stmt_dowhile: // stmt_dowhile + value.move< stmt_dowhile::ptr > (that.value); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + value.move< stmt_endon::ptr > (that.value); + break; + + case symbol_kind::S_stmt_expr: // stmt_expr + case symbol_kind::S_stmt_call: // stmt_call + case symbol_kind::S_stmt_const: // stmt_const + case symbol_kind::S_stmt_assign: // stmt_assign + value.move< stmt_expr::ptr > (that.value); + break; + + case symbol_kind::S_stmt_for: // stmt_for + value.move< stmt_for::ptr > (that.value); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + value.move< stmt_foreach::ptr > (that.value); + break; + + case symbol_kind::S_stmt_if: // stmt_if + value.move< stmt_if::ptr > (that.value); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + value.move< stmt_ifelse::ptr > (that.value); + break; + + case symbol_kind::S_stmt_list: // stmt_list + case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list + value.move< stmt_list::ptr > (that.value); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + value.move< stmt_notify::ptr > (that.value); + break; + + case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin + value.move< stmt_prof_begin::ptr > (that.value); + break; + + case symbol_kind::S_stmt_prof_end: // stmt_prof_end + value.move< stmt_prof_end::ptr > (that.value); + break; + + case symbol_kind::S_stmt_return: // stmt_return + value.move< stmt_return::ptr > (that.value); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + value.move< stmt_switch::ptr > (that.value); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + value.move< stmt_wait::ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + value.move< stmt_waittill::ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + value.move< stmt_waittillframeend::ptr > (that.value); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + value.move< stmt_waittillmatch::ptr > (that.value); + break; + + case symbol_kind::S_stmt_while: // stmt_while + value.move< stmt_while::ptr > (that.value); + break; + + default: + break; + } + + location = that.location; + // that is emptied. + that.state = empty_state; + return *this; + } +#endif + + template + void + parser::yy_destroy_ (const char* yymsg, basic_symbol& yysym) const + { + if (yymsg) + YY_SYMBOL_PRINT (yymsg, yysym); + } + +#if ARCDEBUG + template + void + parser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const + { + std::ostream& yyoutput = yyo; + YY_USE (yyoutput); + if (yysym.empty ()) + yyo << "empty symbol"; + else + { + symbol_kind_type yykind = yysym.kind (); + yyo << (yykind < YYNTOKENS ? "token" : "nterm") + << ' ' << yysym.name () << " (" + << yysym.location << ": "; + YY_USE (yykind); + yyo << ')'; + } + } +#endif + + void + parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) + { + if (m) + YY_SYMBOL_PRINT (m, sym); + yystack_.push (YY_MOVE (sym)); + } + + void + parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) + { +#if 201103L <= YY_CPLUSPLUS + yypush_ (m, stack_symbol_type (s, std::move (sym))); +#else + stack_symbol_type ss (s, sym); + yypush_ (m, ss); +#endif + } + + void + parser::yypop_ (int n) YY_NOEXCEPT + { + yystack_.pop (n); + } + +#if ARCDEBUG + std::ostream& + parser::debug_stream () const + { + return *yycdebug_; + } + + void + parser::set_debug_stream (std::ostream& o) + { + yycdebug_ = &o; + } + + + parser::debug_level_type + parser::debug_level () const + { + return yydebug_; + } + + void + parser::set_debug_level (debug_level_type l) + { + yydebug_ = l; + } +#endif // ARCDEBUG + + parser::state_type + parser::yy_lr_goto_state_ (state_type yystate, int yysym) + { + int yyr = yypgoto_[yysym - YYNTOKENS] + yystate; + if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) + return yytable_[yyr]; + else + return yydefgoto_[yysym - YYNTOKENS]; + } + + bool + parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT + { + return yyvalue == yypact_ninf_; + } + + bool + parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT + { + return yyvalue == yytable_ninf_; + } + + int + parser::operator() () + { + return parse (); + } + + int + parser::parse () + { + int yyn; + /// Length of the RHS of the rule being reduced. + int yylen = 0; + + // Error handling. + int yynerrs_ = 0; + int yyerrstatus_ = 0; + + /// The lookahead symbol. + symbol_type yyla; + + /// The locations where the error started and ended. + stack_symbol_type yyerror_range[3]; + + /// The return value of parse (). + int yyresult; + + // Discard the LAC context in case there still is one left from a + // previous invocation. + yy_lac_discard_ ("init"); + +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + YYCDEBUG << "Starting parse\n"; + + + /* Initialize the stack. The initial state will be set in + yynewstate, since the latter expects the semantical and the + location values to have been already stored, initialize these + stacks with a primary value. */ + yystack_.clear (); + yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); + + /*-----------------------------------------------. + | yynewstate -- push a new symbol on the stack. | + `-----------------------------------------------*/ + yynewstate: + YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; + YY_STACK_PRINT (); + + // Accept? + if (yystack_[0].state == yyfinal_) + YYACCEPT; + + goto yybackup; + + + /*-----------. + | yybackup. | + `-----------*/ + yybackup: + // Try to take a decision without lookahead. + yyn = yypact_[+yystack_[0].state]; + if (yy_pact_value_is_default_ (yyn)) + goto yydefault; + + // Read a lookahead token. + if (yyla.empty ()) + { + YYCDEBUG << "Reading a token\n"; +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + symbol_type yylookahead (yylex (ctx_, ppr)); + yyla.move (yylookahead); + } +#if YY_EXCEPTIONS + catch (const syntax_error& yyexc) + { + YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; + error (yyexc); + goto yyerrlab1; + } +#endif // YY_EXCEPTIONS + } + YY_SYMBOL_PRINT ("Next token is", yyla); + + if (yyla.kind () == symbol_kind::S_YYerror) + { + // The scanner already issued an error message, process directly + // to error recovery. But do not keep the error token as + // lookahead, it is too special and may lead us to an endless + // loop in error recovery. */ + yyla.kind_ = symbol_kind::S_YYUNDEF; + goto yyerrlab1; + } + + /* If the proper action on seeing token YYLA.TYPE is to reduce or + to detect an error, take that action. */ + yyn += yyla.kind (); + if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) + { + if (!yy_lac_establish_ (yyla.kind ())) + goto yyerrlab; + goto yydefault; + } + + // Reduce or error. + yyn = yytable_[yyn]; + if (yyn <= 0) + { + if (yy_table_value_is_error_ (yyn)) + goto yyerrlab; + if (!yy_lac_establish_ (yyla.kind ())) + goto yyerrlab; + + yyn = -yyn; + goto yyreduce; + } + + // Count tokens shifted since error; after three, turn off error status. + if (yyerrstatus_) + --yyerrstatus_; + + // Shift the lookahead token. + yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); + yy_lac_discard_ ("shift"); + goto yynewstate; + + + /*-----------------------------------------------------------. + | yydefault -- do the default action for the current state. | + `-----------------------------------------------------------*/ + yydefault: + yyn = yydefact_[+yystack_[0].state]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + + /*-----------------------------. + | yyreduce -- do a reduction. | + `-----------------------------*/ + yyreduce: + yylen = yyr2_[yyn]; + { + stack_symbol_type yylhs; + yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); + /* Variants are always initialized to an empty instance of the + correct type. The default '$$ = $1' action is NOT applied + when using variants. */ + switch (yyr1_[yyn]) + { + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_pointer: // expr_pointer + yylhs.value.emplace< call::ptr > (); + break; + + case symbol_kind::S_declaration: // declaration + yylhs.value.emplace< decl::ptr > (); + break; + + case symbol_kind::S_decl_function: // decl_function + yylhs.value.emplace< decl_function::ptr > (); + break; + + case symbol_kind::S_decl_usingtree: // decl_usingtree + yylhs.value.emplace< decl_usingtree::ptr > (); + break; + + case symbol_kind::S_expr: // expr + case symbol_kind::S_expr_or_empty: // expr_or_empty + case symbol_kind::S_expr_increment: // expr_increment + case symbol_kind::S_expr_decrement: // expr_decrement + case symbol_kind::S_expr_assign: // expr_assign + case symbol_kind::S_expr_ternary: // expr_ternary + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + case symbol_kind::S_expr_parameters_default: // expr_parameters_default + case symbol_kind::S_expr_object: // expr_object + yylhs.value.emplace< expr::ptr > (); + break; + + case symbol_kind::S_expr_abs: // expr_abs + yylhs.value.emplace< expr_abs::ptr > (); + break; + + case symbol_kind::S_expr_angleclamp180: // expr_angleclamp180 + yylhs.value.emplace< expr_angleclamp180::ptr > (); + break; + + case symbol_kind::S_expr_anglestoforward: // expr_anglestoforward + yylhs.value.emplace< expr_anglestoforward::ptr > (); + break; + + case symbol_kind::S_expr_anglestoright: // expr_anglestoright + yylhs.value.emplace< expr_anglestoright::ptr > (); + break; + + case symbol_kind::S_expr_anglestoup: // expr_anglestoup + yylhs.value.emplace< expr_anglestoup::ptr > (); + break; + + case symbol_kind::S_expr_anim: // expr_anim + yylhs.value.emplace< expr_anim::ptr > (); + break; + + case symbol_kind::S_expr_animation: // expr_animation + yylhs.value.emplace< expr_animation::ptr > (); + break; + + case symbol_kind::S_expr_animtree: // expr_animtree + yylhs.value.emplace< expr_animtree::ptr > (); + break; + + case symbol_kind::S_expr_arguments: // expr_arguments + case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty + yylhs.value.emplace< expr_arguments::ptr > (); + break; + + case symbol_kind::S_expr_array: // expr_array + yylhs.value.emplace< expr_array::ptr > (); + break; + + case symbol_kind::S_expr_call: // expr_call + yylhs.value.emplace< expr_call::ptr > (); + break; + + case symbol_kind::S_expr_complement: // expr_complement + yylhs.value.emplace< expr_complement::ptr > (); + break; + + case symbol_kind::S_expr_empty_array: // expr_empty_array + yylhs.value.emplace< expr_empty_array::ptr > (); + break; + + case symbol_kind::S_expr_false: // expr_false + yylhs.value.emplace< expr_false::ptr > (); + break; + + case symbol_kind::S_expr_field: // expr_field + yylhs.value.emplace< expr_field::ptr > (); + break; + + case symbol_kind::S_expr_float: // expr_float + yylhs.value.emplace< expr_float::ptr > (); + break; + + case symbol_kind::S_expr_game: // expr_game + yylhs.value.emplace< expr_game::ptr > (); + break; + + case symbol_kind::S_expr_getdvar: // expr_getdvar + yylhs.value.emplace< expr_getdvar::ptr > (); + break; + + case symbol_kind::S_expr_getdvarcoloralpha: // expr_getdvarcoloralpha + yylhs.value.emplace< expr_getdvarcoloralpha::ptr > (); + break; + + case symbol_kind::S_expr_getdvarcolorblue: // expr_getdvarcolorblue + yylhs.value.emplace< expr_getdvarcolorblue::ptr > (); + break; + + case symbol_kind::S_expr_getdvarcolorgreen: // expr_getdvarcolorgreen + yylhs.value.emplace< expr_getdvarcolorgreen::ptr > (); + break; + + case symbol_kind::S_expr_getdvarcolorred: // expr_getdvarcolorred + yylhs.value.emplace< expr_getdvarcolorred::ptr > (); + break; + + case symbol_kind::S_expr_getdvarfloat: // expr_getdvarfloat + yylhs.value.emplace< expr_getdvarfloat::ptr > (); + break; + + case symbol_kind::S_expr_getdvarint: // expr_getdvarint + yylhs.value.emplace< expr_getdvarint::ptr > (); + break; + + case symbol_kind::S_expr_getdvarvector: // expr_getdvarvector + yylhs.value.emplace< expr_getdvarvector::ptr > (); + break; + + case symbol_kind::S_expr_getfirstarraykey: // expr_getfirstarraykey + yylhs.value.emplace< expr_getfirstarraykey::ptr > (); + break; + + case symbol_kind::S_expr_getnextarraykey: // expr_getnextarraykey + yylhs.value.emplace< expr_getnextarraykey::ptr > (); + break; + + case symbol_kind::S_expr_gettime: // expr_gettime + yylhs.value.emplace< expr_gettime::ptr > (); + break; + + case symbol_kind::S_expr_hash: // expr_hash + yylhs.value.emplace< expr_hash::ptr > (); + break; + + case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize + case symbol_kind::S_expr_identifier: // expr_identifier + yylhs.value.emplace< expr_identifier::ptr > (); + break; + + case symbol_kind::S_expr_integer: // expr_integer + yylhs.value.emplace< expr_integer::ptr > (); + break; + + case symbol_kind::S_expr_isdefined: // expr_isdefined + yylhs.value.emplace< expr_isdefined::ptr > (); + break; + + case symbol_kind::S_expr_istring: // expr_istring + yylhs.value.emplace< expr_istring::ptr > (); + break; + + case symbol_kind::S_expr_level: // expr_level + yylhs.value.emplace< expr_level::ptr > (); + break; + + case symbol_kind::S_expr_method: // expr_method + yylhs.value.emplace< expr_method::ptr > (); + break; + + case symbol_kind::S_expr_negate: // expr_negate + yylhs.value.emplace< expr_negate::ptr > (); + break; + + case symbol_kind::S_expr_not: // expr_not + yylhs.value.emplace< expr_not::ptr > (); + break; + + case symbol_kind::S_expr_parameters: // expr_parameters + yylhs.value.emplace< expr_parameters::ptr > (); + break; + + case symbol_kind::S_expr_paren: // expr_paren + yylhs.value.emplace< expr_paren::ptr > (); + break; + + case symbol_kind::S_expr_path: // expr_path + yylhs.value.emplace< expr_path::ptr > (); + break; + + case symbol_kind::S_expr_reference: // expr_reference + yylhs.value.emplace< expr_reference::ptr > (); + break; + + case symbol_kind::S_expr_self: // expr_self + yylhs.value.emplace< expr_self::ptr > (); + break; + + case symbol_kind::S_expr_size: // expr_size + yylhs.value.emplace< expr_size::ptr > (); + break; + + case symbol_kind::S_expr_string: // expr_string + yylhs.value.emplace< expr_string::ptr > (); + break; + + case symbol_kind::S_expr_true: // expr_true + yylhs.value.emplace< expr_true::ptr > (); + break; + + case symbol_kind::S_expr_undefined: // expr_undefined + yylhs.value.emplace< expr_undefined::ptr > (); + break; + + case symbol_kind::S_expr_vector: // expr_vector + yylhs.value.emplace< expr_vector::ptr > (); + break; + + case symbol_kind::S_expr_vectorscale: // expr_vectorscale + yylhs.value.emplace< expr_vectorscale::ptr > (); + break; + + case symbol_kind::S_expr_vectortoangles: // expr_vectortoangles + yylhs.value.emplace< expr_vectortoangles::ptr > (); + break; + + case symbol_kind::S_include: // include + yylhs.value.emplace< include::ptr > (); + break; + + case symbol_kind::S_program: // program + yylhs.value.emplace< program::ptr > (); + break; + + case symbol_kind::S_PATH: // "path" + case symbol_kind::S_IDENTIFIER: // "identifier" + case symbol_kind::S_STRING: // "string literal" + case symbol_kind::S_ISTRING: // "localized string" + case symbol_kind::S_HASHSTR: // "hash string" + case symbol_kind::S_FLOAT: // "float" + case symbol_kind::S_INTEGER: // "integer" + yylhs.value.emplace< std::string > (); + break; + + case symbol_kind::S_stmt: // stmt + case symbol_kind::S_stmt_or_dev: // stmt_or_dev + yylhs.value.emplace< stmt::ptr > (); + break; + + case symbol_kind::S_stmt_break: // stmt_break + yylhs.value.emplace< stmt_break::ptr > (); + break; + + case symbol_kind::S_stmt_case: // stmt_case + yylhs.value.emplace< stmt_case::ptr > (); + break; + + case symbol_kind::S_stmt_comp: // stmt_comp + yylhs.value.emplace< stmt_comp::ptr > (); + break; + + case symbol_kind::S_stmt_continue: // stmt_continue + yylhs.value.emplace< stmt_continue::ptr > (); + break; + + case symbol_kind::S_stmt_default: // stmt_default + yylhs.value.emplace< stmt_default::ptr > (); + break; + + case symbol_kind::S_stmt_dev: // stmt_dev + yylhs.value.emplace< stmt_dev::ptr > (); + break; + + case symbol_kind::S_stmt_dowhile: // stmt_dowhile + yylhs.value.emplace< stmt_dowhile::ptr > (); + break; + + case symbol_kind::S_stmt_endon: // stmt_endon + yylhs.value.emplace< stmt_endon::ptr > (); + break; + + case symbol_kind::S_stmt_expr: // stmt_expr + case symbol_kind::S_stmt_call: // stmt_call + case symbol_kind::S_stmt_const: // stmt_const + case symbol_kind::S_stmt_assign: // stmt_assign + yylhs.value.emplace< stmt_expr::ptr > (); + break; + + case symbol_kind::S_stmt_for: // stmt_for + yylhs.value.emplace< stmt_for::ptr > (); + break; + + case symbol_kind::S_stmt_foreach: // stmt_foreach + yylhs.value.emplace< stmt_foreach::ptr > (); + break; + + case symbol_kind::S_stmt_if: // stmt_if + yylhs.value.emplace< stmt_if::ptr > (); + break; + + case symbol_kind::S_stmt_ifelse: // stmt_ifelse + yylhs.value.emplace< stmt_ifelse::ptr > (); + break; + + case symbol_kind::S_stmt_list: // stmt_list + case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list + yylhs.value.emplace< stmt_list::ptr > (); + break; + + case symbol_kind::S_stmt_notify: // stmt_notify + yylhs.value.emplace< stmt_notify::ptr > (); + break; + + case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin + yylhs.value.emplace< stmt_prof_begin::ptr > (); + break; + + case symbol_kind::S_stmt_prof_end: // stmt_prof_end + yylhs.value.emplace< stmt_prof_end::ptr > (); + break; + + case symbol_kind::S_stmt_return: // stmt_return + yylhs.value.emplace< stmt_return::ptr > (); + break; + + case symbol_kind::S_stmt_switch: // stmt_switch + yylhs.value.emplace< stmt_switch::ptr > (); + break; + + case symbol_kind::S_stmt_wait: // stmt_wait + yylhs.value.emplace< stmt_wait::ptr > (); + break; + + case symbol_kind::S_stmt_waittill: // stmt_waittill + yylhs.value.emplace< stmt_waittill::ptr > (); + break; + + case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend + yylhs.value.emplace< stmt_waittillframeend::ptr > (); + break; + + case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch + yylhs.value.emplace< stmt_waittillmatch::ptr > (); + break; + + case symbol_kind::S_stmt_while: // stmt_while + yylhs.value.emplace< stmt_while::ptr > (); + break; + + default: + break; + } + + + // Default location. + { + stack_type::slice range (yystack_, yylen); + YYLLOC_DEFAULT (yylhs.location, range, yylen); + yyerror_range[1].location = yylhs.location; + } + + // Perform the reduction. + YY_REDUCE_PRINT (yyn); +#if YY_EXCEPTIONS + try +#endif // YY_EXCEPTIONS + { + switch (yyn) + { + case 2: // root: program +#line 297 "parser.ypp" + { ast = std::move(yystack_[0].value.as < program::ptr > ()); } +#line 2316 "parser.cpp" + break; + + case 3: // root: %empty +#line 298 "parser.ypp" + { ast = program::make(yylhs.location); } +#line 2322 "parser.cpp" + break; + + case 4: // program: program ";" +#line 303 "parser.ypp" + { yylhs.value.as < program::ptr > () = std::move(yystack_[1].value.as < program::ptr > ()); } +#line 2328 "parser.cpp" + break; + + case 5: // program: program inline +#line 305 "parser.ypp" + { yylhs.value.as < program::ptr > () = std::move(yystack_[1].value.as < program::ptr > ()); } +#line 2334 "parser.cpp" + break; + + case 6: // program: program include +#line 307 "parser.ypp" + { yylhs.value.as < program::ptr > () = std::move(yystack_[1].value.as < program::ptr > ()); yylhs.value.as < program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < include::ptr > ())); } +#line 2340 "parser.cpp" + break; + + case 7: // program: program declaration +#line 309 "parser.ypp" + { yylhs.value.as < program::ptr > () = std::move(yystack_[1].value.as < program::ptr > ()); yylhs.value.as < program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < decl::ptr > ())); } +#line 2346 "parser.cpp" + break; + + case 8: // program: ";" +#line 311 "parser.ypp" + { yylhs.value.as < program::ptr > () = program::make(yylhs.location); } +#line 2352 "parser.cpp" + break; + + case 9: // program: inline +#line 313 "parser.ypp" + { yylhs.value.as < program::ptr > () = program::make(yylhs.location); } +#line 2358 "parser.cpp" + break; + + case 10: // program: include +#line 315 "parser.ypp" + { yylhs.value.as < program::ptr > () = program::make(yylhs.location); yylhs.value.as < program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < include::ptr > ())); } +#line 2364 "parser.cpp" + break; + + case 11: // program: declaration +#line 317 "parser.ypp" + { yylhs.value.as < program::ptr > () = program::make(yylhs.location); yylhs.value.as < program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < decl::ptr > ())); } +#line 2370 "parser.cpp" + break; + + case 12: // inline: "#inline" expr_path ";" +#line 321 "parser.ypp" + { ppr.push_header(yystack_[1].value.as < expr_path::ptr > ()->value); } +#line 2376 "parser.cpp" + break; + + case 13: // include: "#include" expr_path ";" +#line 326 "parser.ypp" + { yylhs.value.as < include::ptr > () = include::make(yylhs.location, std::move(yystack_[1].value.as < expr_path::ptr > ())); } +#line 2382 "parser.cpp" + break; + + case 14: // declaration: "/#" +#line 330 "parser.ypp" + { yylhs.value.as < decl::ptr > () = decl_dev_begin::make(yylhs.location); } +#line 2388 "parser.cpp" + break; + + case 15: // declaration: "#/" +#line 331 "parser.ypp" + { yylhs.value.as < decl::ptr > () = decl_dev_end::make(yylhs.location); } +#line 2394 "parser.cpp" + break; + + case 16: // declaration: decl_usingtree +#line 332 "parser.ypp" + { yylhs.value.as < decl::ptr > () = std::move(yystack_[0].value.as < decl_usingtree::ptr > ()); } +#line 2400 "parser.cpp" + break; + + case 17: // declaration: decl_function +#line 333 "parser.ypp" + { yylhs.value.as < decl::ptr > () = std::move(yystack_[0].value.as < decl_function::ptr > ()); } +#line 2406 "parser.cpp" + break; + + case 18: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" +#line 338 "parser.ypp" + { ppr.ban_header(yylhs.location); yylhs.value.as < decl_usingtree::ptr > () = decl_usingtree::make(yylhs.location, std::move(yystack_[2].value.as < expr_string::ptr > ())); } +#line 2412 "parser.cpp" + break; + + case 19: // decl_function: expr_identifier "(" expr_parameters ")" stmt_comp +#line 343 "parser.ypp" + { ppr.ban_header(yylhs.location); yylhs.value.as < decl_function::ptr > () = decl_function::make(yylhs.location, expr_identifier::make(yylhs.location, ""), std::move(yystack_[4].value.as < expr_identifier::ptr > ()), std::move(yystack_[2].value.as < expr_parameters::ptr > ()), std::move(yystack_[0].value.as < stmt_comp::ptr > ()), export_flags::export_none); } +#line 2418 "parser.cpp" + break; + + case 20: // decl_function: "autoexec" expr_identifier "(" expr_parameters ")" stmt_comp +#line 345 "parser.ypp" + { ppr.ban_header(yylhs.location); yylhs.value.as < decl_function::ptr > () = decl_function::make(yylhs.location, expr_identifier::make(yylhs.location, ""), std::move(yystack_[4].value.as < expr_identifier::ptr > ()), std::move(yystack_[2].value.as < expr_parameters::ptr > ()), std::move(yystack_[0].value.as < stmt_comp::ptr > ()), export_flags::export_autoexec); } +#line 2424 "parser.cpp" + break; + + case 21: // decl_function: "codecall" expr_identifier "(" expr_parameters ")" stmt_comp +#line 347 "parser.ypp" + { ppr.ban_header(yylhs.location); yylhs.value.as < decl_function::ptr > () = decl_function::make(yylhs.location, expr_identifier::make(yylhs.location, ""), std::move(yystack_[4].value.as < expr_identifier::ptr > ()), std::move(yystack_[2].value.as < expr_parameters::ptr > ()), std::move(yystack_[0].value.as < stmt_comp::ptr > ()), export_flags::export_codecall); } +#line 2430 "parser.cpp" + break; + + case 22: // decl_function: "private" expr_identifier "(" expr_parameters ")" stmt_comp +#line 349 "parser.ypp" + { ppr.ban_header(yylhs.location); yylhs.value.as < decl_function::ptr > () = decl_function::make(yylhs.location, expr_identifier::make(yylhs.location, ""), std::move(yystack_[4].value.as < expr_identifier::ptr > ()), std::move(yystack_[2].value.as < expr_parameters::ptr > ()), std::move(yystack_[0].value.as < stmt_comp::ptr > ()), export_flags::export_private2); } +#line 2436 "parser.cpp" + break; + + case 23: // stmt: stmt_comp +#line 353 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_comp::ptr > ()); } +#line 2442 "parser.cpp" + break; + + case 24: // stmt: stmt_call +#line 354 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_expr::ptr > ()); } +#line 2448 "parser.cpp" + break; + + case 25: // stmt: stmt_const +#line 355 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_expr::ptr > ()); } +#line 2454 "parser.cpp" + break; + + case 26: // stmt: stmt_assign +#line 356 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_expr::ptr > ()); } +#line 2460 "parser.cpp" + break; + + case 27: // stmt: stmt_endon +#line 357 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_endon::ptr > ()); } +#line 2466 "parser.cpp" + break; + + case 28: // stmt: stmt_notify +#line 358 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_notify::ptr > ()); } +#line 2472 "parser.cpp" + break; + + case 29: // stmt: stmt_wait +#line 359 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_wait::ptr > ()); } +#line 2478 "parser.cpp" + break; + + case 30: // stmt: stmt_waittill +#line 360 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_waittill::ptr > ()); } +#line 2484 "parser.cpp" + break; + + case 31: // stmt: stmt_waittillmatch +#line 361 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_waittillmatch::ptr > ()); } +#line 2490 "parser.cpp" + break; + + case 32: // stmt: stmt_waittillframeend +#line 362 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_waittillframeend::ptr > ()); } +#line 2496 "parser.cpp" + break; + + case 33: // stmt: stmt_if +#line 363 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_if::ptr > ()); } +#line 2502 "parser.cpp" + break; + + case 34: // stmt: stmt_ifelse +#line 364 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_ifelse::ptr > ()); } +#line 2508 "parser.cpp" + break; + + case 35: // stmt: stmt_while +#line 365 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_while::ptr > ()); } +#line 2514 "parser.cpp" + break; + + case 36: // stmt: stmt_dowhile +#line 366 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_dowhile::ptr > ()); } +#line 2520 "parser.cpp" + break; + + case 37: // stmt: stmt_for +#line 367 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_for::ptr > ()); } +#line 2526 "parser.cpp" + break; + + case 38: // stmt: stmt_foreach +#line 368 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_foreach::ptr > ()); } +#line 2532 "parser.cpp" + break; + + case 39: // stmt: stmt_switch +#line 369 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_switch::ptr > ()); } +#line 2538 "parser.cpp" + break; + + case 40: // stmt: stmt_case +#line 370 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_case::ptr > ()); } +#line 2544 "parser.cpp" + break; + + case 41: // stmt: stmt_default +#line 371 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_default::ptr > ()); } +#line 2550 "parser.cpp" + break; + + case 42: // stmt: stmt_break +#line 372 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_break::ptr > ()); } +#line 2556 "parser.cpp" + break; + + case 43: // stmt: stmt_continue +#line 373 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_continue::ptr > ()); } +#line 2562 "parser.cpp" + break; + + case 44: // stmt: stmt_return +#line 374 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_return::ptr > ()); } +#line 2568 "parser.cpp" + break; + + case 45: // stmt: stmt_prof_begin +#line 375 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_prof_begin::ptr > ()); } +#line 2574 "parser.cpp" + break; + + case 46: // stmt: stmt_prof_end +#line 376 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_prof_end::ptr > ()); } +#line 2580 "parser.cpp" + break; + + case 47: // stmt_or_dev: stmt +#line 380 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt::ptr > ()); } +#line 2586 "parser.cpp" + break; + + case 48: // stmt_or_dev: stmt_dev +#line 381 "parser.ypp" + { yylhs.value.as < stmt::ptr > () = std::move(yystack_[0].value.as < stmt_dev::ptr > ()); } +#line 2592 "parser.cpp" + break; + + case 49: // stmt_list: stmt_list stmt +#line 386 "parser.ypp" + { yylhs.value.as < stmt_list::ptr > () = std::move(yystack_[1].value.as < stmt_list::ptr > ()); yylhs.value.as < stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < stmt::ptr > ())); } +#line 2598 "parser.cpp" + break; + + case 50: // stmt_list: stmt +#line 388 "parser.ypp" + { yylhs.value.as < stmt_list::ptr > () = stmt_list::make(yylhs.location); yylhs.value.as < stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < stmt::ptr > ())); } +#line 2604 "parser.cpp" + break; + + case 51: // stmt_list: stmt_list ";" +#line 390 "parser.ypp" + { yylhs.value.as < stmt_list::ptr > () = std::move(yystack_[1].value.as < stmt_list::ptr > ()); } +#line 2610 "parser.cpp" + break; + + case 52: // stmt_list: ";" +#line 392 "parser.ypp" + { yylhs.value.as < stmt_list::ptr > () = stmt_list::make(yylhs.location); } +#line 2616 "parser.cpp" + break; + + case 53: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev +#line 397 "parser.ypp" + { yylhs.value.as < stmt_list::ptr > () = std::move(yystack_[1].value.as < stmt_list::ptr > ()); yylhs.value.as < stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < stmt::ptr > ())); } +#line 2622 "parser.cpp" + break; + + case 54: // stmt_or_dev_list: stmt_or_dev +#line 399 "parser.ypp" + { yylhs.value.as < stmt_list::ptr > () = stmt_list::make(yylhs.location); yylhs.value.as < stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < stmt::ptr > ())); } +#line 2628 "parser.cpp" + break; + + case 55: // stmt_or_dev_list: stmt_or_dev_list ";" +#line 401 "parser.ypp" + { yylhs.value.as < stmt_list::ptr > () = std::move(yystack_[1].value.as < stmt_list::ptr > ()); } +#line 2634 "parser.cpp" + break; + + case 56: // stmt_or_dev_list: ";" +#line 403 "parser.ypp" + { yylhs.value.as < stmt_list::ptr > () = stmt_list::make(yylhs.location); } +#line 2640 "parser.cpp" + break; + + case 57: // stmt_dev: "/#" stmt_list "#/" +#line 407 "parser.ypp" + { yylhs.value.as < stmt_dev::ptr > () = stmt_dev::make(yylhs.location, std::move(yystack_[1].value.as < stmt_list::ptr > ())); } +#line 2646 "parser.cpp" + break; + + case 58: // stmt_dev: "/#" "#/" +#line 408 "parser.ypp" + { yylhs.value.as < stmt_dev::ptr > () = stmt_dev::make(yylhs.location, stmt_list::make(yylhs.location)); } +#line 2652 "parser.cpp" + break; + + case 59: // stmt_comp: "{" stmt_or_dev_list "}" +#line 412 "parser.ypp" + { yylhs.value.as < stmt_comp::ptr > () = stmt_comp::make(yylhs.location, std::move(yystack_[1].value.as < stmt_list::ptr > ())); } +#line 2658 "parser.cpp" + break; + + case 60: // stmt_comp: "{" "}" +#line 413 "parser.ypp" + { yylhs.value.as < stmt_comp::ptr > () = stmt_comp::make(yylhs.location, stmt_list::make(yylhs.location)); } +#line 2664 "parser.cpp" + break; + + case 61: // stmt_expr: expr_assign +#line 418 "parser.ypp" + { yylhs.value.as < stmt_expr::ptr > () = stmt_expr::make(yylhs.location, std::move(yystack_[0].value.as < expr::ptr > ())); } +#line 2670 "parser.cpp" + break; + + case 62: // stmt_expr: expr_increment +#line 420 "parser.ypp" + { yylhs.value.as < stmt_expr::ptr > () = stmt_expr::make(yylhs.location, std::move(yystack_[0].value.as < expr::ptr > ())); } +#line 2676 "parser.cpp" + break; + + case 63: // stmt_expr: expr_decrement +#line 422 "parser.ypp" + { yylhs.value.as < stmt_expr::ptr > () = stmt_expr::make(yylhs.location, std::move(yystack_[0].value.as < expr::ptr > ())); } +#line 2682 "parser.cpp" + break; + + case 64: // stmt_expr: %empty +#line 424 "parser.ypp" + { yylhs.value.as < stmt_expr::ptr > () = stmt_expr::make(yylhs.location, expr_empty::make(yylhs.location)); } +#line 2688 "parser.cpp" + break; + + case 65: // stmt_call: expr_call ";" +#line 429 "parser.ypp" + { yylhs.value.as < stmt_expr::ptr > () = stmt_expr::make(yylhs.location, std::move(yystack_[1].value.as < expr_call::ptr > ())); } +#line 2694 "parser.cpp" + break; + + case 66: // stmt_call: expr_method ";" +#line 431 "parser.ypp" + { yylhs.value.as < stmt_expr::ptr > () = stmt_expr::make(yylhs.location, std::move(yystack_[1].value.as < expr_method::ptr > ())); } +#line 2700 "parser.cpp" + break; + + case 67: // stmt_const: "const" expr_identifier "=" expr ";" +#line 436 "parser.ypp" + { yylhs.value.as < stmt_expr::ptr > () = stmt_expr::make(yylhs.location, expr_const::make(yylhs.location, std::move(yystack_[3].value.as < expr_identifier::ptr > ()), std::move(yystack_[1].value.as < expr::ptr > ()))); } +#line 2706 "parser.cpp" + break; + + case 68: // stmt_assign: expr_assign ";" +#line 441 "parser.ypp" + { yylhs.value.as < stmt_expr::ptr > () = stmt_expr::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 2712 "parser.cpp" + break; + + case 69: // stmt_assign: expr_increment ";" +#line 443 "parser.ypp" + { yylhs.value.as < stmt_expr::ptr > () = stmt_expr::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 2718 "parser.cpp" + break; + + case 70: // stmt_assign: expr_decrement ";" +#line 445 "parser.ypp" + { yylhs.value.as < stmt_expr::ptr > () = stmt_expr::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 2724 "parser.cpp" + break; + + case 71: // stmt_endon: expr_object "endon" "(" expr ")" ";" +#line 450 "parser.ypp" + { yylhs.value.as < stmt_endon::ptr > () = stmt_endon::make(yylhs.location, std::move(yystack_[5].value.as < expr::ptr > ()), std::move(yystack_[2].value.as < expr::ptr > ())); } +#line 2730 "parser.cpp" + break; + + case 72: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" +#line 455 "parser.ypp" + { yylhs.value.as < stmt_notify::ptr > () = stmt_notify::make(yylhs.location, std::move(yystack_[7].value.as < expr::ptr > ()), std::move(yystack_[4].value.as < expr::ptr > ()), std::move(yystack_[2].value.as < expr_arguments::ptr > ())); } +#line 2736 "parser.cpp" + break; + + case 73: // stmt_notify: expr_object "notify" "(" expr ")" ";" +#line 457 "parser.ypp" + { yylhs.value.as < stmt_notify::ptr > () = stmt_notify::make(yylhs.location, std::move(yystack_[5].value.as < expr::ptr > ()), std::move(yystack_[2].value.as < expr::ptr > ()), expr_arguments::make(yylhs.location)); } +#line 2742 "parser.cpp" + break; + + case 74: // stmt_wait: "wait" expr ";" +#line 462 "parser.ypp" + { yylhs.value.as < stmt_wait::ptr > () = stmt_wait::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 2748 "parser.cpp" + break; + + case 75: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" +#line 467 "parser.ypp" + { yylhs.value.as < stmt_waittill::ptr > () = stmt_waittill::make(yylhs.location, std::move(yystack_[7].value.as < expr::ptr > ()), std::move(yystack_[4].value.as < expr::ptr > ()), std::move(yystack_[2].value.as < expr_arguments::ptr > ())); } +#line 2754 "parser.cpp" + break; + + case 76: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" +#line 469 "parser.ypp" + { yylhs.value.as < stmt_waittill::ptr > () = stmt_waittill::make(yylhs.location, std::move(yystack_[5].value.as < expr::ptr > ()), std::move(yystack_[2].value.as < expr::ptr > ()), expr_arguments::make(yylhs.location)); } +#line 2760 "parser.cpp" + break; + + case 77: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" +#line 474 "parser.ypp" + { yylhs.value.as < stmt_waittillmatch::ptr > () = stmt_waittillmatch::make(yylhs.location, std::move(yystack_[7].value.as < expr::ptr > ()), std::move(yystack_[4].value.as < expr::ptr > ()), std::move(yystack_[2].value.as < expr_arguments::ptr > ())); } +#line 2766 "parser.cpp" + break; + + case 78: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" +#line 476 "parser.ypp" + { yylhs.value.as < stmt_waittillmatch::ptr > () = stmt_waittillmatch::make(yylhs.location, std::move(yystack_[5].value.as < expr::ptr > ()), std::move(yystack_[2].value.as < expr::ptr > ()), expr_arguments::make(yylhs.location)); } +#line 2772 "parser.cpp" + break; + + case 79: // stmt_waittillframeend: "waittillframeend" ";" +#line 481 "parser.ypp" + { yylhs.value.as < stmt_waittillframeend::ptr > () = stmt_waittillframeend::make(yylhs.location); } +#line 2778 "parser.cpp" + break; + + case 80: // stmt_if: "if" "(" expr ")" stmt +#line 486 "parser.ypp" + { yylhs.value.as < stmt_if::ptr > () = stmt_if::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < stmt::ptr > ())); } +#line 2784 "parser.cpp" + break; + + case 81: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt +#line 491 "parser.ypp" + { yylhs.value.as < stmt_ifelse::ptr > () = stmt_ifelse::make(yylhs.location, std::move(yystack_[4].value.as < expr::ptr > ()), std::move(yystack_[2].value.as < stmt::ptr > ()), std::move(yystack_[0].value.as < stmt::ptr > ())); } +#line 2790 "parser.cpp" + break; + + case 82: // stmt_while: "while" "(" expr ")" stmt +#line 496 "parser.ypp" + { yylhs.value.as < stmt_while::ptr > () = stmt_while::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < stmt::ptr > ())); } +#line 2796 "parser.cpp" + break; + + case 83: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" +#line 501 "parser.ypp" + { yylhs.value.as < stmt_dowhile::ptr > () = stmt_dowhile::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[5].value.as < stmt::ptr > ())); } +#line 2802 "parser.cpp" + break; + + case 84: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt +#line 506 "parser.ypp" + { yylhs.value.as < stmt_for::ptr > () = stmt_for::make(yylhs.location, std::move(yystack_[6].value.as < stmt_expr::ptr > ()), std::move(yystack_[4].value.as < expr::ptr > ()), std::move(yystack_[2].value.as < stmt_expr::ptr > ()), std::move(yystack_[0].value.as < stmt::ptr > ())); } +#line 2808 "parser.cpp" + break; + + case 85: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt +#line 511 "parser.ypp" + { + auto array = expr_identifier::make(yylhs.location, fmt::format("_a{}", ++index)); + auto key = expr_identifier::make(yylhs.location, fmt::format("_k{}", ++index)); + yylhs.value.as < stmt_foreach::ptr > () = stmt_foreach::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[4].value.as < expr_identifier::ptr > ()), std::move(array), std::move(key), std::move(yystack_[0].value.as < stmt::ptr > ()), false); + } +#line 2818 "parser.cpp" + break; + + case 86: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt +#line 517 "parser.ypp" + { + auto array = expr_identifier::make(yylhs.location, fmt::format("_a{}", ++index)); + yylhs.value.as < stmt_foreach::ptr > () = stmt_foreach::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[4].value.as < expr_identifier::ptr > ()), std::move(array), std::move(yystack_[6].value.as < expr_identifier::ptr > ()), std::move(yystack_[0].value.as < stmt::ptr > ()), true); + } +#line 2827 "parser.cpp" + break; + + case 87: // stmt_switch: "switch" "(" expr ")" stmt_comp +#line 525 "parser.ypp" + { yylhs.value.as < stmt_switch::ptr > () = stmt_switch::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < stmt_comp::ptr > ())); + parse_switch(*yylhs.value.as < stmt_switch::ptr > ()); + } +#line 2835 "parser.cpp" + break; + + case 88: // stmt_case: "case" expr_integer ":" +#line 532 "parser.ypp" + { yylhs.value.as < stmt_case::ptr > () = stmt_case::make(yylhs.location, std::move(yystack_[1].value.as < expr_integer::ptr > ()), stmt_list::make(yylhs.location)); } +#line 2841 "parser.cpp" + break; + + case 89: // stmt_case: "case" expr_string ":" +#line 534 "parser.ypp" + { yylhs.value.as < stmt_case::ptr > () = stmt_case::make(yylhs.location, std::move(yystack_[1].value.as < expr_string::ptr > ()), stmt_list::make(yylhs.location)); } +#line 2847 "parser.cpp" + break; + + case 90: // stmt_default: "default" ":" +#line 539 "parser.ypp" + { yylhs.value.as < stmt_default::ptr > () = stmt_default::make(yylhs.location, stmt_list::make(yylhs.location)); } +#line 2853 "parser.cpp" + break; + + case 91: // stmt_break: "break" ";" +#line 544 "parser.ypp" + { yylhs.value.as < stmt_break::ptr > () = stmt_break::make(yylhs.location); } +#line 2859 "parser.cpp" + break; + + case 92: // stmt_continue: "continue" ";" +#line 549 "parser.ypp" + { yylhs.value.as < stmt_continue::ptr > () = stmt_continue::make(yylhs.location); } +#line 2865 "parser.cpp" + break; + + case 93: // stmt_return: "return" expr ";" +#line 554 "parser.ypp" + { yylhs.value.as < stmt_return::ptr > () = stmt_return::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 2871 "parser.cpp" + break; + + case 94: // stmt_return: "return" ";" +#line 556 "parser.ypp" + { yylhs.value.as < stmt_return::ptr > () = stmt_return::make(yylhs.location, expr_empty::make(yylhs.location)); } +#line 2877 "parser.cpp" + break; + + case 95: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" +#line 561 "parser.ypp" + { yylhs.value.as < stmt_prof_begin::ptr > () = stmt_prof_begin::make(yylhs.location, std::move(yystack_[2].value.as < expr_arguments::ptr > ())); } +#line 2883 "parser.cpp" + break; + + case 96: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" +#line 566 "parser.ypp" + { yylhs.value.as < stmt_prof_end::ptr > () = stmt_prof_end::make(yylhs.location, std::move(yystack_[2].value.as < expr_arguments::ptr > ())); } +#line 2889 "parser.cpp" + break; + + case 97: // expr: expr_ternary +#line 570 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr::ptr > ()); } +#line 2895 "parser.cpp" + break; + + case 98: // expr: expr_binary +#line 571 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr::ptr > ()); } +#line 2901 "parser.cpp" + break; + + case 99: // expr: expr_primitive +#line 572 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr::ptr > ()); } +#line 2907 "parser.cpp" + break; + + case 100: // expr_or_empty: expr +#line 576 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr::ptr > ()); } +#line 2913 "parser.cpp" + break; + + case 101: // expr_or_empty: %empty +#line 577 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_empty::make(yylhs.location); } +#line 2919 "parser.cpp" + break; + + case 102: // expr_increment: "++" expr_object +#line 582 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_increment::make(yylhs.location, std::move(yystack_[0].value.as < expr::ptr > ()), true); } +#line 2925 "parser.cpp" + break; + + case 103: // expr_increment: expr_object "++" +#line 584 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_increment::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ()), false); } +#line 2931 "parser.cpp" + break; + + case 104: // expr_decrement: "--" expr_object +#line 589 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_decrement::make(yylhs.location, std::move(yystack_[0].value.as < expr::ptr > ()), true); } +#line 2937 "parser.cpp" + break; + + case 105: // expr_decrement: expr_object "--" +#line 591 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_decrement::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ()), false); } +#line 2943 "parser.cpp" + break; + + case 106: // expr_assign: expr_object "=" expr +#line 596 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_assign::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_assign::op::eq); } +#line 2949 "parser.cpp" + break; + + case 107: // expr_assign: expr_object "|=" expr +#line 598 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_assign::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_assign::op::bwor); } +#line 2955 "parser.cpp" + break; + + case 108: // expr_assign: expr_object "&=" expr +#line 600 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_assign::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_assign::op::bwand); } +#line 2961 "parser.cpp" + break; + + case 109: // expr_assign: expr_object "^=" expr +#line 602 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_assign::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_assign::op::bwexor); } +#line 2967 "parser.cpp" + break; + + case 110: // expr_assign: expr_object "<<=" expr +#line 604 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_assign::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_assign::op::shl); } +#line 2973 "parser.cpp" + break; + + case 111: // expr_assign: expr_object ">>=" expr +#line 606 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_assign::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_assign::op::shr); } +#line 2979 "parser.cpp" + break; + + case 112: // expr_assign: expr_object "+=" expr +#line 608 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_assign::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_assign::op::add); } +#line 2985 "parser.cpp" + break; + + case 113: // expr_assign: expr_object "-=" expr +#line 610 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_assign::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_assign::op::sub); } +#line 2991 "parser.cpp" + break; + + case 114: // expr_assign: expr_object "*=" expr +#line 612 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_assign::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_assign::op::mul); } +#line 2997 "parser.cpp" + break; + + case 115: // expr_assign: expr_object "/=" expr +#line 614 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_assign::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_assign::op::div); } +#line 3003 "parser.cpp" + break; + + case 116: // expr_assign: expr_object "%=" expr +#line 616 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_assign::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_assign::op::mod); } +#line 3009 "parser.cpp" + break; + + case 117: // expr_ternary: expr "?" expr ":" expr +#line 621 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_ternary::make(yylhs.location, std::move(yystack_[4].value.as < expr::ptr > ()), std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ())); } +#line 3015 "parser.cpp" + break; + + case 118: // expr_binary: expr "||" expr +#line 626 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_binary::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_binary::op::bool_or); } +#line 3021 "parser.cpp" + break; + + case 119: // expr_binary: expr "&&" expr +#line 628 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_binary::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_binary::op::bool_and); } +#line 3027 "parser.cpp" + break; + + case 120: // expr_binary: expr "==" expr +#line 630 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_binary::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_binary::op::eq); } +#line 3033 "parser.cpp" + break; + + case 121: // expr_binary: expr "!=" expr +#line 632 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_binary::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_binary::op::ne); } +#line 3039 "parser.cpp" + break; + + case 122: // expr_binary: expr "<=" expr +#line 634 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_binary::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_binary::op::le); } +#line 3045 "parser.cpp" + break; + + case 123: // expr_binary: expr ">=" expr +#line 636 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_binary::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_binary::op::ge); } +#line 3051 "parser.cpp" + break; + + case 124: // expr_binary: expr "<" expr +#line 638 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_binary::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_binary::op::lt); } +#line 3057 "parser.cpp" + break; + + case 125: // expr_binary: expr ">" expr +#line 640 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_binary::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_binary::op::gt); } +#line 3063 "parser.cpp" + break; + + case 126: // expr_binary: expr "|" expr +#line 642 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_binary::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_binary::op::bwor); } +#line 3069 "parser.cpp" + break; + + case 127: // expr_binary: expr "&" expr +#line 644 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_binary::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_binary::op::bwand); } +#line 3075 "parser.cpp" + break; + + case 128: // expr_binary: expr "^" expr +#line 646 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_binary::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_binary::op::bwexor); } +#line 3081 "parser.cpp" + break; + + case 129: // expr_binary: expr "<<" expr +#line 648 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_binary::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_binary::op::shl); } +#line 3087 "parser.cpp" + break; + + case 130: // expr_binary: expr ">>" expr +#line 650 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_binary::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_binary::op::shr); } +#line 3093 "parser.cpp" + break; + + case 131: // expr_binary: expr "+" expr +#line 652 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_binary::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_binary::op::add); } +#line 3099 "parser.cpp" + break; + + case 132: // expr_binary: expr "-" expr +#line 654 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_binary::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_binary::op::sub); } +#line 3105 "parser.cpp" + break; + + case 133: // expr_binary: expr "*" expr +#line 656 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_binary::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_binary::op::mul); } +#line 3111 "parser.cpp" + break; + + case 134: // expr_binary: expr "/" expr +#line 658 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_binary::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_binary::op::div); } +#line 3117 "parser.cpp" + break; + + case 135: // expr_binary: expr "%" expr +#line 660 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_binary::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_binary::op::mod); } +#line 3123 "parser.cpp" + break; + + case 136: // expr_primitive: expr_complement +#line 664 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_complement::ptr > ()); } +#line 3129 "parser.cpp" + break; + + case 137: // expr_primitive: expr_negate +#line 665 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_negate::ptr > ()); } +#line 3135 "parser.cpp" + break; + + case 138: // expr_primitive: expr_not +#line 666 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_not::ptr > ()); } +#line 3141 "parser.cpp" + break; + + case 139: // expr_primitive: expr_call +#line 667 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_call::ptr > ()); } +#line 3147 "parser.cpp" + break; + + case 140: // expr_primitive: expr_method +#line 668 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_method::ptr > ()); } +#line 3153 "parser.cpp" + break; + + case 141: // expr_primitive: expr_getnextarraykey +#line 669 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_getnextarraykey::ptr > ()); } +#line 3159 "parser.cpp" + break; + + case 142: // expr_primitive: expr_getfirstarraykey +#line 670 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_getfirstarraykey::ptr > ()); } +#line 3165 "parser.cpp" + break; + + case 143: // expr_primitive: expr_getdvarcoloralpha +#line 671 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_getdvarcoloralpha::ptr > ()); } +#line 3171 "parser.cpp" + break; + + case 144: // expr_primitive: expr_getdvarcolorblue +#line 672 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_getdvarcolorblue::ptr > ()); } +#line 3177 "parser.cpp" + break; + + case 145: // expr_primitive: expr_getdvarcolorgreen +#line 673 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_getdvarcolorgreen::ptr > ()); } +#line 3183 "parser.cpp" + break; + + case 146: // expr_primitive: expr_getdvarcolorred +#line 674 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_getdvarcolorred::ptr > ()); } +#line 3189 "parser.cpp" + break; + + case 147: // expr_primitive: expr_getdvarvector +#line 675 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_getdvarvector::ptr > ()); } +#line 3195 "parser.cpp" + break; + + case 148: // expr_primitive: expr_getdvarfloat +#line 676 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_getdvarfloat::ptr > ()); } +#line 3201 "parser.cpp" + break; + + case 149: // expr_primitive: expr_getdvarint +#line 677 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_getdvarint::ptr > ()); } +#line 3207 "parser.cpp" + break; + + case 150: // expr_primitive: expr_getdvar +#line 678 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_getdvar::ptr > ()); } +#line 3213 "parser.cpp" + break; + + case 151: // expr_primitive: expr_gettime +#line 679 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_gettime::ptr > ()); } +#line 3219 "parser.cpp" + break; + + case 152: // expr_primitive: expr_abs +#line 680 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_abs::ptr > ()); } +#line 3225 "parser.cpp" + break; + + case 153: // expr_primitive: expr_vectortoangles +#line 681 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_vectortoangles::ptr > ()); } +#line 3231 "parser.cpp" + break; + + case 154: // expr_primitive: expr_angleclamp180 +#line 682 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_angleclamp180::ptr > ()); } +#line 3237 "parser.cpp" + break; + + case 155: // expr_primitive: expr_anglestoforward +#line 683 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_anglestoforward::ptr > ()); } +#line 3243 "parser.cpp" + break; + + case 156: // expr_primitive: expr_anglestoright +#line 684 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_anglestoright::ptr > ()); } +#line 3249 "parser.cpp" + break; + + case 157: // expr_primitive: expr_anglestoup +#line 685 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_anglestoup::ptr > ()); } +#line 3255 "parser.cpp" + break; + + case 158: // expr_primitive: expr_vectorscale +#line 686 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_vectorscale::ptr > ()); } +#line 3261 "parser.cpp" + break; + + case 159: // expr_primitive: expr_isdefined +#line 687 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_isdefined::ptr > ()); } +#line 3267 "parser.cpp" + break; + + case 160: // expr_primitive: expr_reference +#line 688 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_reference::ptr > ()); } +#line 3273 "parser.cpp" + break; + + case 161: // expr_primitive: expr_array +#line 689 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_array::ptr > ()); } +#line 3279 "parser.cpp" + break; + + case 162: // expr_primitive: expr_field +#line 690 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_field::ptr > ()); } +#line 3285 "parser.cpp" + break; + + case 163: // expr_primitive: expr_size +#line 691 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_size::ptr > ()); } +#line 3291 "parser.cpp" + break; + + case 164: // expr_primitive: expr_paren +#line 692 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_paren::ptr > ()); } +#line 3297 "parser.cpp" + break; + + case 165: // expr_primitive: expr_empty_array +#line 693 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_empty_array::ptr > ()); } +#line 3303 "parser.cpp" + break; + + case 166: // expr_primitive: expr_undefined +#line 694 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_undefined::ptr > ()); } +#line 3309 "parser.cpp" + break; + + case 167: // expr_primitive: expr_game +#line 695 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_game::ptr > ()); } +#line 3315 "parser.cpp" + break; + + case 168: // expr_primitive: expr_self +#line 696 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_self::ptr > ()); } +#line 3321 "parser.cpp" + break; + + case 169: // expr_primitive: expr_anim +#line 697 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_anim::ptr > ()); } +#line 3327 "parser.cpp" + break; + + case 170: // expr_primitive: expr_level +#line 698 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_level::ptr > ()); } +#line 3333 "parser.cpp" + break; + + case 171: // expr_primitive: expr_animation +#line 699 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_animation::ptr > ()); } +#line 3339 "parser.cpp" + break; + + case 172: // expr_primitive: expr_animtree +#line 700 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_animtree::ptr > ()); } +#line 3345 "parser.cpp" + break; + + case 173: // expr_primitive: expr_identifier +#line 701 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_identifier::ptr > ()); } +#line 3351 "parser.cpp" + break; + + case 174: // expr_primitive: expr_istring +#line 702 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_istring::ptr > ()); } +#line 3357 "parser.cpp" + break; + + case 175: // expr_primitive: expr_string +#line 703 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_string::ptr > ()); } +#line 3363 "parser.cpp" + break; + + case 176: // expr_primitive: expr_vector +#line 704 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_vector::ptr > ()); } +#line 3369 "parser.cpp" + break; + + case 177: // expr_primitive: expr_hash +#line 705 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_hash::ptr > ()); } +#line 3375 "parser.cpp" + break; + + case 178: // expr_primitive: expr_float +#line 706 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_float::ptr > ()); } +#line 3381 "parser.cpp" + break; + + case 179: // expr_primitive: expr_integer +#line 707 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_integer::ptr > ()); } +#line 3387 "parser.cpp" + break; + + case 180: // expr_primitive: expr_false +#line 708 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_false::ptr > ()); } +#line 3393 "parser.cpp" + break; + + case 181: // expr_primitive: expr_true +#line 709 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_true::ptr > ()); } +#line 3399 "parser.cpp" + break; + + case 182: // expr_complement: "~" expr +#line 714 "parser.ypp" + { yylhs.value.as < expr_complement::ptr > () = expr_complement::make(yylhs.location, std::move(yystack_[0].value.as < expr::ptr > ())); } +#line 3405 "parser.cpp" + break; + + case 183: // expr_negate: "-" expr_identifier +#line 719 "parser.ypp" + { yylhs.value.as < expr_negate::ptr > () = expr_negate::make(yylhs.location, std::move(yystack_[0].value.as < expr_identifier::ptr > ())); } +#line 3411 "parser.cpp" + break; + + case 184: // expr_negate: "-" expr_paren +#line 721 "parser.ypp" + { yylhs.value.as < expr_negate::ptr > () = expr_negate::make(yylhs.location, std::move(yystack_[0].value.as < expr_paren::ptr > ())); } +#line 3417 "parser.cpp" + break; + + case 185: // expr_negate: "-" expr_array +#line 723 "parser.ypp" + { yylhs.value.as < expr_negate::ptr > () = expr_negate::make(yylhs.location, std::move(yystack_[0].value.as < expr_array::ptr > ())); } +#line 3423 "parser.cpp" + break; + + case 186: // expr_negate: "-" expr_field +#line 725 "parser.ypp" + { yylhs.value.as < expr_negate::ptr > () = expr_negate::make(yylhs.location, std::move(yystack_[0].value.as < expr_field::ptr > ())); } +#line 3429 "parser.cpp" + break; + + case 187: // expr_not: "!" expr +#line 730 "parser.ypp" + { yylhs.value.as < expr_not::ptr > () = expr_not::make(yylhs.location, std::move(yystack_[0].value.as < expr::ptr > ())); } +#line 3435 "parser.cpp" + break; + + case 188: // expr_call: expr_function +#line 734 "parser.ypp" + { yylhs.value.as < expr_call::ptr > () = expr_call::make(yylhs.location, std::move(yystack_[0].value.as < call::ptr > ())); } +#line 3441 "parser.cpp" + break; + + case 189: // expr_call: expr_pointer +#line 735 "parser.ypp" + { yylhs.value.as < expr_call::ptr > () = expr_call::make(yylhs.location, std::move(yystack_[0].value.as < call::ptr > ())); } +#line 3447 "parser.cpp" + break; + + case 190: // expr_method: expr_object expr_function +#line 738 "parser.ypp" + { yylhs.value.as < expr_method::ptr > () = expr_method::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < call::ptr > ())); } +#line 3453 "parser.cpp" + break; + + case 191: // expr_method: expr_object expr_pointer +#line 739 "parser.ypp" + { yylhs.value.as < expr_method::ptr > () = expr_method::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < call::ptr > ())); } +#line 3459 "parser.cpp" + break; + + case 192: // expr_function: expr_identifier "(" expr_arguments ")" +#line 744 "parser.ypp" + { yylhs.value.as < call::ptr > () = expr_function::make(yylhs.location, expr_path::make(yylhs.location), std::move(yystack_[3].value.as < expr_identifier::ptr > ()), std::move(yystack_[1].value.as < expr_arguments::ptr > ()), call::mode::normal); } +#line 3465 "parser.cpp" + break; + + case 193: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" +#line 746 "parser.ypp" + { yylhs.value.as < call::ptr > () = expr_function::make(yylhs.location, std::move(yystack_[5].value.as < expr_path::ptr > ()), std::move(yystack_[3].value.as < expr_identifier::ptr > ()), std::move(yystack_[1].value.as < expr_arguments::ptr > ()), call::mode::normal); } +#line 3471 "parser.cpp" + break; + + case 194: // expr_function: "thread" expr_identifier "(" expr_arguments ")" +#line 748 "parser.ypp" + { yylhs.value.as < call::ptr > () = expr_function::make(yylhs.location, expr_path::make(yylhs.location), std::move(yystack_[3].value.as < expr_identifier::ptr > ()), std::move(yystack_[1].value.as < expr_arguments::ptr > ()), call::mode::thread); } +#line 3477 "parser.cpp" + break; + + case 195: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" +#line 750 "parser.ypp" + { yylhs.value.as < call::ptr > () = expr_function::make(yylhs.location, std::move(yystack_[5].value.as < expr_path::ptr > ()), std::move(yystack_[3].value.as < expr_identifier::ptr > ()), std::move(yystack_[1].value.as < expr_arguments::ptr > ()), call::mode::thread); } +#line 3483 "parser.cpp" + break; + + case 196: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" +#line 755 "parser.ypp" + { yylhs.value.as < call::ptr > () = expr_pointer::make(yylhs.location, std::move(yystack_[5].value.as < expr::ptr > ()), std::move(yystack_[1].value.as < expr_arguments::ptr > ()), call::mode::normal); } +#line 3489 "parser.cpp" + break; + + case 197: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" +#line 757 "parser.ypp" + { yylhs.value.as < call::ptr > () = expr_pointer::make(yylhs.location, std::move(yystack_[5].value.as < expr::ptr > ()), std::move(yystack_[1].value.as < expr_arguments::ptr > ()), call::mode::thread); } +#line 3495 "parser.cpp" + break; + + case 198: // expr_parameters: expr_parameters "," expr_parameters_default +#line 762 "parser.ypp" + { yylhs.value.as < expr_parameters::ptr > () = std::move(yystack_[2].value.as < expr_parameters::ptr > ()); yylhs.value.as < expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr::ptr > ())); } +#line 3501 "parser.cpp" + break; + + case 199: // expr_parameters: expr_parameters "," expr_identifier +#line 764 "parser.ypp" + { yylhs.value.as < expr_parameters::ptr > () = std::move(yystack_[2].value.as < expr_parameters::ptr > ()); yylhs.value.as < expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr_identifier::ptr > ())); } +#line 3507 "parser.cpp" + break; + + case 200: // expr_parameters: expr_parameters_default +#line 766 "parser.ypp" + { yylhs.value.as < expr_parameters::ptr > () = expr_parameters::make(yylhs.location); yylhs.value.as < expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr::ptr > ())); } +#line 3513 "parser.cpp" + break; + + case 201: // expr_parameters: expr_identifier +#line 768 "parser.ypp" + { yylhs.value.as < expr_parameters::ptr > () = expr_parameters::make(yylhs.location); yylhs.value.as < expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr_identifier::ptr > ())); } +#line 3519 "parser.cpp" + break; + + case 202: // expr_parameters: %empty +#line 770 "parser.ypp" + { yylhs.value.as < expr_parameters::ptr > () = expr_parameters::make(yylhs.location); } +#line 3525 "parser.cpp" + break; + + case 203: // expr_parameters_default: expr_identifier "=" expr +#line 775 "parser.ypp" + { yylhs.value.as < expr::ptr > () = expr_assign::make(yylhs.location, std::move(yystack_[2].value.as < expr_identifier::ptr > ()), std::move(yystack_[0].value.as < expr::ptr > ()), expr_assign::op::eq); } +#line 3531 "parser.cpp" + break; + + case 204: // expr_arguments: expr_arguments_no_empty +#line 780 "parser.ypp" + { yylhs.value.as < expr_arguments::ptr > () = std::move(yystack_[0].value.as < expr_arguments::ptr > ()); } +#line 3537 "parser.cpp" + break; + + case 205: // expr_arguments: %empty +#line 782 "parser.ypp" + { yylhs.value.as < expr_arguments::ptr > () = expr_arguments::make(yylhs.location); } +#line 3543 "parser.cpp" + break; + + case 206: // expr_arguments_no_empty: expr_arguments "," expr +#line 787 "parser.ypp" + { yylhs.value.as < expr_arguments::ptr > () = std::move(yystack_[2].value.as < expr_arguments::ptr > ()); yylhs.value.as < expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr::ptr > ())); } +#line 3549 "parser.cpp" + break; + + case 207: // expr_arguments_no_empty: expr +#line 789 "parser.ypp" + { yylhs.value.as < expr_arguments::ptr > () = expr_arguments::make(yylhs.location); yylhs.value.as < expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < expr::ptr > ())); } +#line 3555 "parser.cpp" + break; + + case 208: // expr_getnextarraykey: "getnextarraykey" "(" expr "," expr ")" +#line 794 "parser.ypp" + { yylhs.value.as < expr_getnextarraykey::ptr > () = expr_getnextarraykey::make(yylhs.location, std::move(yystack_[3].value.as < expr::ptr > ()), std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3561 "parser.cpp" + break; + + case 209: // expr_getfirstarraykey: "getfirstarraykey" "(" expr ")" +#line 799 "parser.ypp" + { yylhs.value.as < expr_getfirstarraykey::ptr > () = expr_getfirstarraykey::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3567 "parser.cpp" + break; + + case 210: // expr_getdvarcoloralpha: "getdvarcoloralpha" "(" expr ")" +#line 804 "parser.ypp" + { yylhs.value.as < expr_getdvarcoloralpha::ptr > () = expr_getdvarcoloralpha::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3573 "parser.cpp" + break; + + case 211: // expr_getdvarcolorblue: "getdvarcolorblue" "(" expr ")" +#line 809 "parser.ypp" + { yylhs.value.as < expr_getdvarcolorblue::ptr > () = expr_getdvarcolorblue::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3579 "parser.cpp" + break; + + case 212: // expr_getdvarcolorgreen: "getdvarcolorgreen" "(" expr ")" +#line 814 "parser.ypp" + { yylhs.value.as < expr_getdvarcolorgreen::ptr > () = expr_getdvarcolorgreen::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3585 "parser.cpp" + break; + + case 213: // expr_getdvarcolorred: "getdvarcolorred" "(" expr ")" +#line 819 "parser.ypp" + { yylhs.value.as < expr_getdvarcolorred::ptr > () = expr_getdvarcolorred::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3591 "parser.cpp" + break; + + case 214: // expr_getdvarvector: "getdvarvector" "(" expr ")" +#line 824 "parser.ypp" + { yylhs.value.as < expr_getdvarvector::ptr > () = expr_getdvarvector::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3597 "parser.cpp" + break; + + case 215: // expr_getdvarfloat: "getdvarfloat" "(" expr ")" +#line 829 "parser.ypp" + { yylhs.value.as < expr_getdvarfloat::ptr > () = expr_getdvarfloat::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3603 "parser.cpp" + break; + + case 216: // expr_getdvarint: "getdvarint" "(" expr ")" +#line 834 "parser.ypp" + { yylhs.value.as < expr_getdvarint::ptr > () = expr_getdvarint::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3609 "parser.cpp" + break; + + case 217: // expr_getdvar: "getdvar" "(" expr ")" +#line 839 "parser.ypp" + { yylhs.value.as < expr_getdvar::ptr > () = expr_getdvar::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3615 "parser.cpp" + break; + + case 218: // expr_gettime: "gettime" "(" ")" +#line 844 "parser.ypp" + { yylhs.value.as < expr_gettime::ptr > () = expr_gettime::make(yylhs.location); } +#line 3621 "parser.cpp" + break; + + case 219: // expr_abs: "abs" "(" expr ")" +#line 849 "parser.ypp" + { yylhs.value.as < expr_abs::ptr > () = expr_abs::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3627 "parser.cpp" + break; + + case 220: // expr_vectortoangles: "vectortoangles" "(" expr ")" +#line 854 "parser.ypp" + { yylhs.value.as < expr_vectortoangles::ptr > () = expr_vectortoangles::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3633 "parser.cpp" + break; + + case 221: // expr_angleclamp180: "angleclamp180" "(" expr ")" +#line 859 "parser.ypp" + { yylhs.value.as < expr_angleclamp180::ptr > () = expr_angleclamp180::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3639 "parser.cpp" + break; + + case 222: // expr_anglestoforward: "anglestoforward" "(" expr ")" +#line 864 "parser.ypp" + { yylhs.value.as < expr_anglestoforward::ptr > () = expr_anglestoforward::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3645 "parser.cpp" + break; + + case 223: // expr_anglestoright: "anglestoright" "(" expr ")" +#line 869 "parser.ypp" + { yylhs.value.as < expr_anglestoright::ptr > () = expr_anglestoright::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3651 "parser.cpp" + break; + + case 224: // expr_anglestoup: "anglestoup" "(" expr ")" +#line 874 "parser.ypp" + { yylhs.value.as < expr_anglestoup::ptr > () = expr_anglestoup::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3657 "parser.cpp" + break; + + case 225: // expr_vectorscale: "vectorscale" "(" expr "," expr ")" +#line 879 "parser.ypp" + { yylhs.value.as < expr_vectorscale::ptr > () = expr_vectorscale::make(yylhs.location, std::move(yystack_[3].value.as < expr::ptr > ()), std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3663 "parser.cpp" + break; + + case 226: // expr_isdefined: "isdefined" "(" expr ")" +#line 884 "parser.ypp" + { yylhs.value.as < expr_isdefined::ptr > () = expr_isdefined::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3669 "parser.cpp" + break; + + case 227: // expr_reference: "::" expr_identifier +#line 889 "parser.ypp" + { yylhs.value.as < expr_reference::ptr > () = expr_reference::make(yylhs.location, expr_path::make(yylhs.location), std::move(yystack_[0].value.as < expr_identifier::ptr > ())); } +#line 3675 "parser.cpp" + break; + + case 228: // expr_reference: expr_path "::" expr_identifier +#line 891 "parser.ypp" + { yylhs.value.as < expr_reference::ptr > () = expr_reference::make(yylhs.location, std::move(yystack_[2].value.as < expr_path::ptr > ()), std::move(yystack_[0].value.as < expr_identifier::ptr > ())); } +#line 3681 "parser.cpp" + break; + + case 229: // expr_array: expr_object "[" expr "]" +#line 896 "parser.ypp" + { yylhs.value.as < expr_array::ptr > () = expr_array::make(yylhs.location, std::move(yystack_[3].value.as < expr::ptr > ()), std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3687 "parser.cpp" + break; + + case 230: // expr_array: expr_getdvarvector "[" expr "]" +#line 898 "parser.ypp" + { yylhs.value.as < expr_array::ptr > () = expr_array::make(yylhs.location, std::move(yystack_[3].value.as < expr_getdvarvector::ptr > ()), std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3693 "parser.cpp" + break; + + case 231: // expr_array: expr_vectortoangles "[" expr "]" +#line 900 "parser.ypp" + { yylhs.value.as < expr_array::ptr > () = expr_array::make(yylhs.location, std::move(yystack_[3].value.as < expr_vectortoangles::ptr > ()), std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3699 "parser.cpp" + break; + + case 232: // expr_array: expr_angleclamp180 "[" expr "]" +#line 902 "parser.ypp" + { yylhs.value.as < expr_array::ptr > () = expr_array::make(yylhs.location, std::move(yystack_[3].value.as < expr_angleclamp180::ptr > ()), std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3705 "parser.cpp" + break; + + case 233: // expr_array: expr_anglestoforward "[" expr "]" +#line 904 "parser.ypp" + { yylhs.value.as < expr_array::ptr > () = expr_array::make(yylhs.location, std::move(yystack_[3].value.as < expr_anglestoforward::ptr > ()), std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3711 "parser.cpp" + break; + + case 234: // expr_array: expr_anglestoright "[" expr "]" +#line 906 "parser.ypp" + { yylhs.value.as < expr_array::ptr > () = expr_array::make(yylhs.location, std::move(yystack_[3].value.as < expr_anglestoright::ptr > ()), std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3717 "parser.cpp" + break; + + case 235: // expr_array: expr_anglestoup "[" expr "]" +#line 908 "parser.ypp" + { yylhs.value.as < expr_array::ptr > () = expr_array::make(yylhs.location, std::move(yystack_[3].value.as < expr_anglestoup::ptr > ()), std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3723 "parser.cpp" + break; + + case 236: // expr_array: expr_vectorscale "[" expr "]" +#line 910 "parser.ypp" + { yylhs.value.as < expr_array::ptr > () = expr_array::make(yylhs.location, std::move(yystack_[3].value.as < expr_vectorscale::ptr > ()), std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3729 "parser.cpp" + break; + + case 237: // expr_field: expr_object "." expr_identifier_nosize +#line 915 "parser.ypp" + { yylhs.value.as < expr_field::ptr > () = expr_field::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ()), std::move(yystack_[0].value.as < expr_identifier::ptr > ())); } +#line 3735 "parser.cpp" + break; + + case 238: // expr_size: expr_object "." "size" +#line 920 "parser.ypp" + { yylhs.value.as < expr_size::ptr > () = expr_size::make(yylhs.location, std::move(yystack_[2].value.as < expr::ptr > ())); } +#line 3741 "parser.cpp" + break; + + case 239: // expr_paren: "(" expr ")" +#line 925 "parser.ypp" + { yylhs.value.as < expr_paren::ptr > () = expr_paren::make(yylhs.location, std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3747 "parser.cpp" + break; + + case 240: // expr_object: expr_call +#line 929 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_call::ptr > ()); } +#line 3753 "parser.cpp" + break; + + case 241: // expr_object: expr_method +#line 930 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_method::ptr > ()); } +#line 3759 "parser.cpp" + break; + + case 242: // expr_object: expr_array +#line 931 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_array::ptr > ()); } +#line 3765 "parser.cpp" + break; + + case 243: // expr_object: expr_field +#line 932 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_field::ptr > ()); } +#line 3771 "parser.cpp" + break; + + case 244: // expr_object: expr_game +#line 933 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_game::ptr > ()); } +#line 3777 "parser.cpp" + break; + + case 245: // expr_object: expr_self +#line 934 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_self::ptr > ()); } +#line 3783 "parser.cpp" + break; + + case 246: // expr_object: expr_anim +#line 935 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_anim::ptr > ()); } +#line 3789 "parser.cpp" + break; + + case 247: // expr_object: expr_level +#line 936 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_level::ptr > ()); } +#line 3795 "parser.cpp" + break; + + case 248: // expr_object: expr_identifier +#line 937 "parser.ypp" + { yylhs.value.as < expr::ptr > () = std::move(yystack_[0].value.as < expr_identifier::ptr > ()); } +#line 3801 "parser.cpp" + break; + + case 249: // expr_empty_array: "[" "]" +#line 942 "parser.ypp" + { yylhs.value.as < expr_empty_array::ptr > () = expr_empty_array::make(yylhs.location); } +#line 3807 "parser.cpp" + break; + + case 250: // expr_undefined: "undefined" +#line 947 "parser.ypp" + { yylhs.value.as < expr_undefined::ptr > () = expr_undefined::make(yylhs.location); } +#line 3813 "parser.cpp" + break; + + case 251: // expr_game: "game" +#line 952 "parser.ypp" + { yylhs.value.as < expr_game::ptr > () = expr_game::make(yylhs.location); } +#line 3819 "parser.cpp" + break; + + case 252: // expr_self: "self" +#line 957 "parser.ypp" + { yylhs.value.as < expr_self::ptr > () = expr_self::make(yylhs.location); } +#line 3825 "parser.cpp" + break; + + case 253: // expr_anim: "anim" +#line 962 "parser.ypp" + { yylhs.value.as < expr_anim::ptr > () = expr_anim::make(yylhs.location); } +#line 3831 "parser.cpp" + break; + + case 254: // expr_level: "level" +#line 967 "parser.ypp" + { yylhs.value.as < expr_level::ptr > () = expr_level::make(yylhs.location); } +#line 3837 "parser.cpp" + break; + + case 255: // expr_animation: "%" "identifier" +#line 972 "parser.ypp" + { yylhs.value.as < expr_animation::ptr > () = expr_animation::make(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3843 "parser.cpp" + break; + + case 256: // expr_animtree: "#animtree" +#line 977 "parser.ypp" + { yylhs.value.as < expr_animtree::ptr > () = expr_animtree::make(yylhs.location); } +#line 3849 "parser.cpp" + break; + + case 257: // expr_identifier_nosize: "identifier" +#line 982 "parser.ypp" + { yylhs.value.as < expr_identifier::ptr > () = expr_identifier::make(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3855 "parser.cpp" + break; + + case 258: // expr_identifier: "identifier" +#line 987 "parser.ypp" + { yylhs.value.as < expr_identifier::ptr > () = expr_identifier::make(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3861 "parser.cpp" + break; + + case 259: // expr_identifier: "size" +#line 989 "parser.ypp" + { yylhs.value.as < expr_identifier::ptr > () = expr_identifier::make(yylhs.location, "size"); } +#line 3867 "parser.cpp" + break; + + case 260: // expr_path: "path" "/" "identifier" +#line 994 "parser.ypp" + { yylhs.value.as < expr_path::ptr > () = expr_path::make(yylhs.location, yystack_[2].value.as < std::string > () + "/" + yystack_[0].value.as < std::string > ()); } +#line 3873 "parser.cpp" + break; + + case 261: // expr_path: "identifier" +#line 996 "parser.ypp" + { yylhs.value.as < expr_path::ptr > () = expr_path::make(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3879 "parser.cpp" + break; + + case 262: // expr_path: "path" +#line 998 "parser.ypp" + { yylhs.value.as < expr_path::ptr > () = expr_path::make(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3885 "parser.cpp" + break; + + case 263: // expr_istring: "localized string" +#line 1003 "parser.ypp" + { yylhs.value.as < expr_istring::ptr > () = expr_istring::make(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3891 "parser.cpp" + break; + + case 264: // expr_string: "string literal" +#line 1008 "parser.ypp" + { yylhs.value.as < expr_string::ptr > () = expr_string::make(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3897 "parser.cpp" + break; + + case 265: // expr_vector: "(" expr "," expr "," expr ")" +#line 1013 "parser.ypp" + { yylhs.value.as < expr_vector::ptr > () = expr_vector::make(yylhs.location, std::move(yystack_[5].value.as < expr::ptr > ()), std::move(yystack_[3].value.as < expr::ptr > ()), std::move(yystack_[1].value.as < expr::ptr > ())); } +#line 3903 "parser.cpp" + break; + + case 266: // expr_hash: "hash string" +#line 1018 "parser.ypp" + { yylhs.value.as < expr_hash::ptr > () = expr_hash::make(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3909 "parser.cpp" + break; + + case 267: // expr_float: "-" "float" +#line 1023 "parser.ypp" + { yylhs.value.as < expr_float::ptr > () = expr_float::make(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } +#line 3915 "parser.cpp" + break; + + case 268: // expr_float: "float" +#line 1025 "parser.ypp" + { yylhs.value.as < expr_float::ptr > () = expr_float::make(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3921 "parser.cpp" + break; + + case 269: // expr_integer: "-" "integer" +#line 1030 "parser.ypp" + { yylhs.value.as < expr_integer::ptr > () = expr_integer::make(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } +#line 3927 "parser.cpp" + break; + + case 270: // expr_integer: "integer" +#line 1032 "parser.ypp" + { yylhs.value.as < expr_integer::ptr > () = expr_integer::make(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3933 "parser.cpp" + break; + + case 271: // expr_false: "false" +#line 1037 "parser.ypp" + { yylhs.value.as < expr_false::ptr > () = expr_false::make(yylhs.location); } +#line 3939 "parser.cpp" + break; + + case 272: // expr_true: "true" +#line 1042 "parser.ypp" + { yylhs.value.as < expr_true::ptr > () = expr_true::make(yylhs.location); } +#line 3945 "parser.cpp" + break; + + +#line 3949 "parser.cpp" + + default: + break; + } + } +#if YY_EXCEPTIONS + catch (const syntax_error& yyexc) + { + YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; + error (yyexc); + YYERROR; + } +#endif // YY_EXCEPTIONS + YY_SYMBOL_PRINT ("-> $$ =", yylhs); + yypop_ (yylen); + yylen = 0; + + // Shift the result of the reduction. + yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); + } + goto yynewstate; + + + /*--------------------------------------. + | yyerrlab -- here on detecting error. | + `--------------------------------------*/ + yyerrlab: + // If not already recovering from an error, report this error. + if (!yyerrstatus_) + { + ++yynerrs_; + context yyctx (*this, yyla); + std::string msg = yysyntax_error_ (yyctx); + error (yyla.location, YY_MOVE (msg)); + } + + + yyerror_range[1].location = yyla.location; + if (yyerrstatus_ == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + // Return failure if at end of input. + if (yyla.kind () == symbol_kind::S_YYEOF) + YYABORT; + else if (!yyla.empty ()) + { + yy_destroy_ ("Error: discarding", yyla); + yyla.clear (); + } + } + + // Else will try to reuse lookahead token after shifting the error token. + goto yyerrlab1; + + + /*---------------------------------------------------. + | yyerrorlab -- error raised explicitly by YYERROR. | + `---------------------------------------------------*/ + yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and + the label yyerrorlab therefore never appears in user code. */ + if (false) + YYERROR; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + yypop_ (yylen); + yylen = 0; + YY_STACK_PRINT (); + goto yyerrlab1; + + + /*-------------------------------------------------------------. + | yyerrlab1 -- common code for both syntax error and YYERROR. | + `-------------------------------------------------------------*/ + yyerrlab1: + yyerrstatus_ = 3; // Each real token shifted decrements this. + // Pop stack until we find a state that shifts the error token. + for (;;) + { + yyn = yypact_[+yystack_[0].state]; + if (!yy_pact_value_is_default_ (yyn)) + { + yyn += symbol_kind::S_YYerror; + if (0 <= yyn && yyn <= yylast_ + && yycheck_[yyn] == symbol_kind::S_YYerror) + { + yyn = yytable_[yyn]; + if (0 < yyn) + break; + } + } + + // Pop the current state because it cannot handle the error token. + if (yystack_.size () == 1) + YYABORT; + + yyerror_range[1].location = yystack_[0].location; + yy_destroy_ ("Error: popping", yystack_[0]); + yypop_ (); + YY_STACK_PRINT (); + } + { + stack_symbol_type error_token; + + yyerror_range[2].location = yyla.location; + YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); + + // Shift the error token. + yy_lac_discard_ ("error recovery"); + error_token.state = state_type (yyn); + yypush_ ("Shifting", YY_MOVE (error_token)); + } + goto yynewstate; + + + /*-------------------------------------. + | yyacceptlab -- YYACCEPT comes here. | + `-------------------------------------*/ + yyacceptlab: + yyresult = 0; + goto yyreturn; + + + /*-----------------------------------. + | yyabortlab -- YYABORT comes here. | + `-----------------------------------*/ + yyabortlab: + yyresult = 1; + goto yyreturn; + + + /*-----------------------------------------------------. + | yyreturn -- parsing is finished, return the result. | + `-----------------------------------------------------*/ + yyreturn: + if (!yyla.empty ()) + yy_destroy_ ("Cleanup: discarding lookahead", yyla); + + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + yypop_ (yylen); + YY_STACK_PRINT (); + while (1 < yystack_.size ()) + { + yy_destroy_ ("Cleanup: popping", yystack_[0]); + yypop_ (); + } + + return yyresult; + } +#if YY_EXCEPTIONS + catch (...) + { + YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; + // Do not try to display the values of the reclaimed symbols, + // as their printers might throw an exception. + if (!yyla.empty ()) + yy_destroy_ (YY_NULLPTR, yyla); + + while (1 < yystack_.size ()) + { + yy_destroy_ (YY_NULLPTR, yystack_[0]); + yypop_ (); + } + throw; + } +#endif // YY_EXCEPTIONS + } + + void + parser::error (const syntax_error& yyexc) + { + error (yyexc.location, yyexc.what ()); + } + + const char * + parser::symbol_name (symbol_kind_type yysymbol) + { + static const char *const yy_sname[] = + { + "end of file", "error", "invalid token", "#", "/#", "#/", "#inline", + "#include", "#using_animtree", "#animtree", "autoexec", "codecall", + "private", "endon", "notify", "wait", "waittill", "waittillmatch", + "waittillframeend", "if", "else", "do", "while", "for", "foreach", "in", + "switch", "case", "default", "break", "continue", "return", "prof_begin", + "prof_end", "thread", "true", "false", "undefined", "size", "game", + "self", "anim", "level", "const", "getnextarraykey", "getfirstarraykey", + "getdvarcoloralpha", "getdvarcolorblue", "getdvarcolorgreen", + "getdvarcolorred", "getdvarvector", "getdvarfloat", "getdvarint", + "getdvar", "gettime", "abs", "vectortoangles", "angleclamp180", + "anglestoforward", "anglestoright", "anglestoup", "vectorscale", + "isdefined", "(", ")", "{", "}", "[", "]", ",", ".", "..", "...", "::", + ":", ";", "?", "++", "--", "<<", ">>", "||", "&&", "==", "!=", "<=", + ">=", "<", ">", "!", "~", "=", "+=", "-=", "*=", "/=", "%=", "|=", "&=", + "^=", ">>=", "<<=", "|", "&", "^", "+", "-", "*", "/", "%", "path", + "identifier", "string literal", "localized string", "hash string", + "float", "integer", "SIZEOF", "THEN", "TERN", "NEG", "ANIMREF", "PREINC", + "PREDEC", "POSTINC", "POSTDEC", "$accept", "root", "program", "inline", + "include", "declaration", "decl_usingtree", "decl_function", "stmt", + "stmt_or_dev", "stmt_list", "stmt_or_dev_list", "stmt_dev", "stmt_comp", + "stmt_expr", "stmt_call", "stmt_const", "stmt_assign", "stmt_endon", + "stmt_notify", "stmt_wait", "stmt_waittill", "stmt_waittillmatch", + "stmt_waittillframeend", "stmt_if", "stmt_ifelse", "stmt_while", + "stmt_dowhile", "stmt_for", "stmt_foreach", "stmt_switch", "stmt_case", + "stmt_default", "stmt_break", "stmt_continue", "stmt_return", + "stmt_prof_begin", "stmt_prof_end", "expr", "expr_or_empty", + "expr_increment", "expr_decrement", "expr_assign", "expr_ternary", + "expr_binary", "expr_primitive", "expr_complement", "expr_negate", + "expr_not", "expr_call", "expr_method", "expr_function", "expr_pointer", + "expr_parameters", "expr_parameters_default", "expr_arguments", + "expr_arguments_no_empty", "expr_getnextarraykey", + "expr_getfirstarraykey", "expr_getdvarcoloralpha", + "expr_getdvarcolorblue", "expr_getdvarcolorgreen", + "expr_getdvarcolorred", "expr_getdvarvector", "expr_getdvarfloat", + "expr_getdvarint", "expr_getdvar", "expr_gettime", "expr_abs", + "expr_vectortoangles", "expr_angleclamp180", "expr_anglestoforward", + "expr_anglestoright", "expr_anglestoup", "expr_vectorscale", + "expr_isdefined", "expr_reference", "expr_array", "expr_field", + "expr_size", "expr_paren", "expr_object", "expr_empty_array", + "expr_undefined", "expr_game", "expr_self", "expr_anim", "expr_level", + "expr_animation", "expr_animtree", "expr_identifier_nosize", + "expr_identifier", "expr_path", "expr_istring", "expr_string", + "expr_vector", "expr_hash", "expr_float", "expr_integer", "expr_false", + "expr_true", YY_NULLPTR + }; + return yy_sname[yysymbol]; + } + + + + // parser::context. + parser::context::context (const parser& yyparser, const symbol_type& yyla) + : yyparser_ (yyparser) + , yyla_ (yyla) + {} + + int + parser::context::expected_tokens (symbol_kind_type yyarg[], int yyargn) const + { + // Actual number of expected tokens + int yycount = 0; + +#if ARCDEBUG + // Execute LAC once. We don't care if it is successful, we + // only do it for the sake of debugging output. + if (!yyparser_.yy_lac_established_) + yyparser_.yy_lac_check_ (yyla_.kind ()); +#endif + + for (int yyx = 0; yyx < YYNTOKENS; ++yyx) + { + symbol_kind_type yysym = YY_CAST (symbol_kind_type, yyx); + if (yysym != symbol_kind::S_YYerror + && yysym != symbol_kind::S_YYUNDEF + && yyparser_.yy_lac_check_ (yysym)) + { + if (!yyarg) + ++yycount; + else if (yycount == yyargn) + return 0; + else + yyarg[yycount++] = yysym; + } + } + if (yyarg && yycount == 0 && 0 < yyargn) + yyarg[0] = symbol_kind::S_YYEMPTY; + return yycount; + } + + + + + bool + parser::yy_lac_check_ (symbol_kind_type yytoken) const + { + // Logically, the yylac_stack's lifetime is confined to this function. + // Clear it, to get rid of potential left-overs from previous call. + yylac_stack_.clear (); + // Reduce until we encounter a shift and thereby accept the token. +#if ARCDEBUG + YYCDEBUG << "LAC: checking lookahead " << symbol_name (yytoken) << ':'; +#endif + std::ptrdiff_t lac_top = 0; + while (true) + { + state_type top_state = (yylac_stack_.empty () + ? yystack_[lac_top].state + : yylac_stack_.back ()); + int yyrule = yypact_[+top_state]; + if (yy_pact_value_is_default_ (yyrule) + || (yyrule += yytoken) < 0 || yylast_ < yyrule + || yycheck_[yyrule] != yytoken) + { + // Use the default action. + yyrule = yydefact_[+top_state]; + if (yyrule == 0) + { + YYCDEBUG << " Err\n"; + return false; + } + } + else + { + // Use the action from yytable. + yyrule = yytable_[yyrule]; + if (yy_table_value_is_error_ (yyrule)) + { + YYCDEBUG << " Err\n"; + return false; + } + if (0 < yyrule) + { + YYCDEBUG << " S" << yyrule << '\n'; + return true; + } + yyrule = -yyrule; + } + // By now we know we have to simulate a reduce. + YYCDEBUG << " R" << yyrule - 1; + // Pop the corresponding number of values from the stack. + { + std::ptrdiff_t yylen = yyr2_[yyrule]; + // First pop from the LAC stack as many tokens as possible. + std::ptrdiff_t lac_size = std::ptrdiff_t (yylac_stack_.size ()); + if (yylen < lac_size) + { + yylac_stack_.resize (std::size_t (lac_size - yylen)); + yylen = 0; + } + else if (lac_size) + { + yylac_stack_.clear (); + yylen -= lac_size; + } + // Only afterwards look at the main stack. + // We simulate popping elements by incrementing lac_top. + lac_top += yylen; + } + // Keep top_state in sync with the updated stack. + top_state = (yylac_stack_.empty () + ? yystack_[lac_top].state + : yylac_stack_.back ()); + // Push the resulting state of the reduction. + state_type state = yy_lr_goto_state_ (top_state, yyr1_[yyrule]); + YYCDEBUG << " G" << int (state); + yylac_stack_.push_back (state); + } + } + + // Establish the initial context if no initial context currently exists. + bool + parser::yy_lac_establish_ (symbol_kind_type yytoken) + { + /* Establish the initial context for the current lookahead if no initial + context is currently established. + + We define a context as a snapshot of the parser stacks. We define + the initial context for a lookahead as the context in which the + parser initially examines that lookahead in order to select a + syntactic action. Thus, if the lookahead eventually proves + syntactically unacceptable (possibly in a later context reached via a + series of reductions), the initial context can be used to determine + the exact set of tokens that would be syntactically acceptable in the + lookahead's place. Moreover, it is the context after which any + further semantic actions would be erroneous because they would be + determined by a syntactically unacceptable token. + + yy_lac_establish_ should be invoked when a reduction is about to be + performed in an inconsistent state (which, for the purposes of LAC, + includes consistent states that don't know they're consistent because + their default reductions have been disabled). + + For parse.lac=full, the implementation of yy_lac_establish_ is as + follows. If no initial context is currently established for the + current lookahead, then check if that lookahead can eventually be + shifted if syntactic actions continue from the current context. */ + if (yy_lac_established_) + return true; + else + { +#if ARCDEBUG + YYCDEBUG << "LAC: initial context established for " + << symbol_name (yytoken) << '\n'; +#endif + yy_lac_established_ = true; + return yy_lac_check_ (yytoken); + } + } + + // Discard any previous initial lookahead context. + void + parser::yy_lac_discard_ (const char* event) + { + /* Discard any previous initial lookahead context because of Event, + which may be a lookahead change or an invalidation of the currently + established initial context for the current lookahead. + + The most common example of a lookahead change is a shift. An example + of both cases is syntax error recovery. That is, a syntax error + occurs when the lookahead is syntactically erroneous for the + currently established initial context, so error recovery manipulates + the parser stacks to try to find a new initial context in which the + current lookahead is syntactically acceptable. If it fails to find + such a context, it discards the lookahead. */ + if (yy_lac_established_) + { + YYCDEBUG << "LAC: initial context discarded due to " + << event << '\n'; + yy_lac_established_ = false; + } + } + + + int + parser::yy_syntax_error_arguments_ (const context& yyctx, + symbol_kind_type yyarg[], int yyargn) const + { + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yyla) is + if this state is a consistent state with a default action. + Thus, detecting the absence of a lookahead is sufficient to + determine that there is no unexpected or expected token to + report. In that case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is + a consistent state with a default action. There might have + been a previous inconsistent state, consistent state with a + non-default action, or user semantic action that manipulated + yyla. (However, yyla is currently not documented for users.) + In the first two cases, it might appear that the current syntax + error should have been detected in the previous state when + yy_lac_check was invoked. However, at that time, there might + have been a different syntax error that discarded a different + initial context during error recovery, leaving behind the + current lookahead. + */ + + if (!yyctx.lookahead ().empty ()) + { + if (yyarg) + yyarg[0] = yyctx.token (); + int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); + return yyn + 1; + } + return 0; + } + + // Generate an error message. + std::string + parser::yysyntax_error_ (const context& yyctx) const + { + // Its maximum. + enum { YYARGS_MAX = 5 }; + // Arguments of yyformat. + symbol_kind_type yyarg[YYARGS_MAX]; + int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); + + char const* yyformat = YY_NULLPTR; + switch (yycount) + { +#define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + default: // Avoid compiler warnings. + YYCASE_ (0, YY_("syntax error")); + YYCASE_ (1, YY_("syntax error, unexpected %s")); + YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +#undef YYCASE_ + } + + std::string yyres; + // Argument number. + std::ptrdiff_t yyi = 0; + for (char const* yyp = yyformat; *yyp; ++yyp) + if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) + { + yyres += symbol_name (yyarg[yyi++]); + ++yyp; + } + else + yyres += *yyp; + return yyres; + } + + + const short parser::yypact_ninf_ = -450; + + const short parser::yytable_ninf_ = -262; + + const short + parser::yypact_[] = + { + 355, -450, -450, -25, -25, -42, -7, -7, -7, -450, + -450, -450, 15, 730, -450, -450, -450, -450, -450, -11, + -85, -450, -46, -39, -56, -5, 1, 4, -450, -450, + -450, -450, -450, -7, -28, -450, -450, -450, 42, -7, + -7, -7, -34, -450, -22, -450, 14, -27, -20, -19, + 43, -7, 1263, -450, 43, 43, 43, 1449, -450, -450, + -22, -450, 5, -450, -450, -450, -450, -450, -450, -450, + 46, 49, 56, 58, 64, 74, 78, 96, 101, 102, + 105, 108, 109, 112, 114, 117, 128, 134, 136, 1263, + 25, -7, 1263, 1263, 40, 87, 130, -450, -450, -450, + -450, 3123, -450, -450, -450, -450, -450, -450, 135, 173, + -450, -450, -450, -450, -450, -450, -450, -450, 143, -450, + -450, -450, -450, -450, 148, 152, 156, 157, 159, 165, + -450, -450, 187, 271, -450, -450, 301, -450, -450, 354, + 362, 473, 555, -450, -450, 50, 160, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, 1577, 1263, + 126, 171, 1770, 175, 176, 178, 181, -78, 184, 174, + 180, 1097, 197, 198, -7, -450, 183, -450, 988, 988, + -450, -450, 1513, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, 188, 191, + 192, 194, 199, 143, 148, 152, 156, 157, 159, 165, + -450, -450, 1676, -450, -450, -450, -450, 212, 186, 209, + 215, 206, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, + 1263, 1263, 216, 1263, 1263, 1263, 1263, 1263, 1263, 1263, + 1263, 1653, 1263, -450, -450, -450, -450, 1263, -450, -450, + -450, -450, 187, 271, -450, 639, 50, -450, 1263, 1263, + 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, + 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, + 1263, 1263, 1263, 1263, 1346, -6, -450, -450, 212, 1263, + -7, -450, -450, -450, 1641, 3040, -450, 1263, 259, 1263, + 1800, -7, 1263, 177, 213, 217, -450, -450, -450, -450, + 3075, 1263, 1263, 204, 639, 639, -450, -450, -450, -450, + -450, -450, -450, -450, 233, 236, 244, 245, 190, -450, + -450, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, + 1263, 1263, -7, 1263, 1263, -7, 2887, 1941, 1975, 1988, + 2022, 2035, 2069, 2082, 2116, 2129, -450, 2163, 2176, 2210, + 2223, 2257, 2270, 2928, 2304, -450, 1263, 1176, 2317, 3005, + 238, 238, 3154, 1869, 740, 740, 588, 588, 588, 588, + 3164, 3205, 3195, 76, 76, -450, -450, -450, 1259, 1342, + 2594, 2636, 2678, 2720, 2762, 1180, 2804, -450, -450, -450, + 3123, -16, -450, 250, -450, -450, -450, -450, 2351, 252, + 2364, 241, -450, -450, -450, 1798, -3, 2398, -450, -450, + -450, -9, -1, 1263, 1263, 1263, 1263, 1263, 3123, 3123, + 3123, 3123, 3123, 3123, 3123, 3123, 3123, 3123, 3123, 250, + 2846, 7, 254, 1263, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, 1263, + -450, 2969, 251, 1263, -450, -450, -450, -450, -450, -450, + -450, -450, -450, 1263, 1263, 1770, 1263, 1770, 1263, 1263, + -7, 43, 246, 248, 3110, 2411, 1836, 1882, 1928, 258, + -450, 1263, 2445, 2458, 1263, 257, 3123, 3123, 59, 307, + 2492, -450, 3123, 262, 2505, 304, -450, -450, -450, -450, + 274, 275, 1263, 276, 1263, 278, 1263, 293, 71, -450, + -450, 2539, 1263, -450, 1770, 289, 1800, 1770, 1263, -450, + -450, 303, 305, -450, 306, -450, 312, 1263, -450, -450, + 79, -450, -450, 319, -450, 2552, 309, 310, 314, 88, + -450, 1770, 1770, -450, -450, -450, -450, -450, -450 + }; + + const short + parser::yydefact_[] = + { + 3, 14, 15, 0, 0, 0, 0, 0, 0, 259, + 8, 258, 0, 2, 9, 10, 11, 16, 17, 0, + 262, 261, 0, 0, 0, 0, 0, 0, 1, 4, + 5, 6, 7, 202, 0, 12, 13, 264, 0, 202, + 202, 202, 0, 200, 201, 260, 0, 0, 0, 0, + 0, 0, 0, 18, 0, 0, 0, 0, 19, 198, + 199, 256, 0, 272, 271, 250, 251, 252, 253, 254, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 258, 263, 266, 268, + 270, 203, 97, 98, 99, 136, 137, 138, 139, 140, + 188, 189, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 0, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 0, 174, 175, 176, + 177, 178, 179, 180, 181, 20, 21, 22, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 60, 0, 56, 0, 0, + 47, 54, 0, 48, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 0, 0, + 0, 240, 241, 0, 0, 0, 0, 0, 0, 0, + 242, 243, 0, 244, 245, 246, 247, 248, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 249, 227, 187, 182, 0, 267, 269, + 240, 241, 185, 186, 184, 0, 183, 255, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 190, 191, 0, 205, + 0, 58, 52, 50, 0, 0, 79, 0, 0, 0, + 64, 0, 0, 0, 0, 0, 90, 91, 92, 94, + 0, 205, 205, 0, 102, 104, 59, 55, 53, 69, + 70, 68, 65, 66, 0, 0, 0, 0, 0, 103, + 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 205, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 218, 0, 0, 0, + 0, 0, 0, 0, 0, 239, 0, 0, 0, 0, + 129, 130, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 131, 132, 133, 134, 135, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 238, 257, 237, + 207, 0, 204, 228, 57, 51, 49, 74, 0, 0, + 0, 0, 62, 63, 61, 0, 0, 0, 89, 88, + 93, 0, 0, 0, 0, 0, 0, 0, 106, 112, + 113, 114, 115, 116, 107, 108, 109, 111, 110, 0, + 0, 0, 0, 0, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 219, 220, 221, 222, 223, 224, 0, + 226, 0, 0, 0, 230, 231, 232, 233, 234, 235, + 236, 229, 192, 0, 205, 0, 0, 0, 101, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 194, 205, 0, 0, 0, 0, 117, 206, 0, 80, + 0, 82, 100, 0, 0, 0, 87, 95, 96, 67, + 0, 0, 205, 0, 205, 0, 205, 0, 0, 208, + 225, 0, 205, 193, 0, 0, 64, 0, 0, 71, + 73, 0, 204, 76, 204, 78, 204, 205, 195, 265, + 0, 81, 83, 0, 85, 0, 0, 0, 0, 0, + 196, 0, 0, 72, 75, 77, 197, 84, 86 + }; + + const short + parser::yypgoto_[] = + { + -450, -450, -450, 374, 378, 384, -450, -450, -157, 219, + -450, -450, -450, -36, -138, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, + -450, -450, -450, -450, -450, -450, -450, -450, 636, -450, + -308, -307, -294, -450, -450, -450, -450, -450, -450, -48, + -40, -111, -89, 154, 351, -295, -449, -450, -450, -450, + -450, -450, -450, -33, -450, -450, -450, -450, -450, 30, + 38, 69, 110, 124, 196, -450, -450, 228, 237, -450, + 315, 300, -450, -450, 459, 474, 520, 529, -450, -450, + -450, 0, 8, -450, -14, -450, -450, -450, 255, -450, + -450 + }; + + const short + parser::yydefgoto_[] = + { + 0, 12, 13, 14, 15, 16, 17, 18, 180, 181, + 304, 182, 183, 184, 421, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 410, 513, + 208, 209, 210, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 42, 43, 541, 412, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 409, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154 + }; + + const short + parser::yytable_[] = + { + 19, 303, 422, 423, 411, 308, 25, 26, 27, 211, + 38, 22, 23, 19, 58, 28, 424, 212, 155, 156, + 157, 24, 489, 34, 213, 296, 431, 432, 313, 35, + 50, 9, 407, 44, 37, 51, 36, 54, 100, 44, + 44, 44, 51, 9, 55, 56, 260, 297, 482, 51, + 51, 60, 33, 483, 261, 492, 37, 227, 39, 451, + 483, 213, 230, 493, 40, 228, 490, 41, 483, 52, + 231, 500, 229, 542, 62, 544, 483, 546, 9, 66, + 67, 68, 69, 45, -248, 20, 21, 214, -248, 53, + 76, 254, 252, 253, 266, 215, 82, 83, 84, 85, + 86, 87, 228, 257, 11, 408, 46, 176, 57, 232, + 211, 296, 233, 299, 211, 20, 96, -248, 212, 234, + -248, 235, 212, 533, 214, 213, 216, 236, 483, 213, + 260, 260, 215, 297, 211, 548, 298, 237, 261, 261, + 483, 238, 212, 560, 228, 213, 213, 416, 483, 213, + 20, 96, 566, 314, 296, 258, 259, 483, 227, 239, + -248, -248, 227, 216, 240, 241, 228, 217, 242, -240, + 228, 243, 244, -240, 323, 245, 297, 246, 227, 227, + 247, 218, 227, 284, 285, 286, 228, 228, 214, 508, + 228, 248, 214, 47, 48, 49, 215, 249, 267, 250, + 215, 306, -240, -261, 217, -240, 528, -241, 214, 214, + 287, -241, 214, 296, 296, 288, 215, 215, 218, 289, + 215, -242, 298, 290, 291, -242, 292, 216, 422, 423, + 228, 216, 293, 300, 307, 297, 297, 550, 309, 310, + -241, 311, 424, -241, 312, -240, -240, 216, 216, 317, + 252, 216, 559, 219, -242, 318, 211, -242, 316, 352, + 321, 322, 260, 329, 212, 298, 330, 331, 217, 332, + 261, 213, 217, 228, 333, 299, 353, 213, 354, 355, + 366, 419, 218, -241, -241, 220, 218, 428, 217, 217, + 219, 429, 217, 259, 221, 433, 434, -242, -242, 435, + 413, 408, 218, 218, 227, -243, 218, 436, 437, -243, + 227, 426, 228, 484, 296, 486, 488, 501, 228, 505, + 532, 517, 262, 518, 298, 298, 527, 534, 509, 538, + 511, 263, 228, 228, 214, 62, 297, 536, -243, 9, + 214, -243, 215, 282, 283, 284, 285, 286, 215, 539, + 540, 543, 449, 545, 219, 452, 547, 222, 219, 1, + 2, 3, 4, 5, 552, 6, 7, 8, 294, 556, + 557, 295, 483, 216, 219, 219, 558, 551, 219, 216, + 554, -243, -243, 561, 563, 564, 220, 30, -244, 565, + 220, 31, -244, 9, 265, 221, -245, 32, 553, 221, + -245, 328, 59, 0, 567, 568, 220, 220, 0, 264, + 220, 20, 96, 0, 217, 221, 221, 0, 0, 221, + 217, -244, 315, 0, -244, 298, 0, 0, 218, -245, + 10, 0, -245, 228, 218, 0, 0, 211, 0, 211, + 0, 0, 0, 0, 0, 212, 0, 212, 0, 0, + 0, 0, 213, 0, 213, 516, 0, 0, 222, 0, + 0, 0, 222, 0, -244, -244, 11, 0, 0, 0, + 0, 0, -245, -245, 0, 0, 0, 0, 324, 325, + 0, 0, 222, 0, 0, 227, 211, 227, 260, 211, + 515, 0, 0, 228, 212, 228, 261, 212, 0, 0, + 219, 213, 0, 213, 213, 0, 219, -246, 0, 0, + 0, -246, 0, 211, 211, 214, 223, 214, 0, 0, + 0, 212, 212, 215, 0, 215, 0, 0, 213, 213, + 0, 224, 220, 0, 227, 0, 227, 227, 220, 0, + -246, 221, 228, -246, 228, 228, 0, 221, 0, 0, + 0, 0, 0, 223, 216, 0, 216, 0, 0, 0, + 0, 227, 227, 0, 214, 0, 214, 214, 224, 228, + 228, 0, 215, 0, 215, 215, 0, 225, 0, 0, + 0, 0, 0, -246, -246, 0, 226, 0, 0, -247, + 0, 214, 214, -247, 0, 217, 0, 217, 0, 215, + 215, 0, 0, 216, 222, 216, 216, 0, 0, 218, + 425, 218, 0, 0, 225, 0, 0, 223, 0, 0, + 0, 223, -247, 226, 0, -247, 0, 0, 0, 0, + 216, 216, 224, 0, 0, 0, 224, 223, 223, 0, + 0, 223, 0, 0, 217, 0, 217, 217, 0, 0, + 0, 0, 224, 224, 0, 0, 224, 0, 218, 0, + 218, 218, 0, 0, 0, -247, -247, 269, 270, 0, + 0, 217, 217, 62, 0, 0, 0, 9, 225, 0, + 0, 219, 225, 219, 0, 218, 218, 226, 101, 0, + 0, 226, 0, 282, 283, 284, 285, 286, 225, 225, + 0, 0, 225, 0, 0, 0, 294, 226, 226, 338, + 0, 226, 0, 220, 0, 220, 0, 0, 0, 0, + 0, 0, 221, 0, 221, 251, 0, 0, 255, 256, + 219, 0, 219, 219, 1, 2, 3, 4, 5, 0, + 6, 7, 8, 0, 0, 0, 0, 0, 0, 20, + 96, 0, 0, 0, 0, 0, 0, 219, 219, 0, + 0, 0, 220, 223, 220, 220, 0, 0, 9, 223, + 0, 221, 0, 221, 221, 0, 0, 0, 224, 0, + 0, 0, 0, 0, 224, 222, 0, 222, 0, 220, + 220, 0, 0, 0, 0, 305, 0, 0, 221, 221, + 0, 0, 0, 0, 0, 29, 0, 320, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 269, + 270, 0, 0, 0, 225, 275, 276, 277, 278, 0, + 225, 0, 0, 226, 222, 0, 425, 222, 0, 226, + 0, 11, 0, 0, 0, 282, 283, 284, 285, 286, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 222, 222, 0, 0, 0, 0, 0, 356, 357, + 358, 359, 360, 361, 362, 363, 364, 365, 0, 367, + 368, 369, 370, 371, 372, 373, 374, 0, 377, 0, + 0, 0, 0, 378, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 379, 380, 381, 382, 383, 384, + 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 406, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 418, 223, 420, 223, 0, 427, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, + 0, 224, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 0, 450, + 0, 0, 0, 223, 0, 223, 223, 0, 0, 0, + 0, 0, 0, 0, 0, 225, 0, 225, 224, 0, + 224, 224, 471, 0, 226, 0, 226, 0, 0, 0, + 223, 223, 62, 0, 0, 0, 9, 66, 67, 68, + 69, 0, 0, 0, 0, 224, 224, 0, 76, 0, + 0, 377, 0, 0, 82, 83, 84, 85, 86, 87, + 0, 0, 0, 0, 225, 176, 225, 225, 0, 0, + 0, 0, 0, 226, 0, 226, 226, 0, 0, 494, + 495, 496, 497, 498, 0, 0, 0, 0, 0, 0, + 0, 225, 225, 0, 0, 0, 0, 0, 0, 502, + 226, 226, 0, 0, 0, 0, 0, 0, 20, 96, + 0, 0, 0, 0, 0, 503, 61, 0, 0, 506, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 507, + 0, 0, 510, 0, 512, 514, 0, 0, 0, 0, + 0, 62, 63, 64, 65, 9, 66, 67, 68, 69, + 531, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 0, 0, 0, 90, 0, 0, 0, 0, 0, + 91, 0, 319, 0, 555, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 92, 93, 0, 61, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 94, 0, 0, 95, 20, 96, 37, + 97, 98, 99, 100, 62, 63, 64, 65, 9, 66, + 67, 68, 69, 0, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 472, 0, 0, 405, 253, 0, + 0, 0, 268, 91, 0, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 0, 0, 0, 0, 92, + 93, 0, 61, 0, 0, 0, 0, 0, 279, 280, + 281, 282, 283, 284, 285, 286, 94, 0, 0, 95, + 20, 96, 37, 97, 98, 99, 100, 62, 63, 64, + 65, 9, 66, 67, 68, 69, 0, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 474, 0, 0, + 90, 0, 0, 0, 0, 268, 91, 0, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 0, 0, + 0, 0, 92, 93, 0, 61, 0, 0, 0, 0, + 0, 279, 280, 281, 282, 283, 284, 285, 286, 94, + 0, 0, 95, 20, 96, 37, 97, 98, 99, 100, + 62, 63, 64, 65, 9, 66, 67, 68, 69, 0, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 475, 0, 0, 405, 0, 0, 0, 0, 268, 91, + 0, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 0, 0, 0, 0, 92, 93, 0, 0, 0, + 0, 0, 0, 0, 279, 280, 281, 282, 283, 284, + 285, 286, 94, 158, 0, 95, 20, 96, 37, 97, + 98, 99, 100, 0, 159, 0, 0, 160, 161, 0, + 162, 163, 164, 165, 0, 166, 167, 168, 169, 170, + 171, 172, 173, 62, 0, 0, 0, 9, 66, 67, + 68, 69, 174, 0, 0, 0, 0, 0, 0, 76, + 0, 0, 0, 0, 0, 82, 83, 84, 85, 86, + 87, 0, 0, 0, 57, 175, 176, 158, 0, 0, + 0, 0, 0, 0, 177, 0, 178, 179, 159, 0, + 0, 160, 161, 0, 162, 163, 164, 165, 0, 166, + 167, 168, 169, 170, 171, 172, 173, 62, 0, 0, + 0, 9, 66, 67, 68, 69, 174, 0, 0, 20, + 96, 0, 0, 76, 0, 0, 0, 0, 0, 82, + 83, 84, 85, 86, 87, 0, 0, 0, 57, 326, + 176, 0, 301, 0, 0, 0, 0, 0, 327, 0, + 178, 179, 159, 0, 0, 160, 161, 0, 162, 163, + 164, 165, 0, 166, 167, 168, 169, 170, 171, 172, + 173, 62, 0, 0, 0, 9, 66, 67, 68, 69, + 174, 0, 0, 20, 96, 0, 0, 76, 0, 0, + 0, 0, 0, 82, 83, 84, 85, 86, 87, 0, + 0, 0, 57, 0, 176, 0, 414, 0, 0, 0, + 0, 0, 302, 0, 178, 179, 159, 0, 0, 160, + 161, 0, 162, 163, 164, 165, 0, 166, 167, 168, + 169, 170, 171, 172, 173, 62, 0, 0, 0, 9, + 66, 67, 68, 69, 174, 0, 0, 20, 96, 334, + 335, 76, 336, 337, 0, 0, 0, 82, 83, 84, + 85, 86, 87, 0, 0, 0, 57, 0, 176, 0, + 62, 0, 0, 0, 9, 0, 415, 375, 178, 179, + 0, 0, 376, 0, 0, 0, 0, 0, 0, 268, + 0, 0, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 0, 294, 0, 0, 338, 0, 0, 0, + 0, 20, 96, 339, 340, 279, 280, 281, 282, 283, + 284, 285, 286, 0, 0, 0, 0, 341, 342, 343, + 344, 345, 346, 347, 348, 349, 350, 351, 0, 0, + 0, 0, 0, 0, 0, 159, 20, 96, 160, 161, + 0, 162, 163, 164, 165, 0, 166, 167, 168, 169, + 170, 171, 172, 173, 62, 0, 0, 0, 9, 66, + 67, 68, 69, 174, 0, 0, 0, 0, 0, 0, + 76, 0, 0, 0, 0, 0, 82, 83, 84, 85, + 86, 87, 62, 0, 62, 57, 9, 176, 9, 66, + 67, 68, 69, 0, 0, 0, 0, 178, 179, 0, + 76, 0, 0, 0, 0, 0, 82, 83, 84, 85, + 86, 87, 0, 0, 0, 294, 0, 176, 338, 0, + 0, 0, 0, 0, 0, 339, 340, 178, 179, 0, + 20, 96, 0, 0, 0, 0, 0, 0, 0, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, + 521, 0, 0, 0, 0, 522, 0, 0, 20, 96, + 20, 96, 268, 0, 0, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 279, 280, + 281, 282, 283, 284, 285, 286, 523, 0, 269, 270, + 0, 524, 273, 274, 275, 276, 277, 278, 268, 0, + 0, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 0, + 0, 0, 0, 0, 279, 280, 281, 282, 283, 284, + 285, 286, 525, 0, 0, 0, 0, 526, 0, 0, + 0, 0, 0, 0, 268, 454, 0, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 268, 0, 0, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 0, 455, + 0, 0, 0, 279, 280, 281, 282, 283, 284, 285, + 286, 268, 456, 0, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 268, 0, 0, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 0, 457, 0, 0, 0, + 279, 280, 281, 282, 283, 284, 285, 286, 268, 458, + 0, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 268, 0, 0, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 0, 459, 0, 0, 0, 279, 280, 281, + 282, 283, 284, 285, 286, 268, 460, 0, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 268, 0, + 0, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 0, + 461, 0, 0, 0, 279, 280, 281, 282, 283, 284, + 285, 286, 268, 462, 0, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 268, 0, 0, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 0, 463, 0, 0, + 0, 279, 280, 281, 282, 283, 284, 285, 286, 268, + 464, 0, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 268, 0, 0, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 0, 465, 0, 0, 0, 279, 280, + 281, 282, 283, 284, 285, 286, 268, 466, 0, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 268, + 0, 0, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 0, 467, 0, 0, 0, 279, 280, 281, 282, 283, + 284, 285, 286, 268, 468, 0, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 268, 0, 0, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 0, 470, 0, + 0, 0, 279, 280, 281, 282, 283, 284, 285, 286, + 268, 375, 0, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 268, 0, 0, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 0, 485, 0, 0, 0, 279, + 280, 281, 282, 283, 284, 285, 286, 268, 487, 0, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 268, 0, 0, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 0, 491, 0, 0, 0, 279, 280, 281, 282, + 283, 284, 285, 286, 268, 520, 0, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 268, 0, 0, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 0, 529, + 0, 0, 0, 279, 280, 281, 282, 283, 284, 285, + 286, 268, 530, 0, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 268, 0, 0, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 0, 535, 0, 0, 0, + 279, 280, 281, 282, 283, 284, 285, 286, 268, 537, + 0, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 268, 0, 0, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 0, 549, 0, 0, 0, 279, 280, 281, + 282, 283, 284, 285, 286, 268, 562, 0, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 268, 0, + 0, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 0, + 0, 0, 0, 0, 279, 280, 281, 282, 283, 284, + 285, 286, 476, 0, 0, 0, 0, 0, 0, 0, + 268, 0, 0, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 279, 280, 281, 282, + 283, 284, 285, 286, 477, 0, 0, 0, 0, 0, + 0, 0, 268, 0, 0, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 279, 280, + 281, 282, 283, 284, 285, 286, 478, 0, 0, 0, + 0, 0, 0, 0, 268, 0, 0, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 279, 280, 281, 282, 283, 284, 285, 286, 479, 0, + 0, 0, 0, 0, 0, 0, 268, 0, 0, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 279, 280, 281, 282, 283, 284, 285, 286, + 480, 0, 0, 0, 0, 0, 0, 0, 268, 0, + 0, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 279, 280, 281, 282, 283, 284, + 285, 286, 481, 0, 0, 0, 0, 0, 0, 0, + 268, 0, 0, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 279, 280, 281, 282, + 283, 284, 285, 286, 499, 0, 0, 0, 0, 0, + 0, 0, 268, 0, 0, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 279, 280, + 281, 282, 283, 284, 285, 286, 453, 0, 0, 0, + 0, 0, 0, 268, 0, 0, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 279, + 280, 281, 282, 283, 284, 285, 286, 469, 0, 0, + 0, 0, 0, 0, 268, 0, 0, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 279, 280, 281, 282, 283, 284, 285, 286, 504, 0, + 0, 0, 0, 0, 0, 268, 0, 0, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 279, 280, 281, 282, 283, 284, 285, 286, 473, + 0, 268, 0, 0, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 279, 280, 281, + 282, 283, 284, 285, 286, 417, 268, 0, 0, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 279, 280, 281, 282, 283, 284, 285, 286, + 430, 268, 0, 0, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 279, 280, 281, + 282, 283, 284, 285, 286, 519, 268, 0, 0, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 268, + 0, 0, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 0, 0, 0, 0, 0, 279, 280, 281, 282, 283, + 284, 285, 286, 269, 270, 0, 272, 273, 274, 275, + 276, 277, 278, 269, 270, 0, 0, 273, 274, 275, + 276, 277, 278, 0, 0, 0, 279, 280, 281, 282, + 283, 284, 285, 286, 0, 0, 0, 280, 281, 282, + 283, 284, 285, 286, 269, 270, 0, 0, 273, 274, + 275, 276, 277, 278, 269, 270, 0, 0, 273, 274, + 275, 276, 277, 278, 0, 0, 0, 0, 280, 0, + 282, 283, 284, 285, 286, 0, 0, 0, 0, 0, + 282, 283, 284, 285, 286 + }; + + const short + parser::yycheck_[] = + { + 0, 158, 310, 310, 299, 162, 6, 7, 8, 57, + 24, 3, 4, 13, 50, 0, 310, 57, 54, 55, + 56, 63, 25, 108, 57, 136, 321, 322, 106, 75, + 64, 38, 38, 33, 112, 69, 75, 64, 116, 39, + 40, 41, 69, 38, 64, 64, 94, 136, 64, 69, + 69, 51, 63, 69, 94, 64, 112, 57, 63, 354, + 69, 94, 62, 64, 63, 57, 69, 63, 69, 91, + 62, 64, 67, 522, 34, 524, 69, 526, 38, 39, + 40, 41, 42, 111, 34, 110, 111, 57, 38, 75, + 50, 91, 67, 68, 94, 57, 56, 57, 58, 59, + 60, 61, 94, 63, 111, 111, 64, 67, 65, 63, + 158, 222, 63, 63, 162, 110, 111, 67, 158, 63, + 70, 63, 162, 64, 94, 158, 57, 63, 69, 162, + 178, 179, 94, 222, 182, 64, 136, 63, 178, 179, + 69, 63, 182, 64, 136, 178, 179, 304, 69, 182, + 110, 111, 64, 167, 265, 115, 116, 69, 158, 63, + 110, 111, 162, 94, 63, 63, 158, 57, 63, 34, + 162, 63, 63, 38, 174, 63, 265, 63, 178, 179, + 63, 57, 182, 107, 108, 109, 178, 179, 158, 484, + 182, 63, 162, 39, 40, 41, 158, 63, 111, 63, + 162, 75, 67, 73, 94, 70, 501, 34, 178, 179, + 67, 38, 182, 324, 325, 67, 178, 179, 94, 67, + 182, 34, 222, 67, 67, 38, 67, 158, 536, 536, + 222, 162, 67, 73, 63, 324, 325, 532, 63, 63, + 67, 63, 536, 70, 63, 110, 111, 178, 179, 75, + 67, 182, 547, 57, 67, 75, 304, 70, 74, 73, + 63, 63, 310, 75, 304, 265, 75, 75, 158, 75, + 310, 304, 162, 265, 75, 63, 67, 310, 63, 73, + 64, 22, 158, 110, 111, 57, 162, 74, 178, 179, + 94, 74, 182, 116, 57, 91, 63, 110, 111, 63, + 300, 111, 178, 179, 304, 34, 182, 63, 63, 38, + 310, 311, 304, 63, 425, 63, 75, 63, 310, 68, + 63, 75, 94, 75, 324, 325, 68, 20, 485, 25, + 487, 94, 324, 325, 304, 34, 425, 75, 67, 38, + 310, 70, 304, 105, 106, 107, 108, 109, 310, 75, + 75, 75, 352, 75, 158, 355, 63, 57, 162, 4, + 5, 6, 7, 8, 75, 10, 11, 12, 67, 64, + 64, 70, 69, 304, 178, 179, 64, 534, 182, 310, + 537, 110, 111, 64, 75, 75, 158, 13, 34, 75, + 162, 13, 38, 38, 94, 158, 34, 13, 536, 162, + 38, 182, 51, -1, 561, 562, 178, 179, -1, 94, + 182, 110, 111, -1, 304, 178, 179, -1, -1, 182, + 310, 67, 167, -1, 70, 425, -1, -1, 304, 67, + 75, -1, 70, 425, 310, -1, -1, 485, -1, 487, + -1, -1, -1, -1, -1, 485, -1, 487, -1, -1, + -1, -1, 485, -1, 487, 491, -1, -1, 158, -1, + -1, -1, 162, -1, 110, 111, 111, -1, -1, -1, + -1, -1, 110, 111, -1, -1, -1, -1, 178, 179, + -1, -1, 182, -1, -1, 485, 534, 487, 536, 537, + 490, -1, -1, 485, 534, 487, 536, 537, -1, -1, + 304, 534, -1, 536, 537, -1, 310, 34, -1, -1, + -1, 38, -1, 561, 562, 485, 57, 487, -1, -1, + -1, 561, 562, 485, -1, 487, -1, -1, 561, 562, + -1, 57, 304, -1, 534, -1, 536, 537, 310, -1, + 67, 304, 534, 70, 536, 537, -1, 310, -1, -1, + -1, -1, -1, 94, 485, -1, 487, -1, -1, -1, + -1, 561, 562, -1, 534, -1, 536, 537, 94, 561, + 562, -1, 534, -1, 536, 537, -1, 57, -1, -1, + -1, -1, -1, 110, 111, -1, 57, -1, -1, 34, + -1, 561, 562, 38, -1, 485, -1, 487, -1, 561, + 562, -1, -1, 534, 304, 536, 537, -1, -1, 485, + 310, 487, -1, -1, 94, -1, -1, 158, -1, -1, + -1, 162, 67, 94, -1, 70, -1, -1, -1, -1, + 561, 562, 158, -1, -1, -1, 162, 178, 179, -1, + -1, 182, -1, -1, 534, -1, 536, 537, -1, -1, + -1, -1, 178, 179, -1, -1, 182, -1, 534, -1, + 536, 537, -1, -1, -1, 110, 111, 79, 80, -1, + -1, 561, 562, 34, -1, -1, -1, 38, 158, -1, + -1, 485, 162, 487, -1, 561, 562, 158, 52, -1, + -1, 162, -1, 105, 106, 107, 108, 109, 178, 179, + -1, -1, 182, -1, -1, -1, 67, 178, 179, 70, + -1, 182, -1, 485, -1, 487, -1, -1, -1, -1, + -1, -1, 485, -1, 487, 89, -1, -1, 92, 93, + 534, -1, 536, 537, 4, 5, 6, 7, 8, -1, + 10, 11, 12, -1, -1, -1, -1, -1, -1, 110, + 111, -1, -1, -1, -1, -1, -1, 561, 562, -1, + -1, -1, 534, 304, 536, 537, -1, -1, 38, 310, + -1, 534, -1, 536, 537, -1, -1, -1, 304, -1, + -1, -1, -1, -1, 310, 485, -1, 487, -1, 561, + 562, -1, -1, -1, -1, 159, -1, -1, 561, 562, + -1, -1, -1, -1, -1, 75, -1, 171, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 79, + 80, -1, -1, -1, 304, 85, 86, 87, 88, -1, + 310, -1, -1, 304, 534, -1, 536, 537, -1, 310, + -1, 111, -1, -1, -1, 105, 106, 107, 108, 109, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 561, 562, -1, -1, -1, -1, -1, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, -1, 243, + 244, 245, 246, 247, 248, 249, 250, -1, 252, -1, + -1, -1, -1, 257, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 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, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 307, 485, 309, 487, -1, 312, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 485, + -1, 487, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 341, 342, 343, + 344, 345, 346, 347, 348, 349, 350, 351, -1, 353, + -1, -1, -1, 534, -1, 536, 537, -1, -1, -1, + -1, -1, -1, -1, -1, 485, -1, 487, 534, -1, + 536, 537, 376, -1, 485, -1, 487, -1, -1, -1, + 561, 562, 34, -1, -1, -1, 38, 39, 40, 41, + 42, -1, -1, -1, -1, 561, 562, -1, 50, -1, + -1, 405, -1, -1, 56, 57, 58, 59, 60, 61, + -1, -1, -1, -1, 534, 67, 536, 537, -1, -1, + -1, -1, -1, 534, -1, 536, 537, -1, -1, 433, + 434, 435, 436, 437, -1, -1, -1, -1, -1, -1, + -1, 561, 562, -1, -1, -1, -1, -1, -1, 453, + 561, 562, -1, -1, -1, -1, -1, -1, 110, 111, + -1, -1, -1, -1, -1, 469, 9, -1, -1, 473, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 483, + -1, -1, 486, -1, 488, 489, -1, -1, -1, -1, + -1, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 504, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, -1, -1, -1, 67, -1, -1, -1, -1, -1, + 73, -1, 75, -1, 538, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 89, 90, -1, 9, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 106, -1, -1, 109, 110, 111, 112, + 113, 114, 115, 116, 34, 35, 36, 37, 38, 39, + 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 68, -1, -1, 67, 68, -1, + -1, -1, 76, 73, -1, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, -1, -1, -1, -1, 89, + 90, -1, 9, -1, -1, -1, -1, -1, 102, 103, + 104, 105, 106, 107, 108, 109, 106, -1, -1, 109, + 110, 111, 112, 113, 114, 115, 116, 34, 35, 36, + 37, 38, 39, 40, 41, 42, -1, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 68, -1, -1, + 67, -1, -1, -1, -1, 76, 73, -1, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, -1, -1, + -1, -1, 89, 90, -1, 9, -1, -1, -1, -1, + -1, 102, 103, 104, 105, 106, 107, 108, 109, 106, + -1, -1, 109, 110, 111, 112, 113, 114, 115, 116, + 34, 35, 36, 37, 38, 39, 40, 41, 42, -1, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 68, -1, -1, 67, -1, -1, -1, -1, 76, 73, + -1, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, -1, -1, -1, -1, 89, 90, -1, -1, -1, + -1, -1, -1, -1, 102, 103, 104, 105, 106, 107, + 108, 109, 106, 4, -1, 109, 110, 111, 112, 113, + 114, 115, 116, -1, 15, -1, -1, 18, 19, -1, + 21, 22, 23, 24, -1, 26, 27, 28, 29, 30, + 31, 32, 33, 34, -1, -1, -1, 38, 39, 40, + 41, 42, 43, -1, -1, -1, -1, -1, -1, 50, + -1, -1, -1, -1, -1, 56, 57, 58, 59, 60, + 61, -1, -1, -1, 65, 66, 67, 4, -1, -1, + -1, -1, -1, -1, 75, -1, 77, 78, 15, -1, + -1, 18, 19, -1, 21, 22, 23, 24, -1, 26, + 27, 28, 29, 30, 31, 32, 33, 34, -1, -1, + -1, 38, 39, 40, 41, 42, 43, -1, -1, 110, + 111, -1, -1, 50, -1, -1, -1, -1, -1, 56, + 57, 58, 59, 60, 61, -1, -1, -1, 65, 66, + 67, -1, 5, -1, -1, -1, -1, -1, 75, -1, + 77, 78, 15, -1, -1, 18, 19, -1, 21, 22, + 23, 24, -1, 26, 27, 28, 29, 30, 31, 32, + 33, 34, -1, -1, -1, 38, 39, 40, 41, 42, + 43, -1, -1, 110, 111, -1, -1, 50, -1, -1, + -1, -1, -1, 56, 57, 58, 59, 60, 61, -1, + -1, -1, 65, -1, 67, -1, 5, -1, -1, -1, + -1, -1, 75, -1, 77, 78, 15, -1, -1, 18, + 19, -1, 21, 22, 23, 24, -1, 26, 27, 28, + 29, 30, 31, 32, 33, 34, -1, -1, -1, 38, + 39, 40, 41, 42, 43, -1, -1, 110, 111, 13, + 14, 50, 16, 17, -1, -1, -1, 56, 57, 58, + 59, 60, 61, -1, -1, -1, 65, -1, 67, -1, + 34, -1, -1, -1, 38, -1, 75, 64, 77, 78, + -1, -1, 69, -1, -1, -1, -1, -1, -1, 76, + -1, -1, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, -1, 67, -1, -1, 70, -1, -1, -1, + -1, 110, 111, 77, 78, 102, 103, 104, 105, 106, + 107, 108, 109, -1, -1, -1, -1, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, -1, -1, + -1, -1, -1, -1, -1, 15, 110, 111, 18, 19, + -1, 21, 22, 23, 24, -1, 26, 27, 28, 29, + 30, 31, 32, 33, 34, -1, -1, -1, 38, 39, + 40, 41, 42, 43, -1, -1, -1, -1, -1, -1, + 50, -1, -1, -1, -1, -1, 56, 57, 58, 59, + 60, 61, 34, -1, 34, 65, 38, 67, 38, 39, + 40, 41, 42, -1, -1, -1, -1, 77, 78, -1, + 50, -1, -1, -1, -1, -1, 56, 57, 58, 59, + 60, 61, -1, -1, -1, 67, -1, 67, 70, -1, + -1, -1, -1, -1, -1, 77, 78, 77, 78, -1, + 110, 111, -1, -1, -1, -1, -1, -1, -1, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 64, -1, -1, -1, -1, 69, -1, -1, 110, 111, + 110, 111, 76, -1, -1, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 102, 103, + 104, 105, 106, 107, 108, 109, 64, -1, 79, 80, + -1, 69, 83, 84, 85, 86, 87, 88, 76, -1, + -1, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 102, 103, 104, 105, 106, 107, 108, 109, -1, + -1, -1, -1, -1, 102, 103, 104, 105, 106, 107, + 108, 109, 64, -1, -1, -1, -1, 69, -1, -1, + -1, -1, -1, -1, 76, 64, -1, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 76, -1, -1, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 102, 103, 104, 105, 106, 107, 108, 109, -1, 64, + -1, -1, -1, 102, 103, 104, 105, 106, 107, 108, + 109, 76, 64, -1, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 76, -1, -1, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 102, 103, 104, + 105, 106, 107, 108, 109, -1, 64, -1, -1, -1, + 102, 103, 104, 105, 106, 107, 108, 109, 76, 64, + -1, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 76, -1, -1, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 102, 103, 104, 105, 106, 107, + 108, 109, -1, 64, -1, -1, -1, 102, 103, 104, + 105, 106, 107, 108, 109, 76, 64, -1, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 76, -1, + -1, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 102, 103, 104, 105, 106, 107, 108, 109, -1, + 64, -1, -1, -1, 102, 103, 104, 105, 106, 107, + 108, 109, 76, 64, -1, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 76, -1, -1, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 102, 103, + 104, 105, 106, 107, 108, 109, -1, 64, -1, -1, + -1, 102, 103, 104, 105, 106, 107, 108, 109, 76, + 64, -1, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 76, -1, -1, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 102, 103, 104, 105, 106, + 107, 108, 109, -1, 64, -1, -1, -1, 102, 103, + 104, 105, 106, 107, 108, 109, 76, 64, -1, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 76, + -1, -1, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 102, 103, 104, 105, 106, 107, 108, 109, + -1, 64, -1, -1, -1, 102, 103, 104, 105, 106, + 107, 108, 109, 76, 64, -1, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 76, -1, -1, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 102, + 103, 104, 105, 106, 107, 108, 109, -1, 64, -1, + -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, + 76, 64, -1, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 76, -1, -1, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 102, 103, 104, 105, + 106, 107, 108, 109, -1, 64, -1, -1, -1, 102, + 103, 104, 105, 106, 107, 108, 109, 76, 64, -1, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 76, -1, -1, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 102, 103, 104, 105, 106, 107, 108, + 109, -1, 64, -1, -1, -1, 102, 103, 104, 105, + 106, 107, 108, 109, 76, 64, -1, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 76, -1, -1, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 102, 103, 104, 105, 106, 107, 108, 109, -1, 64, + -1, -1, -1, 102, 103, 104, 105, 106, 107, 108, + 109, 76, 64, -1, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 76, -1, -1, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 102, 103, 104, + 105, 106, 107, 108, 109, -1, 64, -1, -1, -1, + 102, 103, 104, 105, 106, 107, 108, 109, 76, 64, + -1, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 76, -1, -1, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 102, 103, 104, 105, 106, 107, + 108, 109, -1, 64, -1, -1, -1, 102, 103, 104, + 105, 106, 107, 108, 109, 76, 64, -1, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 76, -1, + -1, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 102, 103, 104, 105, 106, 107, 108, 109, -1, + -1, -1, -1, -1, 102, 103, 104, 105, 106, 107, + 108, 109, 68, -1, -1, -1, -1, -1, -1, -1, + 76, -1, -1, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 102, 103, 104, 105, + 106, 107, 108, 109, 68, -1, -1, -1, -1, -1, + -1, -1, 76, -1, -1, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 102, 103, + 104, 105, 106, 107, 108, 109, 68, -1, -1, -1, + -1, -1, -1, -1, 76, -1, -1, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 102, 103, 104, 105, 106, 107, 108, 109, 68, -1, + -1, -1, -1, -1, -1, -1, 76, -1, -1, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, + 68, -1, -1, -1, -1, -1, -1, -1, 76, -1, + -1, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 102, 103, 104, 105, 106, 107, + 108, 109, 68, -1, -1, -1, -1, -1, -1, -1, + 76, -1, -1, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 102, 103, 104, 105, + 106, 107, 108, 109, 68, -1, -1, -1, -1, -1, + -1, -1, 76, -1, -1, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 102, 103, + 104, 105, 106, 107, 108, 109, 69, -1, -1, -1, + -1, -1, -1, 76, -1, -1, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 102, + 103, 104, 105, 106, 107, 108, 109, 69, -1, -1, + -1, -1, -1, -1, 76, -1, -1, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 102, 103, 104, 105, 106, 107, 108, 109, 69, -1, + -1, -1, -1, -1, -1, 76, -1, -1, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 102, 103, 104, 105, 106, 107, 108, 109, 74, + -1, 76, -1, -1, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 102, 103, 104, + 105, 106, 107, 108, 109, 75, 76, -1, -1, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, + 75, 76, -1, -1, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 102, 103, 104, + 105, 106, 107, 108, 109, 75, 76, -1, -1, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 76, + -1, -1, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 102, 103, 104, 105, 106, 107, 108, 109, + -1, -1, -1, -1, -1, 102, 103, 104, 105, 106, + 107, 108, 109, 79, 80, -1, 82, 83, 84, 85, + 86, 87, 88, 79, 80, -1, -1, 83, 84, 85, + 86, 87, 88, -1, -1, -1, 102, 103, 104, 105, + 106, 107, 108, 109, -1, -1, -1, 103, 104, 105, + 106, 107, 108, 109, 79, 80, -1, -1, 83, 84, + 85, 86, 87, 88, 79, 80, -1, -1, 83, 84, + 85, 86, 87, 88, -1, -1, -1, -1, 103, -1, + 105, 106, 107, 108, 109, -1, -1, -1, -1, -1, + 105, 106, 107, 108, 109 + }; + + const unsigned char + parser::yystos_[] = + { + 0, 4, 5, 6, 7, 8, 10, 11, 12, 38, + 75, 111, 127, 128, 129, 130, 131, 132, 133, 217, + 110, 111, 218, 218, 63, 217, 217, 217, 0, 75, + 129, 130, 131, 63, 108, 75, 75, 112, 220, 63, + 63, 63, 179, 180, 217, 111, 64, 179, 179, 179, + 64, 69, 91, 75, 64, 64, 64, 65, 139, 180, + 217, 9, 34, 35, 36, 37, 39, 40, 41, 42, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 67, 73, 89, 90, 106, 109, 111, 113, 114, 115, + 116, 164, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 139, 139, 139, 4, 15, + 18, 19, 21, 22, 23, 24, 26, 27, 28, 29, + 30, 31, 32, 33, 43, 66, 67, 75, 77, 78, + 134, 135, 137, 138, 139, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 166, 167, + 168, 175, 176, 189, 195, 196, 197, 198, 199, 200, + 203, 204, 207, 210, 211, 212, 213, 217, 218, 67, + 217, 218, 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + 63, 164, 67, 68, 217, 164, 164, 63, 115, 116, + 175, 176, 203, 204, 206, 207, 217, 111, 76, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 102, + 103, 104, 105, 106, 107, 108, 109, 67, 67, 67, + 67, 67, 67, 67, 67, 70, 177, 178, 217, 63, + 73, 5, 75, 134, 136, 164, 75, 63, 134, 63, + 63, 63, 63, 106, 220, 224, 74, 75, 75, 75, + 164, 63, 63, 217, 207, 207, 66, 75, 135, 75, + 75, 75, 75, 75, 13, 14, 16, 17, 70, 77, + 78, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 73, 67, 63, 73, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 64, 164, 164, 164, + 164, 164, 164, 164, 164, 64, 69, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 67, 164, 38, 111, 216, + 164, 181, 182, 217, 5, 75, 134, 75, 164, 22, + 164, 140, 166, 167, 168, 207, 217, 164, 74, 74, + 75, 181, 181, 91, 63, 63, 63, 63, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 217, + 164, 181, 217, 69, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 69, + 64, 164, 68, 74, 68, 68, 68, 68, 68, 68, + 68, 68, 64, 69, 63, 64, 63, 64, 75, 25, + 69, 64, 64, 64, 164, 164, 164, 164, 164, 68, + 64, 63, 164, 164, 69, 68, 164, 164, 181, 134, + 164, 134, 164, 165, 164, 217, 139, 75, 75, 75, + 64, 64, 69, 64, 69, 64, 69, 68, 181, 64, + 64, 164, 63, 64, 20, 64, 75, 64, 25, 75, + 75, 181, 182, 75, 182, 75, 182, 63, 64, 64, + 181, 134, 75, 140, 134, 164, 64, 64, 64, 181, + 64, 64, 64, 75, 75, 75, 64, 134, 134 + }; + + const unsigned char + parser::yyr1_[] = + { + 0, 126, 127, 127, 128, 128, 128, 128, 128, 128, + 128, 128, 129, 130, 131, 131, 131, 131, 132, 133, + 133, 133, 133, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 135, 135, 136, + 136, 136, 136, 137, 137, 137, 137, 138, 138, 139, + 139, 140, 140, 140, 140, 141, 141, 142, 143, 143, + 143, 144, 145, 145, 146, 147, 147, 148, 148, 149, + 150, 151, 152, 153, 154, 155, 155, 156, 157, 157, + 158, 159, 160, 161, 161, 162, 163, 164, 164, 164, + 165, 165, 166, 166, 167, 167, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 169, 170, 170, + 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, + 170, 170, 170, 170, 170, 170, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 172, 173, 173, 173, 173, 174, 175, 175, + 176, 176, 177, 177, 177, 177, 178, 178, 179, 179, + 179, 179, 179, 180, 181, 181, 182, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 202, 203, + 203, 203, 203, 203, 203, 203, 203, 204, 205, 206, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 217, + 218, 218, 218, 219, 220, 221, 222, 223, 223, 224, + 224, 225, 226 + }; + + const signed char + parser::yyr2_[] = + { + 0, 2, 1, 0, 2, 2, 2, 2, 1, 1, + 1, 1, 3, 3, 1, 1, 1, 1, 5, 5, + 6, 6, 6, 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, 2, + 1, 2, 1, 2, 1, 2, 1, 3, 2, 3, + 2, 1, 1, 1, 0, 2, 2, 5, 2, 2, + 2, 6, 8, 6, 3, 8, 6, 8, 6, 2, + 5, 7, 5, 7, 9, 7, 9, 5, 3, 3, + 2, 2, 2, 3, 2, 5, 5, 1, 1, 1, + 1, 0, 2, 2, 2, 2, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 5, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 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, 2, 2, 2, 2, 2, 2, 1, 1, + 2, 2, 4, 6, 5, 7, 8, 9, 3, 3, + 1, 1, 0, 3, 1, 0, 3, 1, 6, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 3, 4, + 4, 4, 4, 4, 4, 6, 4, 2, 3, 4, + 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, + 3, 1, 1, 1, 1, 7, 1, 2, 1, 2, + 1, 1, 1 + }; + + + + +#if ARCDEBUG + const short + parser::yyrline_[] = + { + 0, 297, 297, 298, 302, 304, 306, 308, 310, 312, + 314, 316, 321, 325, 330, 331, 332, 333, 337, 342, + 344, 346, 348, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 380, 381, 385, + 387, 389, 391, 396, 398, 400, 402, 407, 408, 412, + 413, 417, 419, 421, 424, 428, 430, 435, 440, 442, + 444, 449, 454, 456, 461, 466, 468, 473, 475, 480, + 485, 490, 495, 500, 505, 510, 516, 524, 531, 533, + 538, 543, 548, 553, 555, 560, 565, 570, 571, 572, + 576, 577, 581, 583, 588, 590, 595, 597, 599, 601, + 603, 605, 607, 609, 611, 613, 615, 620, 625, 627, + 629, 631, 633, 635, 637, 639, 641, 643, 645, 647, + 649, 651, 653, 655, 657, 659, 664, 665, 666, 667, + 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, + 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, + 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, + 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, + 708, 709, 713, 718, 720, 722, 724, 729, 734, 735, + 738, 739, 743, 745, 747, 749, 754, 756, 761, 763, + 765, 767, 770, 774, 779, 782, 786, 788, 793, 798, + 803, 808, 813, 818, 823, 828, 833, 838, 843, 848, + 853, 858, 863, 868, 873, 878, 883, 888, 890, 895, + 897, 899, 901, 903, 905, 907, 909, 914, 919, 924, + 929, 930, 931, 932, 933, 934, 935, 936, 937, 941, + 946, 951, 956, 961, 966, 971, 976, 981, 986, 988, + 993, 995, 997, 1002, 1007, 1012, 1017, 1022, 1024, 1029, + 1031, 1036, 1041 + }; + + void + parser::yy_stack_print_ () const + { + *yycdebug_ << "Stack now"; + for (stack_type::const_iterator + i = yystack_.begin (), + i_end = yystack_.end (); + i != i_end; ++i) + *yycdebug_ << ' ' << int (i->state); + *yycdebug_ << '\n'; + } + + void + parser::yy_reduce_print_ (int yyrule) const + { + int yylno = yyrline_[yyrule]; + int yynrhs = yyr2_[yyrule]; + // Print the symbols being reduced, and their result. + *yycdebug_ << "Reducing stack by rule " << yyrule - 1 + << " (line " << yylno << "):\n"; + // The symbols being reduced. + for (int yyi = 0; yyi < yynrhs; yyi++) + YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", + yystack_[(yynrhs) - (yyi + 1)]); + } +#endif // ARCDEBUG + + +#line 13 "parser.ypp" +} } // xsk::arc +#line 5474 "parser.cpp" + +#line 1045 "parser.ypp" + + +namespace xsk::arc +{ + +void parser::error(location const& loc, std::string const& msg) +{ + throw comp_error(loc, msg); +} + +auto parse_switch(stmt_switch& stm) -> void +{ + auto body = stmt_list::make(stm.body->block->loc()); + auto curr = stmt::ptr{ nullptr }; + + auto num = stm.body->block->list.size(); + + for (auto i = 0u; i < num; i++) + { + auto& entry = stm.body->block->list[0]; + + if (entry->is() || entry->is()) + { + if (curr != nullptr) + { + body->list.push_back(std::move(curr)); + } + + curr = std::move(stm.body->block->list[0]); + stm.body->block->list.erase(stm.body->block->list.begin()); + } + else + { + if (curr != nullptr) + { + if (curr->is()) + { + curr->as().body->list.push_back(std::move(entry)); + stm.body->block->list.erase(stm.body->block->list.begin()); + } + else + { + curr->as().body->list.push_back(std::move(entry)); + stm.body->block->list.erase(stm.body->block->list.begin()); + } + } + else + { + throw comp_error(entry->loc(), "missing case statement"); + } + } + } + + if (curr != nullptr) + { + body->list.push_back(std::move(curr)); + } + + stm.body->block = std::move(body); +} + +extern std::unordered_map const tok_to_parser; +extern std::unordered_map const keyword_map; + +auto map_token(context const* ctx_, token& tok) -> parser::symbol_type +{ + if (tok.type == token::NAME) + { + tok.data = ctx_->make_token(tok.data); + + auto const it = keyword_map.find(tok.data); + + if (it != keyword_map.end()) + { + return parser::symbol_type(it->second, tok.pos); + } + + return parser::symbol_type(parser::token::IDENTIFIER, std::move(tok.data), tok.pos); + } + else if (tok.type == token::PATH ||tok.type == token::STRING ||tok.type == token::ISTRING || tok.type == token::INT ||tok.type == token::FLT) + { + auto it = tok_to_parser.find(tok.type); + + if (it != tok_to_parser.end()) + { + return parser::symbol_type(it->second, std::move(tok.data), tok.pos); + } + } + else + { + auto it = tok_to_parser.find(tok.type); + + if (it != tok_to_parser.end()) + { + return parser::symbol_type(it->second, tok.pos); + } + } + + throw error(fmt::format("unmapped token! {}", (u8)tok.type)); +} + +auto ARClex(context const* ctx_, preprocessor& ppr) -> parser::symbol_type +{ + auto tok = ppr.process(); + return map_token(ctx_, tok); +} + +std::unordered_map const tok_to_parser +{{ + { token::NAME, parser::token::IDENTIFIER }, + { token::PATH, parser::token::PATH }, + { token::STRING, parser::token::STRING }, + { token::ISTRING, parser::token::ISTRING }, + { token::HASHSTR, parser::token::HASHSTR }, + { token::INT, parser::token::INTEGER }, + { token::FLT, parser::token::FLOAT }, + { token::PLUS, parser::token::ADD }, + { token::MINUS, parser::token::SUB }, + { token::STAR, parser::token::MUL }, + { token::DIV, parser::token::DIV }, + { token::MOD, parser::token::MOD }, + { token::BITOR, parser::token::BITWISE_OR }, + { token::BITAND, parser::token::BITWISE_AND }, + { token::BITEXOR, parser::token::BITWISE_EXOR }, + { token::ASSIGN, parser::token::ASSIGN }, + { token::PLUSEQ, parser::token::ASSIGN_ADD }, + { token::MINUSEQ, parser::token::ASSIGN_SUB }, + { token::STAREQ, parser::token::ASSIGN_MUL }, + { token::DIVEQ, parser::token::ASSIGN_DIV }, + { token::MODEQ, parser::token::ASSIGN_MOD }, + { token::BITOREQ, parser::token::ASSIGN_BW_OR }, + { token::BITANDEQ, parser::token::ASSIGN_BW_AND }, + { token::BITEXOREQ, parser::token::ASSIGN_BW_EXOR }, + { token::SHLEQ, parser::token::ASSIGN_LSHIFT }, + { token::SHREQ, parser::token::ASSIGN_RSHIFT }, + { token::TILDE, parser::token::COMPLEMENT }, + { token::BANG, parser::token::NOT }, + { token::GT, parser::token::GREATER }, + { token::LT, parser::token::LESS }, + { token::GE, parser::token::GREATER_EQUAL }, + { token::LE, parser::token::LESS_EQUAL }, + { token::NE, parser::token::INEQUALITY }, + { token::EQ, parser::token::EQUALITY }, + { token::OR, parser::token::OR }, + { token::AND, parser::token::AND }, + { token::SHL, parser::token::LSHIFT }, + { token::SHR, parser::token::RSHIFT }, + { token::INC, parser::token::INCREMENT }, + { token::DEC, parser::token::DECREMENT }, + { token::QMARK, parser::token::QMARK }, + { token::DOT, parser::token::DOT }, + { token::DOUBLEDOT, parser::token::DOUBLEDOT }, + { token::ELLIPSIS, parser::token::ELLIPSIS }, + { token::COMMA, parser::token::COMMA }, + { token::COLON, parser::token::COLON }, + { token::SEMICOLON, parser::token::SEMICOLON }, + { token::DOUBLECOLON, parser::token::DOUBLECOLON }, + { token::LBRACKET, parser::token::LBRACKET }, + { token::RBRACKET, parser::token::RBRACKET }, + { token::LBRACE, parser::token::LBRACE }, + { token::RBRACE, parser::token::RBRACE }, + { token::LPAREN, parser::token::LPAREN }, + { token::RPAREN, parser::token::RPAREN }, + { token::DEVBEGIN, parser::token::DEVBEGIN }, + { token::DEVEND, parser::token::DEVEND }, + { token::INLINE, parser::token::INLINE }, + { token::INCLUDE, parser::token::INCLUDE }, + { token::USINGTREE, parser::token::USINGTREE }, + { token::ANIMTREE, parser::token::ANIMTREE }, + { token::AUTOEXEC, parser::token::AUTOEXEC }, + { token::CODECALL, parser::token::CODECALL }, + { token::PRIVATE, parser::token::PRIVATE }, + { token::ENDON, parser::token::ENDON }, + { token::NOTIFY, parser::token::NOTIFY }, + { token::WAIT, parser::token::WAIT }, + { token::WAITTILL, parser::token::WAITTILL }, + { token::WAITTILLMATCH, parser::token::WAITTILLMATCH }, + { token::WAITTILLFRAMEEND, parser::token::WAITTILLFRAMEEND }, + { token::IF, parser::token::IF }, + { token::ELSE, parser::token::ELSE }, + { token::DO, parser::token::DO }, + { token::WHILE, parser::token::WHILE }, + { token::FOR, parser::token::FOR }, + { token::FOREACH, parser::token::FOREACH }, + { token::IN, parser::token::IN }, + { token::SWITCH, parser::token::SWITCH }, + { token::CASE, parser::token::CASE }, + { token::DEFAULT, parser::token::DEFAULT }, + { token::BREAK, parser::token::BREAK }, + { token::CONTINUE, parser::token::CONTINUE }, + { token::RETURN, parser::token::RETURN }, + { token::PROFBEGIN, parser::token::PROFBEGIN }, + { token::PROFEND, parser::token::PROFEND }, + { token::THREAD, parser::token::THREAD }, + { token::TRUE, parser::token::TRUE }, + { token::FALSE, parser::token::FALSE }, + { token::UNDEFINED, parser::token::UNDEFINED }, + { token::SIZE, parser::token::SIZE }, + { token::GAME, parser::token::GAME }, + { token::SELF, parser::token::SELF }, + { token::ANIM, parser::token::ANIM }, + { token::LEVEL, parser::token::LEVEL }, + { token::CONST, parser::token::CONST }, + { token::ISDEFINED, parser::token::ISDEFINED }, + { token::VECTORSCALE, parser::token::VECTORSCALE }, + { token::ANGLESTOUP, parser::token::ANGLESTOUP }, + { token::ANGLESTORIGHT, parser::token::ANGLESTORIGHT }, + { token::ANGLESTOFORWARD, parser::token::ANGLESTOFORWARD }, + { token::ANGLECLAMP180, parser::token::ANGLECLAMP180 }, + { token::VECTORTOANGLES, parser::token::VECTORTOANGLES }, + { token::ABS, parser::token::ABS }, + { token::GETTIME, parser::token::GETTIME }, + { token::GETDVAR, parser::token::GETDVAR }, + { token::GETDVARINT, parser::token::GETDVARINT }, + { token::GETDVARFLOAT, parser::token::GETDVARFLOAT }, + { token::GETDVARVECTOR, parser::token::GETDVARVECTOR }, + { token::GETDVARCOLORRED, parser::token::GETDVARCOLORRED }, + { token::GETDVARCOLORGREEN, parser::token::GETDVARCOLORGREEN }, + { token::GETDVARCOLORBLUE, parser::token::GETDVARCOLORBLUE }, + { token::GETDVARCOLORALPHA, parser::token::GETDVARCOLORALPHA }, + { token::GETFIRSTARRAYKEY, parser::token::GETFIRSTARRAYKEY }, + { token::GETNEXTARRAYKEY, parser::token::GETNEXTARRAYKEY }, + { token::EOS, parser::token::ARCEOF }, + { token::HASH, parser::token::HASH } +}}; + +std::unordered_map const keyword_map +{{ + { "autoexec", parser::token::AUTOEXEC }, + { "codecall", parser::token::CODECALL }, + { "private", parser::token::PRIVATE }, + { "endon", parser::token::ENDON }, + { "notify", parser::token::NOTIFY }, + { "wait", parser::token::WAIT }, + { "waittill", parser::token::WAITTILL }, + { "waittillmatch", parser::token::WAITTILLMATCH }, + { "waittillframeend", parser::token::WAITTILLFRAMEEND }, + { "if", parser::token::IF }, + { "else", parser::token::ELSE }, + { "do", parser::token::DO }, + { "while", parser::token::WHILE }, + { "for", parser::token::FOR }, + { "foreach", parser::token::FOREACH }, + { "in", parser::token::IN }, + { "switch", parser::token::SWITCH }, + { "case", parser::token::CASE }, + { "default", parser::token::DEFAULT }, + { "break", parser::token::BREAK }, + { "continue", parser::token::CONTINUE }, + { "return", parser::token::RETURN }, + { "prof_begin", parser::token::PROFBEGIN }, + { "prof_end", parser::token::PROFEND }, + { "thread", parser::token::THREAD }, + { "true", parser::token::TRUE }, + { "false", parser::token::FALSE }, + { "undefined", parser::token::UNDEFINED }, + { "size", parser::token::SIZE }, + { "game", parser::token::GAME }, + { "self", parser::token::SELF }, + { "anim", parser::token::ANIM }, + { "level", parser::token::LEVEL }, + { "const", parser::token::CONST }, + { "isdefined", parser::token::ISDEFINED }, + { "vectorscale", parser::token::VECTORSCALE }, + { "anglestoup", parser::token::ANGLESTOUP }, + { "anglestoright", parser::token::ANGLESTORIGHT }, + { "anglestoforward", parser::token::ANGLESTOFORWARD }, + { "angleclamp180", parser::token::ANGLECLAMP180 }, + { "vectortoangles", parser::token::VECTORTOANGLES }, + { "abs", parser::token::ABS }, + { "gettime", parser::token::GETTIME }, + { "getdvar", parser::token::GETDVAR }, + { "getdvarint", parser::token::GETDVARINT }, + { "getdvarfloat", parser::token::GETDVARFLOAT }, + { "getdvarvector", parser::token::GETDVARVECTOR }, + { "getdvarcolorred", parser::token::GETDVARCOLORRED }, + { "getdvarcolorgreen", parser::token::GETDVARCOLORGREEN }, + { "getdvarcolorblue", parser::token::GETDVARCOLORBLUE }, + { "getdvarcoloralpha", parser::token::GETDVARCOLORALPHA }, + { "getfirstarraykey", parser::token::GETFIRSTARRAYKEY }, + { "getnextarraykey", parser::token::GETNEXTARRAYKEY }, +}}; + +} // namespace xsk::arc diff --git a/src/arc/preprocessor.cpp b/src/arc/preprocessor.cpp new file mode 100644 index 00000000..8250f7cb --- /dev/null +++ b/src/arc/preprocessor.cpp @@ -0,0 +1,1384 @@ +// Copyright 2023 xensik. All rights reserved. +// +// Use of this source code is governed by a GNU GPLv3 license +// that can be found in the LICENSE file. + +#include "xsk/stdinc.hpp" +#include "xsk/arc/preprocessor.hpp" +#include "xsk/arc/context.hpp" + +namespace xsk::arc +{ + +preprocessor::preprocessor(context* ctx, std::string const& name, char const* data, usize size) : ctx_{ ctx }, curr_expr_{ 0 }, expand_{ 0 }, skip_{ false } +{ + lexer_.push(lexer{ ctx, name, data, size }); + defines_.reserve(4); + defines_.insert({ "__FILE__", { define::BUILTIN,/* false,*/ {}, {} }}); + defines_.insert({ "__LINE__", { define::BUILTIN,/* false,*/ {}, {} }}); + defines_.insert({ "__DATE__", { define::BUILTIN,/* false,*/ {}, {} }}); + defines_.insert({ "__TIME__", { define::BUILTIN,/* false,*/ {}, {} }}); + directives_.reserve(15); + directives_.insert({ "if", directive::IF }); + directives_.insert({ "ifdef", directive::IFDEF }); + directives_.insert({ "ifndef", directive::IFNDEF }); + directives_.insert({ "elif", directive::ELIF }); + directives_.insert({ "elifdef", directive::ELIFDEF }); + directives_.insert({ "elifndef", directive::ELIFNDEF }); + directives_.insert({ "else", directive::ELSE }); + directives_.insert({ "endif", directive::ENDIF }); + directives_.insert({ "define", directive::DEFINE }); + directives_.insert({ "undef", directive::UNDEF }); + directives_.insert({ "pragma", directive::PRAGMA }); + directives_.insert({ "warning", directive::WARNING }); + directives_.insert({ "error", directive::ERROR }); + directives_.insert({ "line", directive::LINE }); + directives_.insert({ "include", directive::INCLUDE }); + directives_.insert({ "inline", directive::INLINE }); + directives_.insert({ "using_animtree", directive::USINGTREE }); + + std::tm l_time = {}; + get_local_time(l_time); + get_date_define(&l_time); + get_time_define(&l_time); +} + +auto preprocessor::process() -> token +{ + while (true) + { + auto tok = next_token(); + + if (tok.type == token::MACROBEGIN) + { + reject_.insert(tok.data); + expand_++; + continue; + } + + if (tok.type == token::MACROEND) + { + reject_.erase(tok.data); + expand_--; + continue; + } + + if (tok.type == token::SHARP) + { + if (!expand_ && (tok.space == spacing::null || tok.space == spacing::empty)) + read_directive(tok); + else + read_hashtoken(tok); + continue; + } + + if (skip_) continue; + + if (tok.type == token::NAME) + { + auto const it = defines_.find(tok.data); + + if (it != defines_.end() && (!expand_ || !reject_.contains(tok.data))) + { + expand(tok, it->second); + continue; + } + } + + if (tok.type == token::NEWLINE) + continue; + + return tok; + } +} + +auto preprocessor::push_header(std::string const& file) -> void +{ + try + { + auto name = fmt::format("{}.gsh", file); + + for (auto& inc : includes_) + { + if (inc == name) + throw ppr_error(location{}, fmt::format("recursive header inclusion {} at {}", name, includes_.back())); + } + + auto data = ctx_->load_header(name); + + includes_.push_back(*std::get<0>(data)); + lexer_.push(lexer{ ctx_, *std::get<0>(data), std::get<1>(data), std::get<2>(data) }); + } + catch (std::exception const& e) + { + throw error(fmt::format("parsing header file '{}': {}", file, e.what())); + } +} + +auto preprocessor::pop_header() -> void +{ + if (lexer_.size() > 1) + { + lexer_.pop(); + includes_.erase(includes_.end() - 1); + } + else + { + throw error("no headers to pop"); + } +} + +auto preprocessor::ban_header(location const& loc) -> void +{ + if (lexer_.size() > 1) + { + throw comp_error(loc, "not allowed inside a gsh file"); + } +} + +auto preprocessor::skip_line() -> void +{ + auto tok = read_token(); + + while (tok.type != token::NEWLINE) + tok = read_token(); +} + +auto preprocessor::next_token() -> token +{ + if (!tokens_.empty()) + { + auto tok = tokens_.front(); + tokens_.pop_front(); + + return tok; + } + + return read_token(); +} + +auto preprocessor::read_token() -> token +{ + auto tok = lexer_.top().lex(); + + if (tok.type == token::EOS) + { + if (!indents_.empty()) + { + skip_ = 0; + // clear indents + throw ppr_error(tok.pos, "missing #endif"); + } + + if (lexer_.size() > 1) + { + pop_header(); + return read_token(); + } + } + + return tok; +} + +auto preprocessor::read_directive(token& tok) -> void +{ + auto next = read_token(); + + if (next.type == token::NEWLINE) + return; + + expect(next, token::NAME); + + auto const it = directives_.find(next.data); + + if (it != directives_.end()) + { + switch (it->second) + { + case directive::IF: + read_directive_if(next); + return; + case directive::IFDEF: + read_directive_ifdef(next); + return; + case directive::IFNDEF: + read_directive_ifndef(next); + return; + case directive::ELIF: + read_directive_elif(next); + return; + case directive::ELIFDEF: + read_directive_elifdef(next); + return; + case directive::ELIFNDEF: + read_directive_elifndef(next); + return; + case directive::ELSE: + read_directive_else(next); + return; + case directive::ENDIF: + read_directive_endif(next); + return; + case directive::PRAGMA: + read_directive_pragma(next); + return; + case directive::WARNING: + read_directive_warning(next); + return; + case directive::ERROR: + read_directive_error(next); + return; + case directive::LINE: + read_directive_line(next); + return; + case directive::DEFINE: + read_directive_define(next); + return; + case directive::UNDEF: + read_directive_undef(next); + return; + case directive::INCLUDE: + read_directive_include(tok, next); + return; + case directive::INLINE: + read_directive_inline(tok, next); + return; + case directive::USINGTREE: + read_directive_usingtree(tok, next); + return; + default: + break; + } + } + + throw ppr_error(next.pos, fmt::format("invalid preprocessing directive '{}'", next.data)); +} + +auto preprocessor::read_directive_if(token&) -> void +{ + auto skip = !evaluate(); + indents_.push({ directive::IF, skip }); + skip_ += skip ? 1 : 0; +} + +auto preprocessor::read_directive_ifdef(token&) -> void +{ + auto skip = false; + + if (skip_) + { + skip_line(); + } + else + { + auto tok = read_token(); + expect(tok, token::NAME); + + auto name = std::move(tok.data); + + tok = read_token(); + expect(tok, token::NEWLINE); + + skip = !defines_.contains(name); + } + + indents_.push({ directive::IFDEF, skip }); + skip_ += skip ? 1 : 0; +} + +auto preprocessor::read_directive_ifndef(token&) -> void +{ + auto skip = false; + + if (skip_) + { + skip_line(); + } + else + { + auto tok = read_token(); + expect(tok, token::NAME); + + auto name = std::move(tok.data); + + tok = read_token(); + expect(tok, token::NEWLINE); + + skip = defines_.contains(name); + } + + indents_.push({ directive::IFNDEF, skip }); + skip_ += skip ? 1 : 0; +} + +auto preprocessor::read_directive_elif(token& tok) -> void +{ + if (indents_.empty()) + { + throw ppr_error(tok.pos, "#elif without #if"); + } + + auto dir = indents_.top(); + indents_.pop(); + skip_ -= dir.skip ? 1 : 0; + + if (dir.type == directive::ELSE) + { + throw ppr_error(tok.pos, "#elif after #else"); + } + + auto skip = !evaluate(); + indents_.push({ directive::ELIF, skip }); + skip_ += skip ? 1 : 0; +} + +auto preprocessor::read_directive_elifdef(token& tok) -> void +{ + if (indents_.empty()) + { + throw ppr_error(tok.pos, "#elifdef without #if"); + } + + auto dir = indents_.top(); + indents_.pop(); + skip_ -= dir.skip ? 1 : 0; + + if (dir.type == directive::ELSE) + { + throw ppr_error(tok.pos, "#elifdef after #else"); + } + + auto skip = false; + + if (skip_) + { + skip_line(); + } + else + { + auto next = read_token(); + expect(next, token::NAME); + + auto name = std::move(next.data); + + next = read_token(); + expect(next, token::NEWLINE); + + skip = !defines_.contains(name); + } + + indents_.push({ directive::ELIFDEF, skip }); + skip_ += skip ? 1 : 0; +} + +auto preprocessor::read_directive_elifndef(token& tok) -> void +{ + if (indents_.empty()) + { + throw ppr_error(tok.pos, "#elifdef without #if"); + } + + auto dir = indents_.top(); + indents_.pop(); + skip_ -= dir.skip ? 1 : 0; + + if (dir.type == directive::ELSE) + { + throw ppr_error(tok.pos, "#elifdef after #else"); + } + + auto skip = false; + + if (skip_) + { + skip_line(); + } + else + { + auto next = read_token(); + expect(next, token::NAME); + + auto name = std::move(next.data); + + next = read_token(); + expect(next, token::NEWLINE); + + skip = defines_.contains(name); + } + + indents_.push({ directive::ELIFNDEF, skip }); + skip_ += skip ? 1 : 0; +} + +auto preprocessor::read_directive_else(token& tok) -> void +{ + auto next = read_token(); + expect(next, token::NEWLINE); + + if (indents_.empty()) + { + throw ppr_error(tok.pos, "#else without #if"); + } + + auto dir = indents_.top(); + indents_.pop(); + skip_ -= dir.skip ? 1 : 0; + + if (dir.type == directive::ELSE) + { + throw ppr_error(tok.pos, "#else after #else"); + } + + auto skip = !dir.skip; + indents_.push({ directive::ELSE, skip }); + skip_ += skip ? 1 : 0; +} + +auto preprocessor::read_directive_endif(token& tok) -> void +{ + auto next = read_token(); + expect(next, token::NEWLINE); + + if (indents_.empty()) + { + throw ppr_error(tok.pos, "#endif without #if"); + } + + auto dir = indents_.top(); + indents_.pop(); + skip_ -= dir.skip ? 1 : 0; +} + +auto preprocessor::read_directive_define(token&) -> void +{ + if (skip_) return skip_line(); + + auto next = read_token(); + expect(next, token::NAME); + + auto name = std::move(next.data); + + if (defines_.contains(name)) + { + throw ppr_error(next.pos, "macro redefinition"); + } + + next = read_token(); + + switch (next.type) + { + case token::NEWLINE: + defines_.insert({ name, define{ define::PLAIN,/* false,*/ {}, {} }}); + break; + case token::LPAREN: + if (next.space == spacing::none) + { + auto params = std::vector{}; + auto last_comma = true; + auto last_elips = false; + + while (true) + { + next = read_token(); + + if (next.type == token::RPAREN) + { + if (last_comma && !params.empty()) + throw ppr_error(next.pos, "misplaced comma in macro param list"); + + break; + } + else if (next.type == token::NAME) + { + if (last_elips) + throw ppr_error(next.pos, "elipsis must be last in macro param list"); + else if (!last_comma) + throw ppr_error(next.pos, "misplaced name in macro param list"); + else + { + auto it = std::find_if(params.begin(), params.end(), [&next](token const& v) { return v.data == next.data; }); + + if (it != params.end()) + { + throw ppr_error(next.pos, "duplicate macro parameter name"); + } + + params.push_back(next); + last_comma = false; + } + } + else if (next.type == token::ELLIPSIS) + { + // TODO: disabled + throw ppr_error(next.pos, "variadic macros not supported"); + // + + // if (!last_comma || last_elips) + // throw ppr_error(next.pos, "misplaced elipsis in macro param list"); + + // last_elips = true; + // last_comma = false; + } + else if (next.type == token::COMMA) + { + if (last_elips) + throw ppr_error(next.pos, "elipsis must be last in macro param list"); + if (last_comma) + throw ppr_error(next.pos, "misplaced comma in macro param list"); + else + last_comma = true; + } + else + throw ppr_error(next.pos, "unexpected token in macro param list"); + } + + auto exp = std::vector{}; + auto last_sharp = false; + next = read_token(); + + while (next.type != token::NEWLINE) + { + if (next.type == token::NAME) + { + auto it = std::find_if(params.begin(), params.end(), [&next](token const& v) { return v.data == next.data; }); + + if (it != params.end()) + { + if (last_sharp) + exp.back().type = token::STRINGIZE; + + next.type = token::MACROARG; + exp.push_back(std::move(next)); + } + else + { + // check for #animtree ?? + if (last_sharp) + throw ppr_error(next.pos, "'#' is not followed by a macro parameter"); + + exp.push_back(std::move(next)); + } + // TODO: VAARGS, VAOPT + } + else if (next.type == token::SHARP) + { + if (!last_sharp) + { + last_sharp = true; + exp.push_back(std::move(next)); + } + else if (next.space == spacing::none) + { + exp.back().type = token::PASTE; + } + else + { + throw ppr_error(next.pos, "'#' is not followed by a macro parameter"); + } + } + else + { + exp.push_back(std::move(next)); + } + + if (exp.back().type != token::SHARP) + last_sharp = false; + + next = read_token(); + } + + expect(next, token::NEWLINE); + + if (!exp.empty()) + { + if (exp.front().type == token::PASTE) + throw ppr_error(next.pos, "'##' cannot appear at start of macro expansion"); + + if (exp.back().type == token::PASTE) + throw ppr_error(next.pos, "'##' cannot appear at end of macro expansion"); + + if (exp.back().type == token::SHARP) + throw ppr_error(next.pos, "'#' is not followed by a macro parameter"); + } + + defines_.insert({ name, define{ define::FUNCTION, /*last_elips,*/ params, exp }}); + break; + } + default: + if (next.space == spacing::back) + { + auto exp = std::vector{}; + exp.push_back(std::move(next)); + next = read_token(); + + while (next.type != token::NEWLINE) + { + exp.push_back(std::move(next)); + next = read_token(); + } + + expect(next, token::NEWLINE); + + defines_.insert({ name, define{ define::OBJECT,/* false,*/ {}, exp }}); + } + else + { + throw ppr_error(next.pos, "invalid macro definition"); + } + break; + } +} + +auto preprocessor::read_directive_undef(token& tok) -> void +{ + if (skip_) return skip_line(); + + auto next = read_token(); + expect(next, token::NAME); + + auto name = std::move(next.data); + + next = read_token(); + expect(next, token::NEWLINE); + + auto const it = defines_.find(name); + + if (it != defines_.end()) + { + if (it->second.type == define::BUILTIN) + throw ppr_error(tok.pos, "can't undefine builtin macro"); + + defines_.erase(it); + } +} + +auto preprocessor::read_directive_pragma(token& tok) -> void +{ + throw ppr_error(tok.pos, "#pragma directive not supported"); +} + +auto preprocessor::read_directive_warning(token& tok) -> void +{ + throw ppr_error(tok.pos, "#warning directive not supported"); +} + +auto preprocessor::read_directive_error(token& tok) -> void +{ + throw ppr_error(tok.pos, "#error directive not supported"); +} + +auto preprocessor::read_directive_line(token& tok) -> void +{ + throw ppr_error(tok.pos, "#line directive not supported"); +} + +auto preprocessor::read_directive_include(token& hash, token& name) -> void +{ + if (skip_) return; + + name.pos.begin = hash.pos.begin; + tokens_.push_front(token{ token::INCLUDE, spacing::none, name.pos }); +} + +auto preprocessor::read_directive_inline(token& hash, token& name) -> void +{ + if (skip_) return; + + name.pos.begin = hash.pos.begin; + tokens_.push_front(token{ token::INLINE, spacing::none, name.pos }); +} + +auto preprocessor::read_directive_usingtree(token& hash, token& name) -> void +{ + if (skip_) return; + + name.pos.begin = hash.pos.begin; + tokens_.push_front(token{ token::USINGTREE, spacing::none, name.pos }); +} + +auto preprocessor::read_hashtoken(token& tok) -> void +{ + if (skip_) return; + + auto next = read_token(); + + if (next.type == token::NAME) + { + if (next.data == "animtree") + { + return read_hashtoken_animtree(tok, next); + } + } + + // TODO: iw9 hash literals #d"src_game" + + // if nothing match return '#' + tokens_.push_front(std::move(next)); + tokens_.push_front(token{ token::HASH, tok.space, tok.pos }); +} + +auto preprocessor::read_hashtoken_animtree(token& hash, token& name) -> void +{ + if (name.space == spacing::none) + { + name.pos.begin = hash.pos.begin; + tokens_.push_front(token{ token::ANIMTREE, spacing::none, name.pos }); + } + else + { + // if '# animtree' return 2 tokens + tokens_.push_front(std::move(name)); + tokens_.push_front(token{ token::HASH, hash.space, hash.pos }); + } +} + +auto preprocessor::expand(token& tok, define& def) -> void +{ + if (def.type == define::PLAIN) + return; + + if (def.type == define::BUILTIN) + { + if (tok.data == "__FILE__") + { + tokens_.push_front(token{ token::STRING, tok.space, tok.pos, *tok.pos.begin.filename }); + } + else if (tok.data == "__LINE__") + { + tokens_.push_front(token{ token::STRING, tok.space, tok.pos, fmt::format("{}", tok.pos.begin.line) }); + } + else if (tok.data == "__DATE__") + { + tokens_.push_front(token{ token::STRING, tok.space, tok.pos, date_ }); + } + else if (tok.data == "__TIME__") + { + tokens_.push_front(token{ token::STRING, tok.space, tok.pos, time_ }); + } + } + else if (def.type == define::OBJECT) + { + tokens_.push_front(token{ token::MACROEND, tok.space, tok.pos, tok.data }); + for (auto it = def.exp.rbegin(); it != def.exp.rend(); ++it) tokens_.push_front(*it); + tokens_.push_front(token{ token::MACROBEGIN, tok.space, tok.pos, tok.data }); + } + else if (def.type == define::FUNCTION) + { + auto next = next_token(); + + if (next.type != token::LPAREN) + { + tokens_.push_front(next); + tokens_.push_front(token{ token::MACROEND, tok.space, tok.pos, tok.data }); + tokens_.push_front(tok); + tokens_.push_front(token{ token::MACROBEGIN, tok.space, tok.pos, tok.data }); + return; + } + + auto args = expand_params(tok, def); + + auto exp = std::vector{}; + exp.reserve(def.exp.size()); + + for (auto i = 0u; i < def.exp.size(); i++) + { + if (def.exp[i].type == token::MACROARG) + { + auto const& name = def.exp[i].data; + + for (auto n = 0u; n < def.args.size(); n++) + { + if (def.args[n].data == name) + { + for (auto t : args.at(n)) exp.push_back(t); + break; + } + } + } + else if (def.exp[i].type == token::MACROVAARGS) + { + // TODO: + // if (!def.vararg) + // throw ppr_error(def.exp[i].pos, "__VA_ARGS__ can only appear in the expansion of a variadic macro"); + + // for (auto t : args.back()) exp.push_back(t); + } + else if (def.exp[i].type == token::MACROVAOPT) + { + // TODO: + // if (!def.vararg) + // throw ppr_error(def.exp[i].pos, "__VA_OPT__ can only appear in the expansion of a variadic macro"); + + // + // if (!args.back().empty()) + // { + // // paste opt + // } + } + else if (def.exp[i].type == token::STRINGIZE) + { + auto name = def.exp[i + 1].data; + auto str = std::string{}; + + for (auto n = 0u; n < def.args.size(); n++) + { + if (def.args[n].data == name) + { + for (size_t idx = 0; auto t : args.at(n)) + { + if (idx != 0 && t.space == spacing::back) + str.append(" "); + str.append(t.to_string()); + idx++; + } + break; + } + } + + exp.push_back(token{ token::STRING, def.exp[i].space, def.exp[i].pos, str }); + i++; + } + else if (def.exp[i].type == token::PASTE) + { + if (exp.back().type == token::NAME && def.exp[i+1].type == token::NAME) + { + exp.back().data.append(def.exp[i+1].data); + } + else + { + throw ppr_error(def.exp[i].pos, "paste can only be applied to identifiers"); + } + i++; + } + else + { + exp.push_back(def.exp[i]); + } + } + + tokens_.push_front(token{ token::MACROEND, tok.space, tok.pos, tok.data }); + for (auto it = exp.rbegin(); it != exp.rend(); ++it) tokens_.push_front(*it); + tokens_.push_front(token{ token::MACROBEGIN, tok.space, tok.pos, tok.data }); + } +} + +auto preprocessor::expand_params(token& tok, define& def) -> std::vector> +{ + auto nest_paren = 0; + auto args = std::vector>{}; + args.push_back({}); + + while (true) + { + auto next = next_token(); + + if (next.type == token::EOS) + { + throw ppr_error(tok.pos, "unterminated function-like macro invocation"); + } + else if (next.type == token::LPAREN) + { + nest_paren++; + args.back().push_back(next); + } + else if (next.type == token::RPAREN) + { + if (nest_paren == 0) + break; + else + { + nest_paren--; + args.back().push_back(next); + } + } + else if (next.type == token::COMMA && nest_paren == 0 /*&& !(def.vararg && args.size() > def.args.size())*/) + { + args.push_back({}); + } + else + { + args.back().push_back(next); + } + } + + if (def.args.empty() && args.size() == 1 && args[0].empty()) + { + args.pop_back(); + } + + if (args.size() < def.args.size()) + { + throw ppr_error(tok.pos, "too few arguments provided to function-like macro invocation"); + } + + if (/*!def.vararg &&*/ args.size() > def.args.size()) + { + throw ppr_error(tok.pos, "too many arguments provided to function-like macro invocation"); + } + + // TODO: expand args + return args; +} + +auto preprocessor::expect(token& tok, token::kind expected, spacing) -> void +{ + if (tok.type != expected) + { + throw ppr_error(tok.pos, fmt::format("expected {} found {}", (u8)expected, (u8)tok.type)); + } +} + +auto preprocessor::evaluate() -> bool +{ + if (skip_) + { + skip_line(); + return 0; + } + + // get expression tokens + auto tok = read_token(); + while (tok.type != token::NEWLINE) + { + tokens_.push_back(tok); + tok = read_token(); + } + + expect(tok, token::NEWLINE); + tokens_.push_back(tok); + + // expand expression and add tokens to expr_ list + bool last_def = false, last_paren = false; + tok = next_token(); + while (tok.type != token::NEWLINE) + { + if (tok.type == token::MACROBEGIN) + { + reject_.insert(tok.data); + expand_++; + } + else if (tok.type == token::MACROEND) + { + reject_.erase(tok.data); + expand_--; + } + else if (tok.type == token::LPAREN && last_def && !last_paren) + { + last_paren = true; + expr_.push_back(std::move(tok)); + } + else if (tok.type == token::NAME) + { + if (tok.data == "defined") + { + last_def = true; + tok.type = token::DEFINED; + expr_.push_back(std::move(tok)); + } + else if (last_def || (last_paren && last_def)) + { + expr_.push_back(std::move(tok)); + } + else + { + last_def = false; + last_paren = false; + + auto const it = defines_.find(tok.data); + + if (it != defines_.end() && (!expand_ || !reject_.contains(tok.data))) + { + expand(tok, it->second); + } + else // macro not defined + { + expr_.push_back(token{ token::FALSE, tok.space, tok.pos }); + } + } + } + else + { + last_def = false; + last_paren = false; + expr_.push_back(std::move(tok)); + } + + tok = next_token(); + } + + expr_.push_back(std::move(tok)); + curr_expr_ = 0; + + auto result = static_cast(eval_expr()); + + if (eval_peek().type != token::NEWLINE) + { + throw ppr_error(eval_peek().pos, "expected end of line in preprocessor expression"); + } + + expr_.clear(); + + return result; +} + +auto preprocessor::eval_next() -> token& +{ + if (!eval_atend()) curr_expr_++; + return eval_prev(); +} + +auto preprocessor::eval_peek() -> token& +{ + return expr_.at(curr_expr_); +} + +auto preprocessor::eval_prev() -> token& +{ + return expr_.at(curr_expr_ - 1); +} + +auto preprocessor::eval_atend() -> bool +{ + return eval_peek().type == token::NEWLINE; +} + +auto preprocessor::eval_check(token::kind type) -> bool +{ + if (eval_atend()) return false; + return eval_peek().type == type; +} + +auto preprocessor::eval_match(token::kind type) -> bool +{ + if (eval_check(type)) + { + eval_next(); + return true; + } + + return false; +} + +auto preprocessor::eval_consume(token::kind type, std::string_view msg) +{ + if (eval_check(type)) return eval_next(); + + throw ppr_error(eval_peek().pos, fmt::format("{}", msg)); +} + +auto preprocessor::eval_expr() -> i32 +{ + auto cond = eval_expr_or(); + + while (eval_match(token::QMARK)) + { + auto lval = eval_expr(); + eval_consume(token::COLON, "expected ':' to match '?' "); + auto rval = eval_expr(); + cond = cond ? lval : rval; + } + + return cond; +} + +auto preprocessor::eval_expr_or() -> i32 +{ + auto lval = eval_expr_and(); + + while (eval_match(token::OR)) + { + auto rval = eval_expr_and(); + lval = lval || rval; + } + + return lval; +} + +auto preprocessor::eval_expr_and() -> i32 +{ + auto lval = eval_expr_bwor(); + + while (eval_match(token::AND)) + { + auto rval = eval_expr_bwor(); + lval = lval && rval; + } + + return lval; +} + +auto preprocessor::eval_expr_bwor() -> i32 +{ + auto lval = eval_expr_bwexor(); + + while (eval_match(token::BITOR)) + { + auto rval = eval_expr_bwexor(); + lval = lval | rval; + } + + return lval; +} + +auto preprocessor::eval_expr_bwexor() -> i32 +{ + auto lval = eval_expr_bwand(); + + while (eval_match(token::BITEXOR)) + { + auto rval = eval_expr_bwand(); + lval = lval ^ rval; + } + + return lval; +} + +auto preprocessor::eval_expr_bwand() -> i32 +{ + auto lval = eval_expr_eq(); + + while (eval_match(token::BITAND)) + { + auto rval = eval_expr_eq(); + lval = lval & rval; + } + + return lval; +} + +auto preprocessor::eval_expr_eq() -> i32 +{ + auto lval = eval_expr_lge(); + + while (eval_match(token::EQ) || eval_match(token::NE)) + { + auto oper = eval_prev(); + auto rval = eval_expr_lge(); + + switch (oper.type) + { + case token::EQ: + lval = lval == rval; + break; + case token::NE: + lval = lval != rval; + break; + default: + break; + } + } + + return lval; +} + +auto preprocessor::eval_expr_lge() -> i32 +{ + auto lval = eval_expr_shift(); + + while (eval_match(token::GT) || eval_match(token::GE) || eval_match(token::LT) || eval_match(token::LE)) + { + auto oper = eval_prev(); + auto rval = eval_expr_shift(); + + switch (oper.type) + { + case token::GT: + lval = lval > rval; + break; + case token::GE: + lval = lval >= rval; + break; + case token::LT: + lval = lval < rval; + break; + case token::LE: + lval = lval <= rval; + break; + default: + break; + } + } + + return lval; +} + +auto preprocessor::eval_expr_shift() -> i32 +{ + auto lval = eval_expr_add(); + + while (eval_match(token::SHL) || eval_match(token::SHR)) + { + auto oper = eval_prev(); + auto rval = eval_expr_add(); + + switch (oper.type) + { + case token::SHL: + lval = lval << rval; + break; + case token::SHR: + lval = lval >> rval; + break; + default: + break; + } + } + + return lval; +} + +auto preprocessor::eval_expr_add() -> i32 +{ + auto lval = eval_expr_factor(); + + while (eval_match(token::PLUS) || eval_match(token::MINUS)) + { + auto oper = eval_prev(); + auto rval = eval_expr_factor(); + + switch (oper.type) + { + case token::PLUS: + lval = lval + rval; + break; + case token::MINUS: + lval = lval - rval; + break; + default: + break; + } + } + + return lval; +} + +auto preprocessor::eval_expr_factor() -> i32 +{ + auto lval = eval_expr_unary(); + + while (eval_match(token::STAR) || eval_match(token::DIV) || eval_match(token::MOD)) + { + auto oper = eval_prev(); + auto rval = eval_expr_unary(); + + switch (oper.type) + { + case token::STAR: + lval = lval * rval; + break; + case token::DIV: + if (rval == 0) + throw ppr_error(oper.pos, "division by 0"); + lval = lval / rval; + break; + case token::MOD: + if (rval == 0) + throw ppr_error(oper.pos, "division by 0"); + lval = lval % rval; + break; + default: + break; + } + } + + return lval; +} + +auto preprocessor::eval_expr_unary() -> i32 +{ + if (eval_match(token::BANG) || eval_match(token::TILDE) || eval_match(token::PLUS) || eval_match(token::MINUS)) + { + auto oper = eval_prev(); + auto rval = eval_expr_unary(); + + switch (oper.type) + { + case token::BANG: + return !rval; + case token::TILDE: + return ~rval; + case token::PLUS: + return rval; + case token::MINUS: + return -rval; + default: + break; + } + } + + return eval_expr_primary(); +} + +auto preprocessor::eval_expr_primary() -> i32 +{ + if (eval_match(token::TRUE)) + return 1; + + if (eval_match(token::FALSE)) + return 0; + + if (eval_match(token::FLT)) + return static_cast(std::stof(eval_prev().data)); + + if (eval_match(token::INT)) + return static_cast(std::stoi(eval_prev().data)); + + if (eval_match(token::LPAREN)) + { + auto val = eval_expr(); + eval_consume(token::RPAREN, "expect ')' after expression."); + return val; + } + + if (eval_match(token::DEFINED)) + { + if (eval_match(token::NAME) || eval_match(token::LPAREN)) + { + auto val = eval_prev(); + + if (val.type == token::NAME) + { + return defines_.contains(val.data); + } + else if (eval_match(token::NAME)) + { + val = eval_prev(); + eval_consume(token::RPAREN, "expect ')' after defined( identifier."); + return defines_.contains(val.data); + } + + throw ppr_error(eval_peek().pos, "expect identifier after defined(."); + } + + throw ppr_error(eval_peek().pos, "expect identifier or '(' after defined."); + } + + throw ppr_error(eval_peek().pos, "invalid preprocessor expression"); +} + +auto preprocessor::get_local_time(std::tm& l_time) -> void +{ + std::time_t t; + time(&t); +#ifndef _WIN32 + localtime_r(&t, &l_time); +#else + localtime_s(&l_time, &t); +#endif +} + +auto preprocessor::get_date_define(std::tm* time_p) -> void +{ + char buf[] = "??? ?? ????"; + std::strftime(buf, sizeof(buf), "%b %d %Y", time_p); + date_ = std::string("\"").append(buf).append("\""); +} + +auto preprocessor::get_time_define(std::tm* time_p) -> void +{ + char buf[] = "??:??:??"; + std::strftime(buf, sizeof(buf), "%T", time_p); + time_ = std::string("\"").append(buf).append("\""); +} + +} // namespace xsk::arc diff --git a/src/arc/source.cpp b/src/arc/source.cpp index 7447ad82..71a2b254 100644 --- a/src/arc/source.cpp +++ b/src/arc/source.cpp @@ -4,9 +4,11 @@ // that can be found in the LICENSE file. #include "xsk/stdinc.hpp" +#include "xsk/utils/string.hpp" #include "xsk/arc/source.hpp" #include "xsk/arc/context.hpp" -#include "xsk/utils/string.hpp" +#include "xsk/arc/preprocessor.hpp" +#include "xsk/arc/parser.hpp" namespace xsk::arc { @@ -15,27 +17,63 @@ source::source(context* ctx) : ctx_{ ctx }, indent_{ 0 } { } +auto source::parse_assembly(buffer const& data) -> assembly::ptr +{ + return parse_assembly(data.data, data.size); +} + +auto source::parse_assembly(std::vector const& data) -> assembly::ptr +{ + return parse_assembly(data.data(), data.size()); +} + +auto source::parse_assembly(u8 const* /*data*/, usize /*size*/) -> assembly::ptr +{ + return assembly::make(); +} + +auto source::parse_program(std::string const& name, buffer const& data) -> program::ptr +{ + return parse_program(name, data.data, data.size); +} + +auto source::parse_program(std::string const& name, std::vector const& data) -> program::ptr +{ + return parse_program(name, data.data(), data.size()); +} + +auto source::parse_program(std::string const& name, u8 const* data, usize size) -> program::ptr +{ + auto res = program::ptr{ nullptr }; + auto ppr = preprocessor{ ctx_, name, reinterpret_cast(data), size }; + auto psr = parser{ ctx_, ppr, res, 0 }; + + if (!psr.parse() && res != nullptr) + return res; + + throw error{ fmt::format("an unknown error ocurred while parsing script {}", name) }; +} + auto source::dump(assembly const& data) -> std::vector { buf_ = std::vector{}; buf_.reserve(0x10000); fmt::format_to(std::back_inserter(buf_), "// {} GSC ASSEMBLY\n", ctx_->engine_name()); - fmt::format_to(std::back_inserter(buf_), "// Dumped by https://github.com/xensik/gsc-tool\n"); + fmt::format_to(std::back_inserter(buf_), "// Generated by https://github.com/xensik/gsc-tool\n"); dump_assembly(data); return std::move(buf_); } - auto source::dump(program const& data) -> std::vector { buf_ = std::vector{}; buf_.reserve(0x10000); fmt::format_to(std::back_inserter(buf_), "// {} GSC SOURCE\n", ctx_->engine_name()); - fmt::format_to(std::back_inserter(buf_), "// Dumped by https://github.com/xensik/gsc-tool\n"); + fmt::format_to(std::back_inserter(buf_), "// Generated by https://github.com/xensik/gsc-tool\n"); dump_program(data); @@ -143,7 +181,7 @@ auto source::dump_program(program const& data) -> void for (auto const& dec : data.declarations) { fmt::format_to(std::back_inserter(buf_), "\n"); - dump_decl(dec); + dump_decl(*dec); } } @@ -159,19 +197,22 @@ auto source::dump_decl(decl const& dec) -> void switch (dec.kind()) { case node::decl_dev_begin: - dump_decl_dev_begin(*dec.as_dev_begin); + dump_decl_dev_begin(dec.as()); break; case node::decl_dev_end: - dump_decl_dev_end(*dec.as_dev_end); + dump_decl_dev_end(dec.as()); break; case node::decl_namespace: - dump_decl_namespace(*dec.as_namespace); + dump_decl_namespace(dec.as()); break; case node::decl_usingtree: - dump_decl_usingtree(*dec.as_usingtree); + dump_decl_usingtree(dec.as()); break; case node::decl_function: - dump_decl_function(*dec.as_function); + dump_decl_function(dec.as()); + break; + case node::decl_empty: + dump_decl_empty(dec.as()); break; default: break; @@ -206,19 +247,22 @@ auto source::dump_decl_function(decl_function const& dec) -> void { indent_ = 0; - if (ctx_->props() & props::version2) + if (ctx_->props() & props::spaces) fmt::format_to(std::back_inserter(buf_), "function "); - if (static_cast(dec.flags) & static_cast(export_flags::export_autoexec)) - fmt::format_to(std::back_inserter(buf_), "autoexec "); - - if (static_cast(dec.flags) & static_cast(export_flags::export_codecall)) - fmt::format_to(std::back_inserter(buf_), "codecall "); - - if (static_cast(dec.flags) & static_cast(export_flags::export_private2)) + if (static_cast(dec.flags) & static_cast(export_flags::export_private)) fmt::format_to(std::back_inserter(buf_), "private "); - if ((ctx_->props() & props::version2) && !dec.space->value.empty()) + if (static_cast(dec.flags) & static_cast(export_flags::export_private2)) + fmt::format_to(std::back_inserter(buf_), "private "); + + if (static_cast(dec.flags) & static_cast(export_flags::export_autoexec)) + fmt::format_to(std::back_inserter(buf_), "autoexec "); + + if (static_cast(dec.flags) & static_cast(export_flags::export_codecall)) + fmt::format_to(std::back_inserter(buf_), "codecall "); + + if ((ctx_->props() & props::spaces) && !dec.space->value.empty()) { fmt::format_to(std::back_inserter(buf_), "{}::", dec.space->value); } @@ -231,123 +275,121 @@ auto source::dump_decl_function(decl_function const& dec) -> void fmt::format_to(std::back_inserter(buf_), "\n"); } +auto source::dump_decl_empty(decl_empty const&) -> void +{ + fmt::format_to(std::back_inserter(buf_), ";"); +} + auto source::dump_stmt(stmt const& stm) -> void { switch (stm.kind()) { case node::stmt_list: - dump_stmt_list(*stm.as_list); + dump_stmt_list(stm.as()); break; case node::stmt_comp: - dump_stmt_comp(*stm.as_comp); + dump_stmt_comp(stm.as()); break; case node::stmt_dev: - dump_stmt_dev(*stm.as_dev); + dump_stmt_dev(stm.as()); break; case node::stmt_expr: - dump_stmt_expr(*stm.as_expr); - break; - case node::stmt_call: - dump_stmt_call(*stm.as_call); - break; - case node::stmt_const: - dump_stmt_const(*stm.as_const); - break; - case node::stmt_assign: - dump_stmt_assign(*stm.as_assign); + dump_stmt_expr(stm.as()); break; case node::stmt_endon: - dump_stmt_endon(*stm.as_endon); + dump_stmt_endon(stm.as()); break; case node::stmt_notify: - dump_stmt_notify(*stm.as_notify); - break; - case node::stmt_realwait: - dump_stmt_realwait(*stm.as_realwait); + dump_stmt_notify(stm.as()); break; case node::stmt_wait: - dump_stmt_wait(*stm.as_wait); + dump_stmt_wait(stm.as()); break; case node::stmt_waittill: - dump_stmt_waittill(*stm.as_waittill); + dump_stmt_waittill(stm.as()); break; case node::stmt_waittillmatch: - dump_stmt_waittillmatch(*stm.as_waittillmatch); + dump_stmt_waittillmatch(stm.as()); break; case node::stmt_waittillframeend: - dump_stmt_waittillframeend(*stm.as_waittillframeend); + dump_stmt_waittillframeend(stm.as()); + break; + case node::stmt_waitrealtime: + dump_stmt_waitrealtime(stm.as()); break; case node::stmt_if: - dump_stmt_if(*stm.as_if); + dump_stmt_if(stm.as()); break; case node::stmt_ifelse: - dump_stmt_ifelse(*stm.as_ifelse); + dump_stmt_ifelse(stm.as()); break; case node::stmt_while: - dump_stmt_while(*stm.as_while); + dump_stmt_while(stm.as()); break; case node::stmt_dowhile: - dump_stmt_dowhile(*stm.as_dowhile); + dump_stmt_dowhile(stm.as()); break; case node::stmt_for: - dump_stmt_for(*stm.as_for); + dump_stmt_for(stm.as()); break; case node::stmt_foreach: - dump_stmt_foreach(*stm.as_foreach); + dump_stmt_foreach(stm.as()); break; case node::stmt_switch: - dump_stmt_switch(*stm.as_switch); + dump_stmt_switch(stm.as()); break; case node::stmt_case: - dump_stmt_case(*stm.as_case); + dump_stmt_case(stm.as()); break; case node::stmt_default: - dump_stmt_default(*stm.as_default); + dump_stmt_default(stm.as()); break; case node::stmt_break: - dump_stmt_break(*stm.as_break); + dump_stmt_break(stm.as()); break; case node::stmt_continue: - dump_stmt_continue(*stm.as_continue); + dump_stmt_continue(stm.as()); break; case node::stmt_return: - dump_stmt_return(*stm.as_return); + dump_stmt_return(stm.as()); break; case node::stmt_breakpoint: - dump_stmt_breakpoint(*stm.as_breakpoint); + dump_stmt_breakpoint(stm.as()); break; case node::stmt_prof_begin: - dump_stmt_prof_begin(*stm.as_prof_begin); + dump_stmt_prof_begin(stm.as()); break; case node::stmt_prof_end: - dump_stmt_prof_end(*stm.as_prof_end); + dump_stmt_prof_end(stm.as()); break; - case node::asm_loc: - dump_asm_loc(*stm.as_loc); + case node::stmt_jmp: + dump_stmt_jmp(stm.as()); break; - case node::asm_jmp: - dump_asm_jmp(*stm.as_jump); + case node::stmt_jmp_back: + dump_stmt_jmp_back(stm.as()); break; - case node::asm_jmp_back: - dump_asm_jmp_back(*stm.as_jump_back); + case node::stmt_jmp_cond: + dump_stmt_jmp_cond(stm.as()); break; - case node::asm_jmp_cond: - dump_asm_jmp_cond(*stm.as_cond); + case node::stmt_jmp_switch: + dump_stmt_jmp_switch(stm.as()); break; - case node::asm_switch: - dump_asm_switch(*stm.as_asm_switch); + case node::stmt_jmp_endswitch: + dump_stmt_jmp_endswitch(stm.as()); break; - case node::asm_endswitch: - dump_asm_endswitch(*stm.as_asm_endswitch); - break; - case node::asm_dev: - dump_asm_dev(*stm.as_asm_dev); + case node::stmt_jmp_dev: + dump_stmt_jmp_dev(stm.as()); break; default: break; } } +auto source::dump_stmt_empty(stmt_empty const&) -> void +{ + fmt::format_to(std::back_inserter(buf_), ";"); +} + auto source::dump_stmt_list(stmt_list const& stm) -> void { auto last_special = false; @@ -355,23 +397,23 @@ auto source::dump_stmt_list(stmt_list const& stm) -> void for (auto const& entry : stm.list) { - if ((&entry != &stm.list.front() && entry.as_node->is_special_stmt()) || last_special) + if ((&entry != &stm.list.front() && entry->is_special_stmt()) || last_special) fmt::format_to(std::back_inserter(buf_), "\n"); - if (entry == node::stmt_dev) + if (entry->is()) { - dump_stmt(entry); + dump_stmt(*entry); } else { fmt::format_to(std::back_inserter(buf_), "{: >{}}", "", indent_); - dump_stmt(entry); + dump_stmt(*entry); } if (&entry != &stm.list.back()) fmt::format_to(std::back_inserter(buf_), "\n"); - if (entry.as_node->is_special_stmt()) + if (entry->is_special_stmt()) last_special = true; else last_special = false; @@ -398,43 +440,47 @@ auto source::dump_stmt_dev(stmt_dev const& stm) -> void auto source::dump_stmt_expr(stmt_expr const& stm) -> void { - dump_expr(stm.value); -} + switch (stm.value->kind()) + { + case node::expr_increment: + dump_expr_increment(stm.value->as()); + break; + case node::expr_decrement: + dump_expr_decrement(stm.value->as()); + break; + case node::expr_assign: + dump_expr_assign(stm.value->as()); + break; + case node::expr_const: + dump_expr_const(stm.value->as()); + break; + case node::expr_call: + dump_expr_call(stm.value->as()); + break; + case node::expr_method: + dump_expr_method(stm.value->as()); + break; + case node::expr_empty: + default: + break; + } -auto source::dump_stmt_call(stmt_call const& stm) -> void -{ - dump_expr(stm.value); - fmt::format_to(std::back_inserter(buf_), ";"); -} - -auto source::dump_stmt_const(stmt_const const& stm) -> void -{ - fmt::format_to(std::back_inserter(buf_), "const "); - dump_expr_identifier(*stm.lvalue); - fmt::format_to(std::back_inserter(buf_), " = "); - dump_expr(stm.rvalue); - fmt::format_to(std::back_inserter(buf_), ";"); -} - -auto source::dump_stmt_assign(stmt_assign const& stm) -> void -{ - dump_expr(stm.value); fmt::format_to(std::back_inserter(buf_), ";"); } auto source::dump_stmt_endon(stmt_endon const& stm) -> void { - dump_expr(stm.obj); + dump_expr(*stm.obj); fmt::format_to(std::back_inserter(buf_), " endon( "); - dump_expr(stm.event); + dump_expr(*stm.event); fmt::format_to(std::back_inserter(buf_), " );"); } auto source::dump_stmt_notify(stmt_notify const& stm) -> void { - dump_expr(stm.obj); + dump_expr(*stm.obj); fmt::format_to(std::back_inserter(buf_), " notify( "); - dump_expr(stm.event); + dump_expr(*stm.event); if (stm.args->list.size() > 0) { @@ -449,55 +495,33 @@ auto source::dump_stmt_notify(stmt_notify const& stm) -> void fmt::format_to(std::back_inserter(buf_), ");"); } -auto source::dump_stmt_realwait(stmt_realwait const& stm) -> void -{ - if (stm.time == node::expr_float || stm.time == node::expr_integer) - { - fmt::format_to(std::back_inserter(buf_), "wait "); - dump_expr(stm.time); - fmt::format_to(std::back_inserter(buf_), ";"); - } - else if (stm.time == node::expr_paren) - { - fmt::format_to(std::back_inserter(buf_), "wait"); - dump_expr(stm.time); - fmt::format_to(std::back_inserter(buf_), ";"); - } - else - { - fmt::format_to(std::back_inserter(buf_), "wait( "); - dump_expr(stm.time); - fmt::format_to(std::back_inserter(buf_), " );"); - } -} - auto source::dump_stmt_wait(stmt_wait const& stm) -> void { - if (stm.time == node::expr_float || stm.time == node::expr_integer) + if (stm.time->is() || stm.time->is()) { fmt::format_to(std::back_inserter(buf_), "wait "); - dump_expr(stm.time); + dump_expr(*stm.time); fmt::format_to(std::back_inserter(buf_), ";"); } - else if (stm.time == node::expr_paren) + else if (stm.time->is()) { fmt::format_to(std::back_inserter(buf_), "wait"); - dump_expr(stm.time); + dump_expr(*stm.time); fmt::format_to(std::back_inserter(buf_), ";"); } else { fmt::format_to(std::back_inserter(buf_), "wait( "); - dump_expr(stm.time); + dump_expr(*stm.time); fmt::format_to(std::back_inserter(buf_), " );"); } } auto source::dump_stmt_waittill(stmt_waittill const& stm) -> void { - dump_expr(stm.obj); + dump_expr(*stm.obj); fmt::format_to(std::back_inserter(buf_), " waittill( "); - dump_expr(stm.event); + dump_expr(*stm.event); if (stm.args->list.size() > 0) { @@ -514,9 +538,9 @@ auto source::dump_stmt_waittill(stmt_waittill const& stm) -> void auto source::dump_stmt_waittillmatch(stmt_waittillmatch const& stm) -> void { - dump_expr(stm.obj); + dump_expr(*stm.obj); fmt::format_to(std::back_inserter(buf_), " waittillmatch( "); - dump_expr(stm.event); + dump_expr(*stm.event); if (stm.args->list.size() > 0) { @@ -536,21 +560,43 @@ auto source::dump_stmt_waittillframeend(stmt_waittillframeend const&) -> void fmt::format_to(std::back_inserter(buf_), "waittillframeend;"); } +auto source::dump_stmt_waitrealtime(stmt_waitrealtime const& stm) -> void +{ + if (stm.time->is() || stm.time->is()) + { + fmt::format_to(std::back_inserter(buf_), "waitrealtime "); + dump_expr(*stm.time); + fmt::format_to(std::back_inserter(buf_), ";"); + } + else if (stm.time->is()) + { + fmt::format_to(std::back_inserter(buf_), "waitrealtime"); + dump_expr(*stm.time); + fmt::format_to(std::back_inserter(buf_), ";"); + } + else + { + fmt::format_to(std::back_inserter(buf_), "waitrealtime( "); + dump_expr(*stm.time); + fmt::format_to(std::back_inserter(buf_), " );"); + } +} + auto source::dump_stmt_if(stmt_if const& stm) -> void { fmt::format_to(std::back_inserter(buf_), "if ( "); - dump_expr(stm.test); + dump_expr(*stm.test); fmt::format_to(std::back_inserter(buf_), " )\n"); - if (stm.body == node::stmt_comp) + if (stm.body->is()) { - dump_stmt(stm.body); + dump_stmt(*stm.body); } else { indent_ += 4; fmt::format_to(std::back_inserter(buf_), "{: >{}}", "", indent_); - dump_stmt(stm.body); + dump_stmt(*stm.body); indent_ -= 4; } } @@ -558,40 +604,40 @@ auto source::dump_stmt_if(stmt_if const& stm) -> void auto source::dump_stmt_ifelse(stmt_ifelse const& stm) -> void { fmt::format_to(std::back_inserter(buf_), "if ( "); - dump_expr(stm.test); + dump_expr(*stm.test); fmt::format_to(std::back_inserter(buf_), " )\n"); - if (stm.stmt_if == node::stmt_comp) + if (stm.stmt_if->is()) { - dump_stmt(stm.stmt_if); + dump_stmt(*stm.stmt_if); } else { indent_ += 4; fmt::format_to(std::back_inserter(buf_), "{: >{}}", "", indent_); - dump_stmt(stm.stmt_if); + dump_stmt(*stm.stmt_if); indent_ -= 4; } fmt::format_to(std::back_inserter(buf_), "\n{: >{}}else", "", indent_); - if (stm.stmt_else == node::stmt_comp) + if (stm.stmt_else->is()) { fmt::format_to(std::back_inserter(buf_), "\n"); - dump_stmt(stm.stmt_else); + dump_stmt(*stm.stmt_else); } else { - if (stm.stmt_else == node::stmt_if || stm.stmt_else == node::stmt_ifelse) + if (stm.stmt_else->is() || stm.stmt_else ->is()) { fmt::format_to(std::back_inserter(buf_), " "); - dump_stmt(stm.stmt_else); + dump_stmt(*stm.stmt_else); } else { indent_ += 4; fmt::format_to(std::back_inserter(buf_), "\n{: >{}}", "", indent_); - dump_stmt(stm.stmt_else); + dump_stmt(*stm.stmt_else); indent_ -= 4; } } @@ -599,26 +645,26 @@ auto source::dump_stmt_ifelse(stmt_ifelse const& stm) -> void auto source::dump_stmt_while(stmt_while const& stm) -> void { - if (stm.test == node::null) + if (stm.test->is()) { fmt::format_to(std::back_inserter(buf_), "while ( true )\n"); } else { fmt::format_to(std::back_inserter(buf_), "while ( "); - dump_expr(stm.test); + dump_expr(*stm.test); fmt::format_to(std::back_inserter(buf_), " )\n"); } - if (stm.body == node::stmt_comp) + if (stm.body->is()) { - dump_stmt(stm.body); + dump_stmt(*stm.body); } else { indent_ += 4; fmt::format_to(std::back_inserter(buf_), "{: >{}}", "", indent_); - dump_stmt(stm.body); + dump_stmt(*stm.body); indent_ -= 4; } } @@ -627,56 +673,58 @@ auto source::dump_stmt_dowhile(stmt_dowhile const& stm) -> void { fmt::format_to(std::back_inserter(buf_), "do\n"); - if (stm.body == node::stmt_comp) + if (stm.body->is()) { - dump_stmt(stm.body); + dump_stmt(*stm.body); } else { indent_ += 4; fmt::format_to(std::back_inserter(buf_), "{: >{}}", "", indent_); - dump_stmt(stm.body); + dump_stmt(*stm.body); indent_ -= 4; } - if (stm.test == node::null) + if (stm.test->is()) { fmt::format_to(std::back_inserter(buf_), "\n{: >{}}while ( true )", "", indent_); } else { fmt::format_to(std::back_inserter(buf_), "\n{: >{}}while (", "", indent_); - dump_expr(stm.test); + dump_expr(*stm.test); fmt::format_to(std::back_inserter(buf_), " );"); } } auto source::dump_stmt_for(stmt_for const& stm) -> void { - if (stm.test == node::null) + if (stm.test->is()) { fmt::format_to(std::back_inserter(buf_), "for (;;)\n"); } else { fmt::format_to(std::back_inserter(buf_), "for ( "); - dump_stmt(stm.init); + dump_stmt(*stm.init); + buf_.pop_back(); fmt::format_to(std::back_inserter(buf_), "; "); - dump_expr(stm.test); + dump_expr(*stm.test); fmt::format_to(std::back_inserter(buf_), "; "); - dump_stmt(stm.iter); + dump_stmt(*stm.iter); + buf_.pop_back(); fmt::format_to(std::back_inserter(buf_), " )\n"); } - if (stm.body == node::stmt_comp) + if (stm.body->is()) { - dump_stmt(stm.body); + dump_stmt(*stm.body); } else { indent_ += 4; fmt::format_to(std::back_inserter(buf_), "{: >{}}", "", indent_); - dump_stmt(stm.body); + dump_stmt(*stm.body); indent_ -= 4; } } @@ -687,24 +735,24 @@ auto source::dump_stmt_foreach(stmt_foreach const& stm) -> void if (stm.use_key) { - dump_expr(/*(ctx_->props() & props::foreach) ? stm.index :*/ stm.key); + dump_expr(*stm.key); fmt::format_to(std::back_inserter(buf_), ", "); } - dump_expr(stm.value); + dump_expr(*stm.value); fmt::format_to(std::back_inserter(buf_), " in "); - dump_expr(stm.container); + dump_expr(*stm.container); fmt::format_to(std::back_inserter(buf_), " )\n"); - if (stm.body == node::stmt_comp) + if (stm.body->is()) { - dump_stmt(stm.body); + dump_stmt(*stm.body); } else { indent_ += 4; fmt::format_to(std::back_inserter(buf_), "{: >{}}", "", indent_); - dump_stmt(stm.body); + dump_stmt(*stm.body); indent_ -= 4; } } @@ -712,7 +760,7 @@ auto source::dump_stmt_foreach(stmt_foreach const& stm) -> void auto source::dump_stmt_switch(stmt_switch const& stm) -> void { fmt::format_to(std::back_inserter(buf_), "switch ( "); - dump_expr(stm.test); + dump_expr(*stm.test); fmt::format_to(std::back_inserter(buf_), " )\n"); dump_stmt_comp(*stm.body); } @@ -720,7 +768,7 @@ auto source::dump_stmt_switch(stmt_switch const& stm) -> void auto source::dump_stmt_case(stmt_case const& stm) -> void { fmt::format_to(std::back_inserter(buf_), "case "); - dump_expr(stm.value); + dump_expr(*stm.value); fmt::format_to(std::back_inserter(buf_), ":"); if (stm.body != nullptr && stm.body->list.size() > 0) @@ -753,14 +801,14 @@ auto source::dump_stmt_continue(stmt_continue const&) -> void auto source::dump_stmt_return(stmt_return const& stm) -> void { - if (stm.value == node::null) + if (stm.value->is()) { fmt::format_to(std::back_inserter(buf_), "return;"); } else { fmt::format_to(std::back_inserter(buf_), "return "); - dump_expr(stm.value); + dump_expr(*stm.value); fmt::format_to(std::back_inserter(buf_), ";"); } } @@ -784,273 +832,214 @@ auto source::dump_stmt_prof_end(stmt_prof_end const& stm) -> void fmt::format_to(std::back_inserter(buf_), ");"); } +auto source::dump_stmt_jmp(stmt_jmp const& stm) -> void +{ + fmt::format_to(std::back_inserter(buf_), "__asm_jmp( {} )", stm.value); +} + +auto source::dump_stmt_jmp_back(stmt_jmp_back const& stm) -> void +{ + fmt::format_to(std::back_inserter(buf_), "__asm_jmp_back( {} )", stm.value); +} + +auto source::dump_stmt_jmp_cond(stmt_jmp_cond const& stm) -> void +{ + fmt::format_to(std::back_inserter(buf_), "__asm_jmp_cond( {} )", stm.value); +} + +auto source::dump_stmt_jmp_true(stmt_jmp_true const& stm) -> void +{ + fmt::format_to(std::back_inserter(buf_), "__asm_jmp_expr_true( {} )", stm.value); +} + +auto source::dump_stmt_jmp_false(stmt_jmp_false const& stm) -> void +{ + fmt::format_to(std::back_inserter(buf_), "__asm_jmp_expr_false( {} )", stm.value); +} + +auto source::dump_stmt_jmp_switch(stmt_jmp_switch const& stm) -> void +{ + fmt::format_to(std::back_inserter(buf_), "__asm_switch( {} )", stm.value); +} + +auto source::dump_stmt_jmp_endswitch(stmt_jmp_endswitch const&) -> void +{ + fmt::format_to(std::back_inserter(buf_), "__asm_endswitch()"); +} + +auto source::dump_stmt_jmp_dev(stmt_jmp_dev const& stm) -> void +{ + fmt::format_to(std::back_inserter(buf_), "__asm_jmp_dev( {} )", stm.value); +} + auto source::dump_expr(expr const& exp) -> void { - switch (exp.as_node->kind()) + switch (exp.kind()) { - case node::expr_increment: - dump_expr_increment(*exp.as_increment); - break; - case node::expr_decrement: - dump_expr_decrement(*exp.as_decrement); - break; - case node::expr_assign_equal: - dump_expr_assign_equal(*exp.as_assign_equal); - break; - case node::expr_assign_add: - dump_expr_assign_add(*exp.as_assign_add); - break; - case node::expr_assign_sub: - dump_expr_assign_sub(*exp.as_assign_sub); - break; - case node::expr_assign_mul: - dump_expr_assign_mul(*exp.as_assign_mul); - break; - case node::expr_assign_div: - dump_expr_assign_div(*exp.as_assign_div); - break; - case node::expr_assign_mod: - dump_expr_assign_mod(*exp.as_assign_mod); - break; - case node::expr_assign_shift_left: - dump_expr_assign_shift_left(*exp.as_assign_shift_left); - break; - case node::expr_assign_shift_right: - dump_expr_assign_shift_right(*exp.as_assign_shift_right); - break; - case node::expr_assign_bitwise_or: - dump_expr_assign_bitwise_or(*exp.as_assign_bw_or); - break; - case node::expr_assign_bitwise_and: - dump_expr_assign_bitwise_and(*exp.as_assign_bw_and); - break; - case node::expr_assign_bitwise_exor: - dump_expr_assign_bitwise_exor(*exp.as_assign_bw_exor); - break; case node::expr_ternary: - dump_expr_ternary(*exp.as_ternary); + dump_expr_ternary(exp.as()); break; - case node::expr_and: - dump_expr_and(*exp.as_and); - break; - case node::expr_or: - dump_expr_or(*exp.as_or); - break; - case node::expr_super_equal: - dump_expr_super_equal(*exp.as_super_equal); - break; - case node::expr_super_not_equal: - dump_expr_super_not_equal(*exp.as_super_not_equal); - break; - case node::expr_equality: - dump_expr_equality(*exp.as_equality); - break; - case node::expr_inequality: - dump_expr_inequality(*exp.as_inequality); - break; - case node::expr_less_equal: - dump_expr_less_equal(*exp.as_less_equal); - break; - case node::expr_greater_equal: - dump_expr_greater_equal(*exp.as_greater_equal); - break; - case node::expr_less: - dump_expr_less(*exp.as_less); - break; - case node::expr_greater: - dump_expr_greater(*exp.as_greater); - break; - case node::expr_add: - dump_expr_add(*exp.as_add); - break; - case node::expr_sub: - dump_expr_sub(*exp.as_sub); - break; - case node::expr_mul: - dump_expr_mul(*exp.as_mul); - break; - case node::expr_div: - dump_expr_div(*exp.as_div); - break; - case node::expr_mod: - dump_expr_mod(*exp.as_mod); - break; - case node::expr_shift_left: - dump_expr_shift_left(*exp.as_shift_left); - break; - case node::expr_shift_right: - dump_expr_shift_right(*exp.as_shift_right); - break; - case node::expr_bitwise_or: - dump_expr_bitwise_or(*exp.as_bitwise_or); - break; - case node::expr_bitwise_and: - dump_expr_bitwise_and(*exp.as_bitwise_and); - break; - case node::expr_bitwise_exor: - dump_expr_bitwise_exor(*exp.as_bitwise_exor); + case node::expr_binary: + dump_expr_binary(exp.as()); break; case node::expr_complement: - dump_expr_complement(*exp.as_complement); + dump_expr_complement(exp.as()); break; case node::expr_negate: - dump_expr_negate(*exp.as_negate); + dump_expr_negate(exp.as()); break; case node::expr_not: - dump_expr_not(*exp.as_not); + dump_expr_not(exp.as()); break; case node::expr_new: - dump_expr_new(*exp.as_new); + dump_expr_new(exp.as()); break; case node::expr_call: - dump_expr_call(*exp.as_call); + dump_expr_call(exp.as()); break; case node::expr_method: - dump_expr_method(*exp.as_method); - break; - case node::expr_function: - dump_expr_function(*exp.as_function); - break; - case node::expr_pointer: - dump_expr_pointer(*exp.as_pointer); + dump_expr_method(exp.as()); break; case node::expr_parameters: - dump_expr_parameters(*exp.as_parameters); + dump_expr_parameters(exp.as()); break; case node::expr_arguments: - dump_expr_arguments(*exp.as_arguments); + dump_expr_arguments(exp.as()); break; case node::expr_isdefined: - dump_expr_isdefined(*exp.as_isdefined); + dump_expr_isdefined(exp.as()); break; case node::expr_vectorscale: - dump_expr_vectorscale(*exp.as_vectorscale); + dump_expr_vectorscale(exp.as()); break; case node::expr_anglestoup: - dump_expr_anglestoup(*exp.as_anglestoup); + dump_expr_anglestoup(exp.as()); break; case node::expr_anglestoright: - dump_expr_anglestoright(*exp.as_anglestoright); + dump_expr_anglestoright(exp.as()); break; case node::expr_anglestoforward: - dump_expr_anglestoforward(*exp.as_anglestoforward); + dump_expr_anglestoforward(exp.as()); break; case node::expr_angleclamp180: - dump_expr_angleclamp180(*exp.as_angleclamp180); + dump_expr_angleclamp180(exp.as()); break; case node::expr_vectortoangles: - dump_expr_vectortoangles(*exp.as_vectortoangles); + dump_expr_vectortoangles(exp.as()); break; case node::expr_abs: - dump_expr_abs(*exp.as_abs); + dump_expr_abs(exp.as()); break; case node::expr_gettime: - dump_expr_gettime(*exp.as_gettime); + dump_expr_gettime(exp.as()); break; case node::expr_getdvar: - dump_expr_getdvar(*exp.as_getdvar); + dump_expr_getdvar(exp.as()); break; case node::expr_getdvarint: - dump_expr_getdvarint(*exp.as_getdvarint); + dump_expr_getdvarint(exp.as()); break; case node::expr_getdvarfloat: - dump_expr_getdvarfloat(*exp.as_getdvarfloat); + dump_expr_getdvarfloat(exp.as()); break; case node::expr_getdvarvector: - dump_expr_getdvarvector(*exp.as_getdvarvector); + dump_expr_getdvarvector(exp.as()); break; case node::expr_getdvarcolorred: - dump_expr_getdvarcolorred(*exp.as_getdvarcolorred); + dump_expr_getdvarcolorred(exp.as()); break; case node::expr_getdvarcolorgreen: - dump_expr_getdvarcolorgreen(*exp.as_getdvarcolorgreen); + dump_expr_getdvarcolorgreen(exp.as()); break; case node::expr_getdvarcolorblue: - dump_expr_getdvarcolorblue(*exp.as_getdvarcolorblue); + dump_expr_getdvarcolorblue(exp.as()); break; case node::expr_getdvarcoloralpha: - dump_expr_getdvarcoloralpha(*exp.as_getdvarcoloralpha); + dump_expr_getdvarcoloralpha(exp.as()); break; case node::expr_getfirstarraykey: - dump_expr_getfirstarraykey(*exp.as_getfirstarraykey); + dump_expr_getfirstarraykey(exp.as()); break; case node::expr_getnextarraykey: - dump_expr_getnextarraykey(*exp.as_getnextarraykey); + dump_expr_getnextarraykey(exp.as()); break; case node::expr_reference: - dump_expr_reference(*exp.as_reference); + dump_expr_reference(exp.as()); break; case node::expr_array: - dump_expr_array(*exp.as_array); + dump_expr_array(exp.as()); break; case node::expr_field: - dump_expr_field(*exp.as_field); + dump_expr_field(exp.as()); break; case node::expr_size: - dump_expr_size(*exp.as_size); + dump_expr_size(exp.as()); break; case node::expr_paren: - dump_expr_paren(*exp.as_paren); + dump_expr_paren(exp.as()); + break; + case node::expr_ellipsis: + dump_expr_ellipsis(exp.as()); break; case node::expr_empty_array: - dump_expr_empty_array(*exp.as_empty_array); + dump_expr_empty_array(exp.as()); break; case node::expr_undefined: - dump_expr_undefined(*exp.as_undefined); + dump_expr_undefined(exp.as()); break; case node::expr_game: - dump_expr_game(*exp.as_game); + dump_expr_game(exp.as()); break; case node::expr_self: - dump_expr_self(*exp.as_self); + dump_expr_self(exp.as()); break; case node::expr_anim: - dump_expr_anim(*exp.as_anim); + dump_expr_anim(exp.as()); break; case node::expr_level: - dump_expr_level(*exp.as_level); + dump_expr_level(exp.as()); break; case node::expr_world: - dump_expr_world(*exp.as_world); + dump_expr_world(exp.as()); break; case node::expr_classes: - dump_expr_classes(*exp.as_classes); + dump_expr_classes(exp.as()); break; case node::expr_animation: - dump_expr_animation(*exp.as_animation); + dump_expr_animation(exp.as()); break; case node::expr_animtree: - dump_expr_animtree(*exp.as_animtree); + dump_expr_animtree(exp.as()); break; case node::expr_identifier: - dump_expr_identifier(*exp.as_identifier); + dump_expr_identifier(exp.as()); break; case node::expr_path: - dump_expr_path(*exp.as_path); + dump_expr_path(exp.as()); break; case node::expr_istring: - dump_expr_istring(*exp.as_istring); + dump_expr_istring(exp.as()); break; case node::expr_string: - dump_expr_string(*exp.as_string); + dump_expr_string(exp.as()); break; case node::expr_hash: - dump_expr_hash(*exp.as_hash); + dump_expr_hash(exp.as()); break; case node::expr_vector: - dump_expr_vector(*exp.as_vector); + dump_expr_vector(exp.as()); break; case node::expr_float: - dump_expr_float(*exp.as_float); + dump_expr_float(exp.as()); break; case node::expr_integer: - dump_expr_integer(*exp.as_integer); + dump_expr_integer(exp.as()); break; case node::expr_false: - dump_expr_false(*exp.as_false); + dump_expr_false(exp.as()); break; case node::expr_true: - dump_expr_true(*exp.as_true); + dump_expr_true(exp.as()); break; default: break; @@ -1062,11 +1051,11 @@ auto source::dump_expr_increment(expr_increment const& exp) -> void if (exp.prefix) { fmt::format_to(std::back_inserter(buf_), "++"); - dump_expr(exp.lvalue); + dump_expr(*exp.lvalue); } else { - dump_expr(exp.lvalue); + dump_expr(*exp.lvalue); fmt::format_to(std::back_inserter(buf_), "++"); } } @@ -1076,257 +1065,164 @@ auto source::dump_expr_decrement(expr_decrement const& exp) -> void if (exp.prefix) { fmt::format_to(std::back_inserter(buf_), "--"); - dump_expr(exp.lvalue); + dump_expr(*exp.lvalue); } else { - dump_expr(exp.lvalue); + dump_expr(*exp.lvalue); fmt::format_to(std::back_inserter(buf_), "--"); } } -auto source::dump_expr_assign_equal(expr_assign_equal const& exp) -> void +auto source::dump_expr_assign(expr_assign const& exp) -> void { - dump_expr(exp.lvalue); + dump_expr(*exp.lvalue); + + switch (exp.oper) + { + case expr_assign::op::eq: + fmt::format_to(std::back_inserter(buf_), " = "); + break; + case expr_assign::op::add: + fmt::format_to(std::back_inserter(buf_), " += "); + break; + case expr_assign::op::sub: + fmt::format_to(std::back_inserter(buf_), " -= "); + break; + case expr_assign::op::mul: + fmt::format_to(std::back_inserter(buf_), " *= "); + break; + case expr_assign::op::div: + fmt::format_to(std::back_inserter(buf_), " /= "); + break; + case expr_assign::op::mod: + fmt::format_to(std::back_inserter(buf_), " %= "); + break; + case expr_assign::op::shl: + fmt::format_to(std::back_inserter(buf_), " <<= "); + break; + case expr_assign::op::shr: + fmt::format_to(std::back_inserter(buf_), " >>= "); + break; + case expr_assign::op::bwor: + fmt::format_to(std::back_inserter(buf_), " |= "); + break; + case expr_assign::op::bwand: + fmt::format_to(std::back_inserter(buf_), " &= "); + break; + case expr_assign::op::bwexor: + fmt::format_to(std::back_inserter(buf_), " ^= "); + break; + } + + dump_expr(*exp.rvalue); +} + +auto source::dump_expr_const(expr_const const& exp) -> void +{ + fmt::format_to(std::back_inserter(buf_), "const "); + dump_expr_identifier(*exp.lvalue); fmt::format_to(std::back_inserter(buf_), " = "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_assign_add(expr_assign_add const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " += "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_assign_sub(expr_assign_sub const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " -= "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_assign_mul(expr_assign_mul const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " *= "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_assign_div(expr_assign_div const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " /= "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_assign_mod(expr_assign_mod const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " %= "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_assign_shift_left(expr_assign_shift_left const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " <<= "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_assign_shift_right(expr_assign_shift_right const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " >>= "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_assign_bitwise_or(expr_assign_bitwise_or const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " |= "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_assign_bitwise_and(expr_assign_bitwise_and const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " &= "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_assign_bitwise_exor(expr_assign_bitwise_exor const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " ^= "); - dump_expr(exp.rvalue); + dump_expr(*exp.rvalue); + fmt::format_to(std::back_inserter(buf_), ";"); } auto source::dump_expr_ternary(expr_ternary const& exp) -> void { - dump_expr(exp.test); + dump_expr(*exp.test); fmt::format_to(std::back_inserter(buf_), " ? "); - dump_expr(exp.true_expr); + dump_expr(*exp.true_expr); fmt::format_to(std::back_inserter(buf_), " : "); - dump_expr(exp.false_expr); + dump_expr(*exp.false_expr); } -auto source::dump_expr_or(expr_or const& exp) -> void +auto source::dump_expr_binary(expr_binary const& exp) -> void { - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " || "); - dump_expr(exp.rvalue); -} + dump_expr(*exp.lvalue); -auto source::dump_expr_and(expr_and const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " && "); - dump_expr(exp.rvalue); -} + switch (exp.oper) + { + case expr_binary::op::bool_or: + fmt::format_to(std::back_inserter(buf_), " || "); + break; + case expr_binary::op::bool_and: + fmt::format_to(std::back_inserter(buf_), " && "); + break; + case expr_binary::op::seq: + fmt::format_to(std::back_inserter(buf_), " === "); + break; + case expr_binary::op::sne: + fmt::format_to(std::back_inserter(buf_), " !== "); + break; + case expr_binary::op::eq: + fmt::format_to(std::back_inserter(buf_), " == "); + break; + case expr_binary::op::ne: + fmt::format_to(std::back_inserter(buf_), " != "); + break; + case expr_binary::op::le: + fmt::format_to(std::back_inserter(buf_), " <= "); + break; + case expr_binary::op::ge: + fmt::format_to(std::back_inserter(buf_), " >= "); + break; + case expr_binary::op::lt: + fmt::format_to(std::back_inserter(buf_), " < "); + break; + case expr_binary::op::gt: + fmt::format_to(std::back_inserter(buf_), " > "); + break; + case expr_binary::op::add: + fmt::format_to(std::back_inserter(buf_), " + "); + break; + case expr_binary::op::sub: + fmt::format_to(std::back_inserter(buf_), " - "); + break; + case expr_binary::op::mul: + fmt::format_to(std::back_inserter(buf_), " * "); + break; + case expr_binary::op::div: + fmt::format_to(std::back_inserter(buf_), " / "); + break; + case expr_binary::op::mod: + fmt::format_to(std::back_inserter(buf_), " % "); + break; + case expr_binary::op::shl: + fmt::format_to(std::back_inserter(buf_), " << "); + break; + case expr_binary::op::shr: + fmt::format_to(std::back_inserter(buf_), " >> "); + break; + case expr_binary::op::bwor: + fmt::format_to(std::back_inserter(buf_), " | "); + break; + case expr_binary::op::bwand: + fmt::format_to(std::back_inserter(buf_), " & "); + break; + case expr_binary::op::bwexor: + fmt::format_to(std::back_inserter(buf_), " ^ "); + break; + } -auto source::dump_expr_super_equal(expr_super_equal const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " === "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_super_not_equal(expr_super_not_equal const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " !== "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_equality(expr_equality const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " == "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_inequality(expr_inequality const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " != "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_less_equal(expr_less_equal const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " <= "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_greater_equal(expr_greater_equal const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " >= "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_less(expr_less const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " < "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_greater(expr_greater const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " > "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_add(expr_add const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " + "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_sub(expr_sub const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " - "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_mul(expr_mul const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " * "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_div(expr_div const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " / "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_mod(expr_mod const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " % "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_shift_left(expr_shift_left const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " << "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_shift_right(expr_shift_right const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " >> "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_bitwise_or(expr_bitwise_or const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " | "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_bitwise_and(expr_bitwise_and const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " & "); - dump_expr(exp.rvalue); -} - -auto source::dump_expr_bitwise_exor(expr_bitwise_exor const& exp) -> void -{ - dump_expr(exp.lvalue); - fmt::format_to(std::back_inserter(buf_), " ^ "); - dump_expr(exp.rvalue); + dump_expr(*exp.rvalue); } auto source::dump_expr_not(expr_not const& exp) -> void { fmt::format_to(std::back_inserter(buf_), "!"); - dump_expr(exp.rvalue); + dump_expr(*exp.rvalue); } auto source::dump_expr_negate(expr_negate const& exp) -> void { fmt::format_to(std::back_inserter(buf_), "-"); - dump_expr(exp.rvalue); + dump_expr(*exp.rvalue); } auto source::dump_expr_complement(expr_complement const& exp) -> void { fmt::format_to(std::back_inserter(buf_), "~"); - dump_expr(exp.rvalue); + dump_expr(*exp.rvalue); } auto source::dump_expr_new(expr_new const& exp) -> void @@ -1338,28 +1234,28 @@ auto source::dump_expr_new(expr_new const& exp) -> void auto source::dump_expr_call(expr_call const& exp) -> void { - dump_call(exp.value); + dump_call(*exp.value); } auto source::dump_expr_method(expr_method const& exp) -> void { - dump_expr(exp.obj); + dump_expr(*exp.obj); fmt::format_to(std::back_inserter(buf_), " "); - dump_call(exp.value); + dump_call(*exp.value); } auto source::dump_call(call const& exp) -> void { - switch (exp.as_node->kind()) + switch (exp.kind()) { case node::expr_function: - dump_expr_function(*exp.as_function); + dump_expr_function(exp.as()); break; case node::expr_pointer: - dump_expr_pointer(*exp.as_pointer); + dump_expr_pointer(exp.as()); break; case node::expr_member: - dump_expr_member(*exp.as_member); + dump_expr_member(exp.as()); break; default: break; @@ -1389,7 +1285,7 @@ auto source::dump_expr_pointer(expr_pointer const& exp) -> void fmt::format_to(std::back_inserter(buf_), "thread "); fmt::format_to(std::back_inserter(buf_), "[[ "); - dump_expr(exp.func); + dump_expr(*exp.func); fmt::format_to(std::back_inserter(buf_), " ]]("); dump_expr_arguments(*exp.args); fmt::format_to(std::back_inserter(buf_), ")"); @@ -1401,7 +1297,7 @@ auto source::dump_expr_member(expr_member const& exp) -> void fmt::format_to(std::back_inserter(buf_), "thread "); fmt::format_to(std::back_inserter(buf_), "[[ "); - dump_expr(exp.obj); + dump_expr(*exp.obj); fmt::format_to(std::back_inserter(buf_), " ]]->"); dump_expr_identifier(*exp.name); fmt::format_to(std::back_inserter(buf_), "("); @@ -1414,7 +1310,7 @@ auto source::dump_expr_parameters(expr_parameters const& exp) -> void for (auto const& entry : exp.list) { fmt::format_to(std::back_inserter(buf_), " "); - dump_expr(entry); + dump_expr(*entry); if (&entry != &exp.list.back()) fmt::format_to(std::back_inserter(buf_), ","); @@ -1428,7 +1324,7 @@ auto source::dump_expr_arguments(expr_arguments const& exp) -> void for (auto const& entry : exp.list) { fmt::format_to(std::back_inserter(buf_), " "); - dump_expr(entry); + dump_expr(*entry); if (&entry != &exp.list.back()) fmt::format_to(std::back_inserter(buf_), ","); @@ -1440,58 +1336,58 @@ auto source::dump_expr_arguments(expr_arguments const& exp) -> void auto source::dump_expr_isdefined(expr_isdefined const& exp) -> void { fmt::format_to(std::back_inserter(buf_), "isdefined( "); - dump_expr(exp.value); + dump_expr(*exp.value); fmt::format_to(std::back_inserter(buf_), " )"); } auto source::dump_expr_vectorscale(expr_vectorscale const& exp) -> void { fmt::format_to(std::back_inserter(buf_), "vectorscale( "); - dump_expr(exp.arg1); + dump_expr(*exp.arg1); fmt::format_to(std::back_inserter(buf_), ", "); - dump_expr(exp.arg2); + dump_expr(*exp.arg2); fmt::format_to(std::back_inserter(buf_), " )"); } auto source::dump_expr_anglestoup(expr_anglestoup const& exp) -> void { fmt::format_to(std::back_inserter(buf_), "anglestoup( "); - dump_expr(exp.arg); + dump_expr(*exp.arg); fmt::format_to(std::back_inserter(buf_), " )"); } auto source::dump_expr_anglestoright(expr_anglestoright const& exp) -> void { fmt::format_to(std::back_inserter(buf_), "anglestoright( "); - dump_expr(exp.arg); + dump_expr(*exp.arg); fmt::format_to(std::back_inserter(buf_), " )"); } auto source::dump_expr_anglestoforward(expr_anglestoforward const& exp) -> void { fmt::format_to(std::back_inserter(buf_), "anglestoforward( "); - dump_expr(exp.arg); + dump_expr(*exp.arg); fmt::format_to(std::back_inserter(buf_), " )"); } auto source::dump_expr_angleclamp180(expr_angleclamp180 const& exp) -> void { fmt::format_to(std::back_inserter(buf_), "angleclamp180( "); - dump_expr(exp.arg); + dump_expr(*exp.arg); fmt::format_to(std::back_inserter(buf_), " )"); } auto source::dump_expr_vectortoangles(expr_vectortoangles const& exp) -> void { fmt::format_to(std::back_inserter(buf_), "vectorangles( "); - dump_expr(exp.arg); + dump_expr(*exp.arg); fmt::format_to(std::back_inserter(buf_), " )"); } auto source::dump_expr_abs(expr_abs const& exp) -> void { fmt::format_to(std::back_inserter(buf_), "abs( "); - dump_expr(exp.arg); + dump_expr(*exp.arg); fmt::format_to(std::back_inserter(buf_), " )"); } @@ -1503,110 +1399,129 @@ auto source::dump_expr_gettime(expr_gettime const&) -> void auto source::dump_expr_getdvar(expr_getdvar const& exp) -> void { fmt::format_to(std::back_inserter(buf_), "getdvar( "); - dump_expr(exp.arg); + dump_expr(*exp.arg); fmt::format_to(std::back_inserter(buf_), " )"); } auto source::dump_expr_getdvarint(expr_getdvarint const& exp) -> void { fmt::format_to(std::back_inserter(buf_), "getdvarint( "); - dump_expr(exp.arg); + dump_expr(*exp.arg); fmt::format_to(std::back_inserter(buf_), " )"); } auto source::dump_expr_getdvarfloat(expr_getdvarfloat const& exp) -> void { fmt::format_to(std::back_inserter(buf_), "getdvarflaot( "); - dump_expr(exp.arg); + dump_expr(*exp.arg); fmt::format_to(std::back_inserter(buf_), " )"); } auto source::dump_expr_getdvarvector(expr_getdvarvector const& exp) -> void { fmt::format_to(std::back_inserter(buf_), "getdvarvector( "); - dump_expr(exp.arg); + dump_expr(*exp.arg); fmt::format_to(std::back_inserter(buf_), " )"); } auto source::dump_expr_getdvarcolorred(expr_getdvarcolorred const& exp) -> void { fmt::format_to(std::back_inserter(buf_), "getdvarcolorred( "); - dump_expr(exp.arg); + dump_expr(*exp.arg); fmt::format_to(std::back_inserter(buf_), " )"); } auto source::dump_expr_getdvarcolorgreen(expr_getdvarcolorgreen const& exp) -> void { fmt::format_to(std::back_inserter(buf_), "getdvarcolorgreen( "); - dump_expr(exp.arg); + dump_expr(*exp.arg); fmt::format_to(std::back_inserter(buf_), " )"); } auto source::dump_expr_getdvarcolorblue(expr_getdvarcolorblue const& exp) -> void { fmt::format_to(std::back_inserter(buf_), "getdvarcolorblue( "); - dump_expr(exp.arg); + dump_expr(*exp.arg); fmt::format_to(std::back_inserter(buf_), " )"); } auto source::dump_expr_getdvarcoloralpha(expr_getdvarcoloralpha const& exp) -> void { fmt::format_to(std::back_inserter(buf_), "getdvarcoloralpha( "); - dump_expr(exp.arg); + dump_expr(*exp.arg); fmt::format_to(std::back_inserter(buf_), " )"); } auto source::dump_expr_getfirstarraykey(expr_getfirstarraykey const& exp) -> void { fmt::format_to(std::back_inserter(buf_), "getfirstarraykey( "); - dump_expr(exp.arg); + dump_expr(*exp.arg); fmt::format_to(std::back_inserter(buf_), " )"); } auto source::dump_expr_getnextarraykey(expr_getnextarraykey const& exp) -> void { fmt::format_to(std::back_inserter(buf_), "getnextarraykey( "); - dump_expr(exp.arg1); + dump_expr(*exp.arg1); fmt::format_to(std::back_inserter(buf_), ", "); - dump_expr(exp.arg2); + dump_expr(*exp.arg2); fmt::format_to(std::back_inserter(buf_), " )"); } auto source::dump_expr_reference(expr_reference const& exp) -> void { - dump_expr_path(*exp.path); - fmt::format_to(std::back_inserter(buf_), "::"); + if (ctx_->props() & props::refvarg) + { + fmt::format_to(std::back_inserter(buf_), "&"); + + if (!exp.path->value.empty()) + { + dump_expr_path(*exp.path); + fmt::format_to(std::back_inserter(buf_), "::"); + } + } + else + { + dump_expr_path(*exp.path); + fmt::format_to(std::back_inserter(buf_), "::"); + } + dump_expr_identifier(*exp.name); } auto source::dump_expr_array(expr_array const& exp) -> void { - dump_expr(exp.obj); + dump_expr(*exp.obj); fmt::format_to(std::back_inserter(buf_), "["); - dump_expr(exp.key); + dump_expr(*exp.key); fmt::format_to(std::back_inserter(buf_), "]"); } auto source::dump_expr_field(expr_field const& exp) -> void { - dump_expr(exp.obj); + dump_expr(*exp.obj); fmt::format_to(std::back_inserter(buf_), "."); dump_expr_identifier(*exp.field); } auto source::dump_expr_size(expr_size const& exp) -> void { - dump_expr(exp.obj); + dump_expr(*exp.obj); fmt::format_to(std::back_inserter(buf_), ".size"); } auto source::dump_expr_paren(expr_paren const& exp) -> void { fmt::format_to(std::back_inserter(buf_), "( "); - dump_expr(exp.value); + dump_expr(*exp.value); fmt::format_to(std::back_inserter(buf_), " )"); } +auto source::dump_expr_ellipsis(expr_ellipsis const&) -> void +{ + fmt::format_to(std::back_inserter(buf_), "..."); +} + auto source::dump_expr_empty_array(expr_empty_array const&) -> void { fmt::format_to(std::back_inserter(buf_), "[]"); @@ -1685,11 +1600,11 @@ auto source::dump_expr_hash(expr_hash const& exp) -> void auto source::dump_expr_vector(expr_vector const& exp) -> void { fmt::format_to(std::back_inserter(buf_), "( "); - dump_expr(exp.x); + dump_expr(*exp.x); fmt::format_to(std::back_inserter(buf_), ", "); - dump_expr(exp.y); + dump_expr(*exp.y); fmt::format_to(std::back_inserter(buf_), ", "); - dump_expr(exp.z); + dump_expr(*exp.z); fmt::format_to(std::back_inserter(buf_), " )"); } @@ -1713,59 +1628,4 @@ auto source::dump_expr_true(expr_true const&) -> void fmt::format_to(std::back_inserter(buf_), "true"); } -auto source::dump_asm_loc(asm_loc const& exp) -> void -{ - fmt::format_to(std::back_inserter(buf_), "__asm_loc( {} )", exp.value); -} - -auto source::dump_asm_jmp(asm_jmp const& exp) -> void -{ - fmt::format_to(std::back_inserter(buf_), "__asm_jmp( {} )", exp.value); -} - -auto source::dump_asm_jmp_back(asm_jmp_back const& exp) -> void -{ - fmt::format_to(std::back_inserter(buf_), "__asm_jmp_back( {} )", exp.value); -} - -auto source::dump_asm_jmp_cond(asm_jmp_cond const& exp) -> void -{ - fmt::format_to(std::back_inserter(buf_), "__asm_jmp_cond( {} )", exp.value); -} - -auto source::dump_asm_jmp_true(asm_jmp_true const& exp) -> void -{ - fmt::format_to(std::back_inserter(buf_), "__asm_jmp_expr_true( {} )", exp.value); -} - -auto source::dump_asm_jmp_false(asm_jmp_false const& exp) -> void -{ - fmt::format_to(std::back_inserter(buf_), "__asm_jmp_expr_false( {} )", exp.value); -} - -auto source::dump_asm_switch(asm_switch const& exp) -> void -{ - fmt::format_to(std::back_inserter(buf_), "__asm_switch( {} )", exp.value); -} - -auto source::dump_asm_endswitch(asm_endswitch const&) -> void -{ - fmt::format_to(std::back_inserter(buf_), "__asm_endswitch()"); -} - -auto source::dump_asm_prescriptcall(asm_prescriptcall const&) -> void -{ - fmt::format_to(std::back_inserter(buf_), "__asm_prescriptcall()"); -} - -auto source::dump_asm_voidcodepos(asm_voidcodepos const&) -> void -{ - fmt::format_to(std::back_inserter(buf_), "__asm_voidcodepos()"); -} - -auto source::dump_asm_dev(asm_dev const& exp) -> void -{ - fmt::format_to(std::back_inserter(buf_), "__asm_dev( {} )", exp.value); -} - } // namespace xsk::arc diff --git a/src/gsc/compiler.cpp b/src/gsc/compiler.cpp index 23fb0ae0..4b37b6df 100644 --- a/src/gsc/compiler.cpp +++ b/src/gsc/compiler.cpp @@ -28,7 +28,7 @@ auto compiler::compile(std::string const& file, std::vector& data) -> assemb auto compiler::emit_program(program const& prog) -> void { - assembly_ = make_assembly(); + assembly_ = assembly::make(); localfuncs_.clear(); constants_.clear(); developer_thread_ = false; @@ -128,7 +128,7 @@ auto compiler::emit_decl_function(decl_function const& func) -> void break_blks_.clear(); continue_blks_.clear(); - function_ = make_function(); + function_ = function::make(); function_->index = index_; function_->name = func.name->value; function_->id = ctx_->token_id(function_->name); @@ -2191,7 +2191,7 @@ auto compiler::emit_remove_local_vars(scope& scp) -> void auto compiler::emit_opcode(opcode op) -> void { - function_->instructions.push_back(make_instruction()); + function_->instructions.push_back(instruction::make()); auto& inst = function_->instructions.back(); inst->opcode = op; @@ -2203,7 +2203,7 @@ auto compiler::emit_opcode(opcode op) -> void auto compiler::emit_opcode(opcode op, std::string const& data) -> void { - function_->instructions.push_back(make_instruction()); + function_->instructions.push_back(instruction::make()); auto& inst = function_->instructions.back(); inst->opcode = op; @@ -2216,7 +2216,7 @@ auto compiler::emit_opcode(opcode op, std::string const& data) -> void auto compiler::emit_opcode(opcode op, std::vector const& data) -> void { - function_->instructions.push_back(make_instruction()); + function_->instructions.push_back(instruction::make()); auto& inst = function_->instructions.back(); inst->opcode = op; diff --git a/src/gsc/disassembler.cpp b/src/gsc/disassembler.cpp index 86fb3479..aa313a71 100644 --- a/src/gsc/disassembler.cpp +++ b/src/gsc/disassembler.cpp @@ -3,7 +3,6 @@ // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. - #include "xsk/stdinc.hpp" #include "xsk/utils/string.hpp" #include "xsk/gsc/disassembler.hpp" @@ -30,13 +29,13 @@ auto disassembler::disassemble(u8 const* script, usize script_size, u8 const* st { stack_ = utils::reader{ stack, static_cast(stack_size), ctx_->endian() == endian::big }; script_ = utils::reader{ script, static_cast(script_size), ctx_->endian() == endian::big }; - assembly_ = make_assembly(); + assembly_ = assembly::make(); script_.seek(1); while (script_.is_avail() && stack_.is_avail()) { - func_ = make_function(); + func_ = function::make(); func_->index = script_.pos(); func_->size = stack_.read(); func_->id = (ctx_->props() & props::hash) ? 0 : (ctx_->props() & props::tok4) ? stack_.read() : stack_.read(); @@ -58,7 +57,7 @@ auto disassembler::dissasemble_function(function& func) -> void while (size > 0) { - auto inst = make_instruction(); + auto inst = instruction::make(); inst->index = script_.pos(); inst->opcode = ctx_->opcode_enum(script_.read()); inst->size = ctx_->opcode_size(inst->opcode); diff --git a/src/gsc/lexer.cpp b/src/gsc/lexer.cpp index c529c3c7..fd48e559 100644 --- a/src/gsc/lexer.cpp +++ b/src/gsc/lexer.cpp @@ -3,7 +3,6 @@ // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. - #include "xsk/stdinc.hpp" #include "xsk/utils/string.hpp" #include "xsk/gsc/lexer.hpp" @@ -191,7 +190,7 @@ auto lexer::lex() -> token advance(); if (curr != '.') - return token{ token::DOUBLECOLON, spacing_, loc_ }; + return token{ token::DOUBLEDOT, spacing_, loc_ }; advance(); return token{ token::ELLIPSIS, spacing_, loc_ }; diff --git a/src/gsc/preprocessor.cpp b/src/gsc/preprocessor.cpp index a47953aa..4a0128cb 100644 --- a/src/gsc/preprocessor.cpp +++ b/src/gsc/preprocessor.cpp @@ -3,11 +3,9 @@ // Use of this source code is governed by a GNU GPLv3 license // that can be found in the LICENSE file. - #include "xsk/stdinc.hpp" #include "xsk/gsc/preprocessor.hpp" #include "xsk/gsc/context.hpp" -#include "xsk/gsc/parser.hpp" namespace xsk::gsc { diff --git a/src/gsc/source.cpp b/src/gsc/source.cpp index 3da76d47..aea4314c 100644 --- a/src/gsc/source.cpp +++ b/src/gsc/source.cpp @@ -34,7 +34,7 @@ auto source::parse_assembly(u8 const* data, usize size) -> assembly::ptr std::memcpy(buffer.data(), data, buffer.size()); auto lines = utils::string::clean_buffer_lines(buffer); - auto assembly = make_assembly(); + auto assembly = assembly::make(); auto func = function::ptr{ nullptr }; u32 index = 1; u16 switchnum = 0; @@ -47,7 +47,7 @@ auto source::parse_assembly(u8 const* data, usize size) -> assembly::ptr } else if (line.substr(0, 4) == "sub:") { - func = make_function(); + func = function::make(); func->index = index; func->name = line.substr(4); func->id = ctx_->token_id(func->name); @@ -84,7 +84,7 @@ auto source::parse_assembly(u8 const* data, usize size) -> assembly::ptr } else { - auto inst = make_instruction(); + auto inst = instruction::make(); inst->index = index; inst->opcode = ctx_->opcode_enum(opdata[0]); inst->size = ctx_->opcode_size(inst->opcode); @@ -158,7 +158,7 @@ auto source::dump(assembly const& data) -> std::vector buf_.reserve(0x10000); fmt::format_to(std::back_inserter(buf_), "// {} GSC ASSEMBLY\n", ctx_->engine_name()); - fmt::format_to(std::back_inserter(buf_), "// Dumped by https://github.com/xensik/gsc-tool\n"); + fmt::format_to(std::back_inserter(buf_), "// Generated by https://github.com/xensik/gsc-tool\n"); dump_assembly(data); @@ -171,7 +171,7 @@ auto source::dump(program const& data) -> std::vector buf_.reserve(0x10000); fmt::format_to(std::back_inserter(buf_), "// {} GSC SOURCE\n", ctx_->engine_name()); - fmt::format_to(std::back_inserter(buf_), "// Dumped by https://github.com/xensik/gsc-tool\n"); + fmt::format_to(std::back_inserter(buf_), "// Generated by https://github.com/xensik/gsc-tool\n"); dump_program(data); diff --git a/src/t6/assembler.cpp b/src/t6/assembler.cpp deleted file mode 100644 index 3de769fc..00000000 --- a/src/t6/assembler.cpp +++ /dev/null @@ -1,883 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#include "xsk/stdinc.hpp" -#include "xsk/t6/t6.hpp" - -namespace xsk::arc::t6 -{ - -auto assembler::output() -> std::vector -{ - std::vector output; - - if (script_ == nullptr) return output; - - output.resize(script_->pos()); - std::memcpy(output.data(), script_->data(), output.size()); - - return output; -} - -void assembler::assemble(const std::string&, std::vector&) -{ - throw error("assemble from source not implemented!"); -} - -void assembler::assemble(const std::string& file, assembly::ptr& data) -{ - script_ = std::make_unique(); - filename_ = file; - assembly_ = std::move(data); - stringlist_.clear(); - exports_.clear(); - imports_.clear(); - animtrees_.clear(); - stringtables_.clear(); - std::memset(&header_, 0, sizeof(header_)); - - // skip header - script_->pos(64); - - // assemble strings - process_string(filename_); - - for (const auto& func : assembly_->functions) - { - process_function(func); - } - - for (const auto& entry : assembly_->includes) - { - process_string(entry); - } - - // assemble includes - header_.include_offset = script_->pos(); - header_.include_count = static_cast(assembly_->includes.size()); - - for (const auto& entry : assembly_->includes) - { - script_->write(string_offset(entry)); - } - - // assemble functions - header_.cseg_offset = script_->pos(); - - for (const auto& func : assembly_->functions) - { - script_->align(4); - script_->write(0); - assemble_function(func); - } - - header_.cseg_size = script_->pos() - header_.cseg_offset; - - header_.source_crc = 0; - - // assemble exports - header_.exports_offset = script_->pos(); - header_.exports_count = static_cast(exports_.size()); - - for (const auto& entry : exports_) - { - script_->write(entry.checksum); - script_->write(entry.offset); - script_->write(string_offset(entry.name)); - script_->write(entry.params); - script_->write(entry.flags); - } - - // assemble imports - header_.imports_offset = script_->pos(); - header_.imports_count = static_cast(imports_.size()); - - for (const auto& entry : imports_) - { - script_->write(string_offset(entry.name)); - script_->write(string_offset(entry.space)); - script_->write(static_cast(entry.refs.size())); - script_->write(entry.params); - script_->write(entry.flags); - - for (const auto& ref : entry.refs) - { - script_->write(ref); - } - } - - // assemble animtrees - header_.animtree_offset = script_->pos(); - header_.animtree_count = static_cast(animtrees_.size()); - - for (const auto& entry : animtrees_) - { - script_->write(string_offset(entry.name)); - script_->write(static_cast(entry.refs.size())); - script_->write(static_cast(entry.anims.size())); - script_->seek(2); - - for (const auto& ref : entry.refs) - { - script_->write(ref); - } - - for (const auto& anim : entry.anims) - { - script_->write(string_offset(anim.name)); - script_->write(anim.ref); - } - } - - // assemble stringtable - header_.stringtablefixup_offset = script_->pos(); - header_.stringtablefixup_count = static_cast(stringtables_.size()); - - for (const auto& entry : stringtables_) - { - script_->write(string_offset(entry.name)); - script_->write(static_cast(entry.refs.size())); - script_->write(entry.type); - - for (const auto& ref : entry.refs) - { - script_->write(ref); - } - } - - // assemble fixup - header_.fixup_offset = script_->pos(); - header_.fixup_count = 0; - - // assemble profile - header_.profile_offset = script_->pos(); - header_.profile_count = 0; - - header_.flags = 0; - header_.name = string_offset(filename_); - - auto endpos = script_->pos(); - - // assemble header - script_->pos(0); - script_->write(magic); - script_->write(header_.source_crc); - script_->write(header_.include_offset); - script_->write(header_.animtree_offset); - script_->write(header_.cseg_offset); - script_->write(header_.stringtablefixup_offset); - script_->write(header_.exports_offset); - script_->write(header_.imports_offset); - script_->write(header_.fixup_offset); - script_->write(header_.profile_offset); - script_->write(header_.cseg_size); - script_->write(header_.name); - script_->write(header_.stringtablefixup_count); - script_->write(header_.exports_count); - script_->write(header_.imports_count); - script_->write(header_.fixup_count); - script_->write(header_.profile_count); - script_->write(header_.include_count); - script_->write(header_.animtree_count); - script_->write(header_.flags); - script_->pos(endpos); -} - -void assembler::assemble_function(const function::ptr& func) -{ - func->index = script_->pos(); - func->size = 0; - labels_.clear(); - - for (const auto& inst : func->instructions) - { - auto old_idx = inst->index; - inst->index = func->index + func->size; - - align_instruction(inst); - - func->size += inst->size; - - const auto itr = func->labels.find(old_idx); - - if (itr != func->labels.end()) - { - labels_.insert({ inst->index, itr->second }); - } - } - - script_->pos(func->index); - - for (const auto& inst : func->instructions) - { - assemble_instruction(inst); - } - - export_ref entry; - entry.checksum = 0; - entry.offset = func->index; - entry.name = func->name; - entry.params = func->params; - entry.flags = func->flags; - exports_.push_back(entry); -} - -void assembler::assemble_instruction(const instruction::ptr& inst) -{ - script_->write(static_cast(inst->opcode)); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_End: - case opcode::OP_Return: - case opcode::OP_GetUndefined: - case opcode::OP_GetZero: - case opcode::OP_GetLevelObject: - case opcode::OP_GetAnimObject: - case opcode::OP_GetSelf: - case opcode::OP_GetLevel: - case opcode::OP_GetGame: - case opcode::OP_GetAnim: - case opcode::OP_GetGameRef: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_ClearArray: - case opcode::OP_EmptyArray: - case opcode::OP_GetSelfObject: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_ClearParams: - case opcode::OP_CheckClearParams: - case opcode::OP_SetVariableField: - case opcode::OP_Wait: - case opcode::OP_WaitTillFrameEnd: - case opcode::OP_PreScriptCall: - case opcode::OP_DecTop: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - case opcode::OP_BoolNot: - case opcode::OP_BoolComplement: - case opcode::OP_Inc: - case opcode::OP_Dec: - case opcode::OP_Bit_Or: - case opcode::OP_Bit_Xor: - case opcode::OP_Bit_And: - case opcode::OP_Equal: - case opcode::OP_NotEqual: - case opcode::OP_LessThan: - case opcode::OP_GreaterThan: - case opcode::OP_LessThanOrEqualTo: - case opcode::OP_GreaterThanOrEqualTo: - case opcode::OP_ShiftLeft: - case opcode::OP_ShiftRight: - case opcode::OP_Plus: - case opcode::OP_Minus: - case opcode::OP_Multiply: - case opcode::OP_Divide: - case opcode::OP_Modulus: - case opcode::OP_SizeOf: - case opcode::OP_WaitTill: - case opcode::OP_Notify: - case opcode::OP_EndOn: - case opcode::OP_VoidCodePos: - case opcode::OP_Vector: - case opcode::OP_RealWait: - case opcode::OP_IsDefined: - case opcode::OP_VectorScale: - case opcode::OP_AnglesToUp: - case opcode::OP_AnglesToRight: - case opcode::OP_AnglesToForward: - case opcode::OP_AngleClamp180: - case opcode::OP_VectorToAngles: - case opcode::OP_Abs: - case opcode::OP_GetTime: - case opcode::OP_GetDvar: - case opcode::OP_GetDvarInt: - case opcode::OP_GetDvarFloat: - case opcode::OP_GetDvarVector: - case opcode::OP_GetDvarColorRed: - case opcode::OP_GetDvarColorGreen: - case opcode::OP_GetDvarColorBlue: - case opcode::OP_GetDvarColorAlpha: - case opcode::OP_FirstArrayKey: - case opcode::OP_NextArrayKey: - case opcode::OP_ProfileStart: - case opcode::OP_ProfileStop: - case opcode::OP_SafeDecTop: - case opcode::OP_Nop: - case opcode::OP_Abort: - case opcode::OP_Object: - case opcode::OP_ThreadObject: - case opcode::OP_EvalLocalVariable: - case opcode::OP_EvalLocalVariableRef: - break; - case opcode::OP_GetByte: - case opcode::OP_GetNegByte: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetUnsignedShort: - case opcode::OP_GetNegUnsignedShort: - script_->align(2); - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetInteger: - script_->align(4); - script_->write((inst->data.size() == 2) ? -1 : std::stoi(inst->data[0])); - break; - case opcode::OP_GetFloat: - script_->align(4); - script_->write(std::stof(inst->data[0])); - break; - case opcode::OP_GetVector: - script_->align(4); - script_->write(std::stof(inst->data[0])); - script_->write(std::stof(inst->data[1])); - script_->write(std::stof(inst->data[2])); - break; - case opcode::OP_GetString: - case opcode::OP_GetIString: - script_->align(2); - script_->write(0); - break; - case opcode::OP_GetAnimation: - script_->align(4); - script_->write(0); - break; - case opcode::OP_WaitTillMatch: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_VectorConstant: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetHash: - script_->align(4); - script_->write(static_cast(std::stoul(inst->data[0], 0, 16))); - break; - case opcode::OP_SafeCreateLocalVariables: - assemble_localvars(inst); - break; - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_EvalLocalVariableRefCached: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_ClearFieldVariable: - script_->align(2); - script_->write(0); - break; - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - script_->write(static_cast(std::stoi(inst->data[0]))); - break; - case opcode::OP_GetFunction: - script_->align(4); - script_->write(0); - break; - case opcode::OP_CallBuiltin: - case opcode::OP_CallBuiltinMethod: - case opcode::OP_ScriptFunctionCall: - case opcode::OP_ScriptMethodCall: - case opcode::OP_ScriptThreadCall: - case opcode::OP_ScriptMethodThreadCall: - script_->write(0); - script_->align(4); - script_->write(0); - break; - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_Jump: - case opcode::OP_JumpBack: - case opcode::OP_DevblockBegin: - assemble_jump(inst); - break; - case opcode::OP_Switch: - assemble_switch(inst); - break; - case opcode::OP_EndSwitch: - assemble_end_switch(inst); - break; - default: - throw asm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void assembler::assemble_localvars(const instruction::ptr& inst) -{ - script_->write(static_cast(inst->data.size())); - - for (auto i = 0u; i < inst->data.size(); i++) - { - script_->align(2); - script_->write(0); - } -} - -void assembler::assemble_jump(const instruction::ptr& inst) -{ - const auto addr = static_cast(resolve_label(inst->data[0]) - inst->index - inst->size); - - script_->align(2); - script_->write(addr); -} - -void assembler::assemble_switch(const instruction::ptr& inst) -{ - const std::int32_t addr = ((resolve_label(inst->data[0]) + 4) & 0xFFFFFFFC) - inst->index - inst->size; - - script_->align(4); - script_->write(addr); -} - -void assembler::assemble_end_switch(const instruction::ptr& inst) -{ - const auto count = std::stoul(inst->data[0]); - const auto numerical = inst->data.back() == "i"; - - script_->align(4); - script_->write(count); - - for (auto i = 0u; i < count; i++) - { - if (inst->data[1 + (3 * i)] == "case") - { - if (numerical /*&& utils::string::is_number(inst->data[1 + (3 * i) + 1])*/) - { - script_->write((std::stoi(inst->data[1 + (3 * i) + 1]) & 0xFFFFFF) + 0x800000); - } - else - { - script_->write(i + 1); - } - - const std::int32_t addr = resolve_label(inst->data[1 + (3 * i) + 2]) - script_->pos() - 4; - - script_->write(addr); - } - else if (inst->data[1 + (3 * i)] == "default") - { - script_->write(0); - - const std::int32_t addr = resolve_label(inst->data[1 + (3 * i) + 1]) - script_->pos() - 4; - - script_->write(addr); - } - else - { - throw asm_error("invalid switch case '" + inst->data[1 + (3 * i)] + "'!"); - } - } -} - -void assembler::align_instruction(const instruction::ptr& inst) -{ - inst->size = opcode_size(inst->opcode); - script_->seek(1); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_End: - case opcode::OP_Return: - case opcode::OP_GetUndefined: - case opcode::OP_GetZero: - case opcode::OP_GetLevelObject: - case opcode::OP_GetAnimObject: - case opcode::OP_GetSelf: - case opcode::OP_GetLevel: - case opcode::OP_GetGame: - case opcode::OP_GetAnim: - case opcode::OP_GetGameRef: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_ClearArray: - case opcode::OP_EmptyArray: - case opcode::OP_GetSelfObject: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_ClearParams: - case opcode::OP_CheckClearParams: - case opcode::OP_SetVariableField: - case opcode::OP_Wait: - case opcode::OP_WaitTillFrameEnd: - case opcode::OP_PreScriptCall: - case opcode::OP_DecTop: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - case opcode::OP_BoolNot: - case opcode::OP_BoolComplement: - case opcode::OP_Inc: - case opcode::OP_Dec: - case opcode::OP_Bit_Or: - case opcode::OP_Bit_Xor: - case opcode::OP_Bit_And: - case opcode::OP_Equal: - case opcode::OP_NotEqual: - case opcode::OP_LessThan: - case opcode::OP_GreaterThan: - case opcode::OP_LessThanOrEqualTo: - case opcode::OP_GreaterThanOrEqualTo: - case opcode::OP_ShiftLeft: - case opcode::OP_ShiftRight: - case opcode::OP_Plus: - case opcode::OP_Minus: - case opcode::OP_Multiply: - case opcode::OP_Divide: - case opcode::OP_Modulus: - case opcode::OP_SizeOf: - case opcode::OP_WaitTill: - case opcode::OP_Notify: - case opcode::OP_EndOn: - case opcode::OP_VoidCodePos: - case opcode::OP_Vector: - case opcode::OP_RealWait: - case opcode::OP_IsDefined: - case opcode::OP_VectorScale: - case opcode::OP_AnglesToUp: - case opcode::OP_AnglesToRight: - case opcode::OP_AnglesToForward: - case opcode::OP_AngleClamp180: - case opcode::OP_VectorToAngles: - case opcode::OP_Abs: - case opcode::OP_GetTime: - case opcode::OP_GetDvar: - case opcode::OP_GetDvarInt: - case opcode::OP_GetDvarFloat: - case opcode::OP_GetDvarVector: - case opcode::OP_GetDvarColorRed: - case opcode::OP_GetDvarColorGreen: - case opcode::OP_GetDvarColorBlue: - case opcode::OP_GetDvarColorAlpha: - case opcode::OP_FirstArrayKey: - case opcode::OP_NextArrayKey: - case opcode::OP_ProfileStart: - case opcode::OP_ProfileStop: - case opcode::OP_SafeDecTop: - case opcode::OP_Nop: - case opcode::OP_Abort: - case opcode::OP_Object: - case opcode::OP_ThreadObject: - case opcode::OP_EvalLocalVariable: - case opcode::OP_EvalLocalVariableRef: - break; - case opcode::OP_GetByte: - case opcode::OP_GetNegByte: - script_->seek(1); - break; - case opcode::OP_GetUnsignedShort: - case opcode::OP_GetNegUnsignedShort: - inst->size += script_->align(2); - script_->seek(2); - break; - case opcode::OP_GetInteger: - inst->size += script_->align(4); - if (inst->data.size() == 2) - add_anim_reference(inst->data, script_->pos()); - script_->seek(4); - break; - case opcode::OP_GetFloat: - inst->size += script_->align(4); - script_->seek(4); - break; - case opcode::OP_GetVector: - inst->size += script_->align(4); - script_->seek(12); - break; - case opcode::OP_GetString: - case opcode::OP_GetIString: - inst->size += script_->align(2); - add_string_reference(inst->data[0], string_type::literal, script_->pos()); - script_->seek(2); - break; - case opcode::OP_GetAnimation: - inst->size += script_->align(4); - add_anim_reference(inst->data, script_->pos()); - script_->seek(4); - break; - case opcode::OP_WaitTillMatch: - script_->seek(1); - break; - case opcode::OP_VectorConstant: - script_->seek(1); - break; - case opcode::OP_GetHash: - inst->size += script_->align(4); - script_->seek(4); - break; - case opcode::OP_SafeCreateLocalVariables: - { - script_->seek(1); - - for (auto i = 0u; i < inst->data.size(); i++) - { - inst->size += script_->align(2) + 2; - add_string_reference(inst->data[i], string_type::canonical, script_->pos()); - script_->seek(2); - } - - break; - } - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_EvalLocalVariableRefCached: - script_->seek(1); - break; - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_ClearFieldVariable: - inst->size += script_->align(2); - add_string_reference(inst->data[0], string_type::canonical, script_->pos()); - script_->seek(2); - break; - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - script_->seek(1); - break; - case opcode::OP_GetFunction: - inst->size += script_->align(4); - script_->seek(4); - add_import_reference(inst->data, inst->index); - break; - case opcode::OP_CallBuiltin: - case opcode::OP_CallBuiltinMethod: - case opcode::OP_ScriptFunctionCall: - case opcode::OP_ScriptMethodCall: - case opcode::OP_ScriptThreadCall: - case opcode::OP_ScriptMethodThreadCall: - script_->seek(1); - inst->size += script_->align(4); - script_->seek(4); - add_import_reference(inst->data, inst->index); - break; - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_Jump: - case opcode::OP_JumpBack: - case opcode::OP_DevblockBegin: - inst->size += script_->align(2); - script_->seek(2); - break; - case opcode::OP_Switch: - inst->size += script_->align(4); - script_->seek(4); - break; - case opcode::OP_EndSwitch: - { - inst->size += script_->align(4); - script_->seek(4); - - const auto count = std::stoul(inst->data[0]); - const auto numerical = inst->data.back() == "i"; - - for (auto i = 0u; i < count; i++) - { - if (inst->data[1 + (3 * i)] == "case") - { - if (!numerical /*|| !utils::string::is_number(inst->data[1 + (3 * i) + 1])*/) - { - add_string_reference(inst->data[1 + (3 * i) + 1], string_type::literal, script_->pos() + 2); - } - } - - inst->size += 8; - script_->seek(8); - } - - break; - } - default: - throw asm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void assembler::process_string(const std::string& data) -{ - if (!stringlist_.contains(data)) - { - auto pos = static_cast(script_->pos()); - script_->write_cstr(data); - stringlist_.insert({ data, pos }); - } -} - -void assembler::process_function(const function::ptr& func) -{ - process_string(func->name); - - for (const auto& inst : func->instructions) - { - process_instruction(inst); - } -} - -void assembler::process_instruction(const instruction::ptr& inst) -{ - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetInteger: - if (inst->data.size() == 2) - process_string(inst->data[0]); - break; - case opcode::OP_GetString: - case opcode::OP_GetIString: - process_string(inst->data[0]); - break; - case opcode::OP_GetAnimation: - process_string(inst->data[0]); - process_string(inst->data[1]); - break; - case opcode::OP_SafeCreateLocalVariables: - { - for (const auto& entry : inst->data) - { - process_string(entry); - } - - break; - } - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_ClearFieldVariable: - process_string(inst->data[0]); - break; - case opcode::OP_GetFunction: - process_string(inst->data[0]); - process_string(inst->data[1]); - break; - case opcode::OP_CallBuiltin: - case opcode::OP_CallBuiltinMethod: - case opcode::OP_ScriptFunctionCall: - case opcode::OP_ScriptMethodCall: - case opcode::OP_ScriptThreadCall: - case opcode::OP_ScriptMethodThreadCall: - process_string(inst->data[0]); - process_string(inst->data[1]); - break; - case opcode::OP_EndSwitch: - { - const auto count = std::stoul(inst->data[0]); - const auto numerical = inst->data.back() == "i"; - - for (auto i = 0u; i < count; i++) - { - if (inst->data[1 + (3 * i)] == "case") - { - if (!numerical /*|| !utils::string::is_number(inst->data[1 + (3 * i) + 1])*/) - { - process_string(inst->data[1 + (3 * i) + 1]); - } - } - } - - break; - } - default: - break; - } -} - -auto assembler::resolve_label(const std::string& name) -> std::int32_t -{ - for (const auto& entry : labels_) - { - if (entry.second == name) - { - return entry.first; - } - } - - throw asm_error("couldn't resolve label address of '" + name + "'!"); -} - -auto assembler::string_offset(const std::string& name) -> std::uint16_t -{ - const auto itr = stringlist_.find(name); - - if (itr != stringlist_.end()) - { - return itr->second; - } - - throw asm_error("couldn't resolve string assembly address of '" + name + "'!"); -} - -void assembler::add_string_reference(const std::string& str, string_type type, std::uint32_t ref) -{ - for (auto& entry : stringtables_) - { - if (entry.name == str && entry.type == static_cast(type)) - { - entry.refs.push_back(ref); - return; - } - } - - stringtables_.push_back({ str, std::uint8_t(type), { ref } }); -} - -void assembler::add_import_reference(const std::vector& data, std::uint32_t ref) -{ - for (auto& entry : imports_) - { - if (entry.space == data[0] && entry.name == data[1] && entry.params == std::stoi(data[2]) && entry.flags == std::stoi(data[3])) - { - entry.refs.push_back(ref); - return; - } - } - - import_ref new_entry; - new_entry.space = data[0]; - new_entry.name = data[1]; - new_entry.params = static_cast(std::stoi(data[2])); - new_entry.flags = static_cast(std::stoi(data[3])); - new_entry.refs.push_back(ref); - imports_.push_back(std::move(new_entry)); -} - -void assembler::add_anim_reference(const std::vector& data, std::uint32_t ref) -{ - for (auto& entry : animtrees_) - { - if (entry.name == data[0]) - { - if (data[1] == "-1") - { - entry.refs.push_back(ref); - } - else - { - entry.anims.push_back({ data[1], ref }); - } - return; - } - } - - animtree_ref new_entry; - new_entry.name = data[0]; - if (data[1] == "-1") - { - new_entry.refs.push_back(ref); - } - else - { - new_entry.anims.push_back({ data[1], ref }); - } - animtrees_.push_back(std::move(new_entry)); -} - -} // namespace xsk::arc::t6 diff --git a/src/t6/common/nodetree.cpp b/src/t6/common/nodetree.cpp deleted file mode 100644 index 4a2d22dc..00000000 --- a/src/t6/common/nodetree.cpp +++ /dev/null @@ -1,1965 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#include "xsk/stdinc.hpp" -#include "xsk/t6/t6.hpp" -#include "xsk/t6/common/arc.hpp" -#include "xsk/utils/string.hpp" - -namespace xsk::arc::ast -{ - -std::uint32_t node::indent_; - -void node::reset_indentation() -{ - indent_ = 0; -} - -auto node::indented(std::uint32_t indent) -> std::string -{ - static char buff[100]; - snprintf(buff, sizeof(buff), "%*s", indent, ""); - return std::string(buff); -} - -auto node::is_special_stmt() -> bool -{ - switch (kind_) - { - case kind::stmt_waittill: - case kind::stmt_waittillmatch: - case kind::stmt_if: - case kind::stmt_ifelse: - case kind::stmt_while: - case kind::stmt_dowhile: - case kind::stmt_for: - case kind::stmt_foreach: - case kind::stmt_switch: - return true; - default: - return false; - } -} - -auto node::is_special_stmt_dev() -> bool -{ - switch (kind_) - { - case kind::stmt_dev: - case kind::stmt_if: - case kind::stmt_ifelse: - case kind::stmt_while: - case kind::stmt_dowhile: - case kind::stmt_for: - case kind::stmt_foreach: - case kind::stmt_switch: - return true; - default: - return false; - } -} - -auto node::is_special_stmt_noif() -> bool -{ - switch (kind_) - { - case kind::stmt_waittill: - case kind::stmt_waittillmatch: - case kind::stmt_while: - case kind::stmt_dowhile: - case kind::stmt_for: - case kind::stmt_foreach: - case kind::stmt_switch: - return true; - default: - return false; - } -} - -auto node::is_special_stmt_dev_noif() -> bool -{ - switch (kind_) - { - case kind::stmt_dev: - case kind::stmt_while: - case kind::stmt_dowhile: - case kind::stmt_for: - case kind::stmt_foreach: - case kind::stmt_switch: - return true; - default: - return false; - } -} - -auto node::is_binary() -> bool -{ - switch (kind_) - { - case kind::expr_or: - case kind::expr_and: - case kind::expr_bitwise_or: - case kind::expr_bitwise_exor: - case kind::expr_bitwise_and: - case kind::expr_equality: - case kind::expr_inequality: - case kind::expr_less: - case kind::expr_greater: - case kind::expr_less_equal: - case kind::expr_greater_equal: - case kind::expr_shift_left: - case kind::expr_shift_right: - case kind::expr_add: - case kind::expr_sub: - case kind::expr_mul: - case kind::expr_div: - case kind::expr_mod: - return true; - default: - return false; - } -} - -auto node::precedence() -> std::uint8_t -{ - switch (kind_) - { - case kind::expr_or: return 1; - case kind::expr_and: return 2; - case kind::expr_bitwise_or: return 3; - case kind::expr_bitwise_exor: return 4; - case kind::expr_bitwise_and: return 5; - case kind::expr_equality: return 6; - case kind::expr_inequality: return 6; - case kind::expr_less: return 7; - case kind::expr_greater: return 7; - case kind::expr_less_equal: return 7; - case kind::expr_greater_equal:return 7; - case kind::expr_shift_left: return 8; - case kind::expr_shift_right: return 8; - case kind::expr_add: return 9; - case kind::expr_sub: return 9; - case kind::expr_mul: return 10; - case kind::expr_div: return 10; - case kind::expr_mod: return 10; - default: return 0; - } -} - -expr_true::expr_true() : node(kind::expr_true) {} -expr_true::expr_true(const location& loc) : node(kind::expr_true, loc) {} - -expr_false::expr_false() : node(kind::expr_false) {} -expr_false::expr_false(const location& loc) : node(kind::expr_false, loc) {} - -expr_integer::expr_integer(const std::string& value) : node(kind::expr_integer), value(std::move(value)) {} -expr_integer::expr_integer(const location& loc, const std::string& value) : node(kind::expr_integer, loc), value(std::move(value)) {} - -expr_float::expr_float(const std::string& value) : node(kind::expr_float), value(std::move(value)) {} -expr_float::expr_float(const location& loc, const std::string& value) : node(kind::expr_float, loc), value(std::move(value)) {} - -expr_vector::expr_vector(expr x, expr y, expr z) : node(kind::expr_vector), x(std::move(x)), y(std::move(y)), z(std::move(z)) {} -expr_vector::expr_vector(const location& loc, expr x, expr y, expr z) : node(kind::expr_vector, loc), x(std::move(x)), y(std::move(y)), z(std::move(z)) {} - -expr_hash::expr_hash(const std::string& value) : node(kind::expr_hash), value(value) {} -expr_hash::expr_hash(const location& loc, const std::string& value) : node(kind::expr_hash, loc), value(value) {} - -expr_string::expr_string(const std::string& value) : node(kind::expr_string), value(value) {} -expr_string::expr_string(const location& loc, const std::string& value) : node(kind::expr_string, loc), value(value) {} - -expr_istring::expr_istring(const std::string& value) : node(kind::expr_istring), value(std::move(value)) {} -expr_istring::expr_istring(const location& loc, const std::string& value) : node(kind::expr_istring, loc), value(std::move(value)) {} - -expr_path::expr_path() : node(kind::expr_path) {} -expr_path::expr_path(const std::string& value) : node(kind::expr_path), value(value) {} -expr_path::expr_path(const location& loc) : node(kind::expr_path, loc) {} -expr_path::expr_path(const location& loc, const std::string& value) : node(kind::expr_path, loc), value(value) {} - -expr_identifier::expr_identifier(const std::string& value) : node(kind::expr_identifier), value(value) {} -expr_identifier::expr_identifier(const location& loc, const std::string& value) : node(kind::expr_identifier, loc), value(value) {} - -expr_animtree::expr_animtree() : node(kind::expr_animtree) {} -expr_animtree::expr_animtree(const location& loc) : node(kind::expr_animtree, loc) {} - -expr_animation::expr_animation(const std::string& value) : node(kind::expr_animation), value(value) {} -expr_animation::expr_animation(const location& loc, const std::string& value) : node(kind::expr_animation, loc), value(value) {} - -expr_level::expr_level() : node(kind::expr_level) {} -expr_level::expr_level(const location& loc) : node(kind::expr_level, loc) {} - -expr_anim::expr_anim() : node(kind::expr_anim) {} -expr_anim::expr_anim(const location& loc) : node(kind::expr_anim, loc) {} - -expr_self::expr_self() : node(kind::expr_self) {} -expr_self::expr_self(const location& loc) : node(kind::expr_self, loc) {} - -expr_game::expr_game() : node(kind::expr_game) {} -expr_game::expr_game(const location& loc) : node(kind::expr_game, loc) {} - -expr_undefined::expr_undefined() : node(kind::expr_undefined) {} -expr_undefined::expr_undefined(const location& loc) : node(kind::expr_undefined, loc) {} - -expr_empty_array::expr_empty_array() : node(kind::expr_empty_array) {} -expr_empty_array::expr_empty_array(const location& loc) : node(kind::expr_empty_array, loc) {} - -expr_paren::expr_paren(expr child) : node(kind::expr_paren), child(std::move(child)) {} -expr_paren::expr_paren(const location& loc, expr child) : node(kind::expr_paren, loc), child(std::move(child)) {} - -expr_size::expr_size(expr obj) : node(kind::expr_size), obj(std::move(obj)) {} -expr_size::expr_size(const location& loc, expr obj) : node(kind::expr_size, loc), obj(std::move(obj)) {} - -expr_field::expr_field(expr obj, expr_identifier::ptr field) : node(kind::expr_field), obj(std::move(obj)), field(std::move(field)) {} -expr_field::expr_field(const location& loc, expr obj, expr_identifier::ptr field) : node(kind::expr_field, loc), obj(std::move(obj)), field(std::move(field)) {} - -expr_array::expr_array(expr obj, expr key) : node(kind::expr_array), obj(std::move(obj)), key(std::move(key)) {} -expr_array::expr_array(const location& loc, expr obj, expr key) : node(kind::expr_array, loc), obj(std::move(obj)), key(std::move(key)) {} - -expr_reference::expr_reference(expr_path::ptr path, expr_identifier::ptr name) : node(kind::expr_reference), path(std::move(path)), name(std::move(name)) {} -expr_reference::expr_reference(const location& loc, expr_path::ptr path, expr_identifier::ptr name) : node(kind::expr_reference, loc), path(std::move(path)), name(std::move(name)) {} - -expr_getnextarraykey::expr_getnextarraykey(expr arg1, expr arg2) : node(kind::expr_getnextarraykey), arg1(std::move(arg1)), arg2(std::move(arg2)) {} -expr_getnextarraykey::expr_getnextarraykey(const location& loc, expr arg1, expr arg2) : node(kind::expr_getnextarraykey, loc), arg1(std::move(arg1)), arg2(std::move(arg2)) {} - -expr_getfirstarraykey::expr_getfirstarraykey(expr arg) : node(kind::expr_getfirstarraykey), arg(std::move(arg)) {} -expr_getfirstarraykey::expr_getfirstarraykey(const location& loc, expr arg) : node(kind::expr_getfirstarraykey, loc), arg(std::move(arg)) {} - -expr_getdvarcoloralpha::expr_getdvarcoloralpha(expr arg) : node(kind::expr_getdvarcoloralpha), arg(std::move(arg)) {} -expr_getdvarcoloralpha::expr_getdvarcoloralpha(const location& loc, expr arg) : node(kind::expr_getdvarcoloralpha, loc), arg(std::move(arg)) {} - -expr_getdvarcolorblue::expr_getdvarcolorblue(expr arg) : node(kind::expr_getdvarcolorblue), arg(std::move(arg)) {} -expr_getdvarcolorblue::expr_getdvarcolorblue(const location& loc, expr arg) : node(kind::expr_getdvarcolorblue, loc), arg(std::move(arg)) {} - -expr_getdvarcolorgreen::expr_getdvarcolorgreen(expr arg) : node(kind::expr_getdvarcolorgreen), arg(std::move(arg)) {} -expr_getdvarcolorgreen::expr_getdvarcolorgreen(const location& loc, expr arg) : node(kind::expr_getdvarcolorgreen, loc), arg(std::move(arg)) {} - -expr_getdvarcolorred::expr_getdvarcolorred(expr arg) : node(kind::expr_getdvarcolorred), arg(std::move(arg)) {} -expr_getdvarcolorred::expr_getdvarcolorred(const location& loc, expr arg) : node(kind::expr_getdvarcolorred, loc), arg(std::move(arg)) {} - -expr_getdvarvector::expr_getdvarvector(expr arg) : node(kind::expr_getdvarvector), arg(std::move(arg)) {} -expr_getdvarvector::expr_getdvarvector(const location& loc, expr arg) : node(kind::expr_getdvarvector, loc), arg(std::move(arg)) {} - -expr_getdvarfloat::expr_getdvarfloat(expr arg) : node(kind::expr_getdvarfloat), arg(std::move(arg)) {} -expr_getdvarfloat::expr_getdvarfloat(const location& loc, expr arg) : node(kind::expr_getdvarfloat, loc), arg(std::move(arg)) {} - -expr_getdvarint::expr_getdvarint(expr arg) : node(kind::expr_getdvarint), arg(std::move(arg)) {} -expr_getdvarint::expr_getdvarint(const location& loc, expr arg) : node(kind::expr_getdvarint, loc), arg(std::move(arg)) {} - -expr_getdvar::expr_getdvar(expr arg) : node(kind::expr_getdvar), arg(std::move(arg)) {} -expr_getdvar::expr_getdvar(const location& loc, expr arg) : node(kind::expr_getdvar, loc), arg(std::move(arg)) {} - -expr_gettime::expr_gettime() : node(kind::expr_gettime) {} -expr_gettime::expr_gettime(const location& loc) : node(kind::expr_gettime, loc) {} - -expr_abs::expr_abs(expr arg) : node(kind::expr_abs), arg(std::move(arg)) {} -expr_abs::expr_abs(const location& loc, expr arg) : node(kind::expr_abs, loc), arg(std::move(arg)) {} - -expr_vectortoangles::expr_vectortoangles(expr arg) : node(kind::expr_vectortoangles), arg(std::move(arg)) {} -expr_vectortoangles::expr_vectortoangles(const location& loc, expr arg) : node(kind::expr_vectortoangles, loc), arg(std::move(arg)) {} - -expr_angleclamp180::expr_angleclamp180(expr arg) : node(kind::expr_angleclamp180), arg(std::move(arg)) {} -expr_angleclamp180::expr_angleclamp180(const location& loc, expr arg) : node(kind::expr_angleclamp180, loc), arg(std::move(arg)) {} - -expr_anglestoforward::expr_anglestoforward(expr arg) : node(kind::expr_anglestoforward), arg(std::move(arg)) {} -expr_anglestoforward::expr_anglestoforward(const location& loc, expr arg) : node(kind::expr_anglestoforward, loc), arg(std::move(arg)) {} - -expr_anglestoright::expr_anglestoright(expr arg) : node(kind::expr_anglestoright), arg(std::move(arg)) {} -expr_anglestoright::expr_anglestoright(const location& loc, expr arg) : node(kind::expr_anglestoright, loc), arg(std::move(arg)) {} - -expr_anglestoup::expr_anglestoup(expr arg) : node(kind::expr_anglestoup), arg(std::move(arg)) {} -expr_anglestoup::expr_anglestoup(const location& loc, expr arg) : node(kind::expr_anglestoup, loc), arg(std::move(arg)) {} - -expr_vectorscale::expr_vectorscale(expr arg1, expr arg2) : node(kind::expr_vectorscale), arg1(std::move(arg1)), arg2(std::move(arg2)) {} -expr_vectorscale::expr_vectorscale(const location& loc, expr arg1, expr arg2) : node(kind::expr_vectorscale, loc), arg1(std::move(arg1)), arg2(std::move(arg2)) {} - -expr_isdefined::expr_isdefined(expr arg) : node(kind::expr_isdefined), arg(std::move(arg)) {} -expr_isdefined::expr_isdefined(const location& loc, expr arg) : node(kind::expr_isdefined, loc), arg(std::move(arg)) {} - -expr_arguments::expr_arguments() : node(kind::expr_arguments) {} -expr_arguments::expr_arguments(const location& loc) : node(kind::expr_arguments, loc) {} - -expr_parameters::expr_parameters() : node(kind::expr_parameters) {} -expr_parameters::expr_parameters(const location& loc) : node(kind::expr_parameters, loc) {} - -expr_pointer::expr_pointer(expr func, expr_arguments::ptr args, call::mode mode) : node(kind::expr_pointer), func(std::move(func)), args(std::move(args)), mode(mode) {} -expr_pointer::expr_pointer(const location& loc, expr func, expr_arguments::ptr args, call::mode mode) : node(kind::expr_pointer, loc), func(std::move(func)), args(std::move(args)), mode(mode) {} - -expr_function::expr_function(expr_path::ptr path, expr_identifier::ptr name, expr_arguments::ptr args, call::mode mode) : node(kind::expr_function), path(std::move(path)), name(std::move(name)), args(std::move(args)), mode(mode) {} -expr_function::expr_function(const location& loc, expr_path::ptr path, expr_identifier::ptr name, expr_arguments::ptr args, call::mode mode) : node(kind::expr_function, loc), path(std::move(path)), name(std::move(name)), args(std::move(args)), mode(mode) {} - -expr_method::expr_method(expr obj, ast::call call) : node(kind::expr_method), obj(std::move(obj)), call(std::move(call)) {} -expr_method::expr_method(const location& loc, expr obj, ast::call call) : node(kind::expr_method, loc), obj(std::move(obj)), call(std::move(call)) {} - -expr_call::expr_call(ast::call call) : node(kind::expr_call), call(std::move(call)) {} -expr_call::expr_call(const location& loc, ast::call call) : node(kind::expr_call, loc), call(std::move(call)) {} - -expr_complement::expr_complement(expr rvalue) : node(kind::expr_complement), rvalue(std::move(rvalue)) {} -expr_complement::expr_complement(const location& loc, expr rvalue) : node(kind::expr_complement, loc), rvalue(std::move(rvalue)) {} - -expr_negate::expr_negate(expr rvalue) : node(kind::expr_negate), rvalue(std::move(rvalue)) {} -expr_negate::expr_negate(const location& loc, expr rvalue) : node(kind::expr_negate, loc), rvalue(std::move(rvalue)) {} - -expr_not::expr_not(expr rvalue) : node(kind::expr_not), rvalue(std::move(rvalue)) {} -expr_not::expr_not(const location& loc, expr rvalue) : node(kind::expr_not, loc), rvalue(std::move(rvalue)) {} - -expr_binary::expr_binary(ast::kind kind, expr lvalue, expr rvalue) : node(kind), lvalue(std::move(lvalue)), rvalue(std::move(rvalue)) {} -expr_binary::expr_binary(ast::kind kind, const location& loc, expr lvalue, expr rvalue) : node(kind, loc), lvalue(std::move(lvalue)), rvalue(std::move(rvalue)) {} - -expr_add::expr_add(expr lvalue, expr rvalue) : expr_binary(kind::expr_add, std::move(lvalue), std::move(rvalue)) {} -expr_add::expr_add(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_add, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_sub::expr_sub(expr lvalue, expr rvalue) : expr_binary(kind::expr_sub, std::move(lvalue), std::move(rvalue)) {} -expr_sub::expr_sub(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_sub, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_mul::expr_mul( expr lvalue, expr rvalue) : expr_binary(kind::expr_mul, std::move(lvalue), std::move(rvalue)) {} -expr_mul::expr_mul(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_mul, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_div::expr_div(expr lvalue, expr rvalue) : expr_binary(kind::expr_div, std::move(lvalue), std::move(rvalue)) {} -expr_div::expr_div(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_div, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_mod::expr_mod(expr lvalue, expr rvalue) : expr_binary(kind::expr_mod, std::move(lvalue), std::move(rvalue)) {} -expr_mod::expr_mod(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_mod, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_shift_left::expr_shift_left(expr lvalue, expr rvalue) : expr_binary(kind::expr_shift_left, std::move(lvalue), std::move(rvalue)) {} -expr_shift_left::expr_shift_left(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_shift_left, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_shift_right::expr_shift_right(expr lvalue, expr rvalue) : expr_binary(kind::expr_shift_right, std::move(lvalue), std::move(rvalue)) {} -expr_shift_right::expr_shift_right(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_shift_right, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_bitwise_or::expr_bitwise_or(expr lvalue, expr rvalue) : expr_binary(kind::expr_bitwise_or, std::move(lvalue), std::move(rvalue)) {} -expr_bitwise_or::expr_bitwise_or(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_bitwise_or, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_bitwise_and::expr_bitwise_and(expr lvalue, expr rvalue) : expr_binary(kind::expr_bitwise_and, std::move(lvalue), std::move(rvalue)) {} -expr_bitwise_and::expr_bitwise_and(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_bitwise_and, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_bitwise_exor::expr_bitwise_exor(expr lvalue, expr rvalue) : expr_binary(kind::expr_bitwise_exor, std::move(lvalue), std::move(rvalue)) {} -expr_bitwise_exor::expr_bitwise_exor(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_bitwise_exor, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_equality::expr_equality(expr lvalue, expr rvalue) : expr_binary(kind::expr_equality, std::move(lvalue), std::move(rvalue)) {} -expr_equality::expr_equality(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_equality, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_inequality::expr_inequality(expr lvalue, expr rvalue) : expr_binary(kind::expr_inequality, std::move(lvalue), std::move(rvalue)) {} -expr_inequality::expr_inequality(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_inequality, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_less_equal::expr_less_equal(expr lvalue, expr rvalue) : expr_binary(kind::expr_less_equal, std::move(lvalue), std::move(rvalue)) {} -expr_less_equal::expr_less_equal(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_less_equal, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_greater_equal::expr_greater_equal(expr lvalue, expr rvalue) : expr_binary(kind::expr_greater_equal, std::move(lvalue), std::move(rvalue)) {} -expr_greater_equal::expr_greater_equal(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_greater_equal, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_less::expr_less(expr lvalue, expr rvalue) : expr_binary(kind::expr_less, std::move(lvalue), std::move(rvalue)) {} -expr_less::expr_less(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_less, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_greater::expr_greater(expr lvalue, expr rvalue) : expr_binary(kind::expr_greater, std::move(lvalue), std::move(rvalue)) {} -expr_greater::expr_greater(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_greater, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_or::expr_or(expr lvalue, expr rvalue) : expr_binary(kind::expr_or, std::move(lvalue), std::move(rvalue)) {} -expr_or::expr_or(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_or, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_and::expr_and(expr lvalue, expr rvalue) : expr_binary(kind::expr_and, std::move(lvalue), std::move(rvalue)) {} -expr_and::expr_and(const location& loc, expr lvalue, expr rvalue) : expr_binary(kind::expr_and, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_ternary::expr_ternary(expr test, expr true_expr, expr false_expr) : node(kind::expr_ternary), test(std::move(test)), true_expr(std::move(true_expr)), false_expr(std::move(false_expr)) {} -expr_ternary::expr_ternary(const location& loc, expr test, expr true_expr, expr false_expr) : node(kind::expr_ternary, loc), test(std::move(test)), true_expr(std::move(true_expr)), false_expr(std::move(false_expr)) {} - -expr_increment::expr_increment(expr lvalue, bool prefix) : node(kind::expr_increment), lvalue(std::move(lvalue)), prefix(prefix) {} -expr_increment::expr_increment(const location& loc, expr lvalue, bool prefix) : node(kind::expr_increment, loc), lvalue(std::move(lvalue)), prefix(prefix) {} - -expr_decrement::expr_decrement(expr lvalue, bool prefix) : node(kind::expr_decrement), lvalue(std::move(lvalue)), prefix(prefix) {} -expr_decrement::expr_decrement(const location& loc, expr lvalue, bool prefix) : node(kind::expr_decrement, loc), lvalue(std::move(lvalue)), prefix(prefix) {} - -expr_assign::expr_assign(ast::kind kind, expr lvalue, expr rvalue) : node(kind), lvalue(std::move(lvalue)), rvalue(std::move(rvalue)) {} -expr_assign::expr_assign(ast::kind kind, const location& loc, expr lvalue, expr rvalue) : node(kind, loc), lvalue(std::move(lvalue)), rvalue(std::move(rvalue)) {} - -expr_assign_equal::expr_assign_equal(expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_equal, std::move(lvalue), std::move(rvalue)) {} -expr_assign_equal::expr_assign_equal(const location& loc, expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_equal, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_assign_add::expr_assign_add(expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_add, std::move(lvalue), std::move(rvalue)) {} -expr_assign_add::expr_assign_add(const location& loc, expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_add, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_assign_sub::expr_assign_sub(expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_sub, std::move(lvalue), std::move(rvalue)) {} -expr_assign_sub::expr_assign_sub(const location& loc, expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_sub, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_assign_mul::expr_assign_mul(expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_mul, std::move(lvalue), std::move(rvalue)) {} -expr_assign_mul::expr_assign_mul(const location& loc, expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_mul, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_assign_div::expr_assign_div(expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_div, std::move(lvalue), std::move(rvalue)) {} -expr_assign_div::expr_assign_div(const location& loc, expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_div, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_assign_mod::expr_assign_mod(expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_mod, std::move(lvalue), std::move(rvalue)) {} -expr_assign_mod::expr_assign_mod(const location& loc, expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_mod, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_assign_shift_left::expr_assign_shift_left(expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_shift_left, std::move(lvalue), std::move(rvalue)) {} -expr_assign_shift_left::expr_assign_shift_left(const location& loc, expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_shift_left, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_assign_shift_right::expr_assign_shift_right(expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_shift_right, std::move(lvalue), std::move(rvalue)) {} -expr_assign_shift_right::expr_assign_shift_right(const location& loc, expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_shift_right, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_assign_bitwise_or::expr_assign_bitwise_or(expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_bitwise_or, std::move(lvalue), std::move(rvalue)) {} -expr_assign_bitwise_or::expr_assign_bitwise_or(const location& loc, expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_bitwise_or, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_assign_bitwise_and::expr_assign_bitwise_and(expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_bitwise_and, std::move(lvalue), std::move(rvalue)) {} -expr_assign_bitwise_and::expr_assign_bitwise_and(const location& loc, expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_bitwise_and, loc, std::move(lvalue), std::move(rvalue)) {} - -expr_assign_bitwise_exor::expr_assign_bitwise_exor(expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_bitwise_exor, std::move(lvalue), std::move(rvalue)) {} -expr_assign_bitwise_exor::expr_assign_bitwise_exor(const location& loc, expr lvalue, expr rvalue) : expr_assign(kind::expr_assign_bitwise_exor, loc, std::move(lvalue), std::move(rvalue)) {} - -stmt_list::stmt_list() : node(kind::stmt_list) {} -stmt_list::stmt_list(const location& loc) : node(kind::stmt_list, loc) {} - -stmt_dev::stmt_dev(ast::stmt_list::ptr list) : node(kind::stmt_dev), list(std::move(list)) {} -stmt_dev::stmt_dev(const location& loc, ast::stmt_list::ptr list) : node(kind::stmt_dev, loc), list(std::move(list)) {} - -stmt_expr::stmt_expr(ast::expr expr) : node(kind::stmt_expr), expr(std::move(expr)) {} -stmt_expr::stmt_expr(const location& loc, ast::expr expr) : node(kind::stmt_expr, loc), expr(std::move(expr)) {} - -stmt_call::stmt_call(ast::expr expr) : node(kind::stmt_call), expr(std::move(expr)) {} -stmt_call::stmt_call(const location& loc, ast::expr expr) : node(kind::stmt_call, loc), expr(std::move(expr)) {} - -stmt_const::stmt_const(expr_identifier::ptr lvalue, expr rvalue) : node(kind::stmt_const), lvalue(std::move(lvalue)), rvalue(std::move(rvalue)) {} -stmt_const::stmt_const(const location& loc, expr_identifier::ptr lvalue, expr rvalue) : node(kind::stmt_const, loc), lvalue(std::move(lvalue)), rvalue(std::move(rvalue)) {} - -stmt_assign::stmt_assign(ast::expr expr) : node(kind::stmt_assign), expr(std::move(expr)) {} -stmt_assign::stmt_assign(const location& loc, ast::expr expr) : node(kind::stmt_assign, loc), expr(std::move(expr)) {} - -stmt_endon::stmt_endon(expr obj, expr event) : node(kind::stmt_endon), obj(std::move(obj)), event(std::move(event)) {} -stmt_endon::stmt_endon(const location& loc, expr obj, expr event) : node(kind::stmt_endon, loc), obj(std::move(obj)), event(std::move(event)) {} - -stmt_notify::stmt_notify(expr obj, expr event, expr_arguments::ptr args) : node(kind::stmt_notify), obj(std::move(obj)), event(std::move(event)), args(std::move(args)) {} -stmt_notify::stmt_notify(const location& loc, expr obj, expr event, expr_arguments::ptr args) : node(kind::stmt_notify, loc), obj(std::move(obj)), event(std::move(event)), args(std::move(args)) {} - -stmt_realwait::stmt_realwait(expr time) : node(kind::stmt_realwait), time(std::move(time)) {} -stmt_realwait::stmt_realwait(const location& loc, expr time) : node(kind::stmt_realwait, loc), time(std::move(time)) {} - -stmt_wait::stmt_wait(expr time) : node(kind::stmt_wait), time(std::move(time)) {} -stmt_wait::stmt_wait(const location& loc, expr time) : node(kind::stmt_wait, loc), time(std::move(time)) {} - -stmt_waittill::stmt_waittill(expr obj, expr event, expr_arguments::ptr args) : node(kind::stmt_waittill), obj(std::move(obj)), event(std::move(event)), args(std::move(args)) {} -stmt_waittill::stmt_waittill(const location& loc, expr obj, expr event, expr_arguments::ptr args) : node(kind::stmt_waittill, loc), obj(std::move(obj)), event(std::move(event)), args(std::move(args)) {} - -stmt_waittillmatch::stmt_waittillmatch(expr obj, expr event, expr_arguments::ptr args) : node(kind::stmt_waittillmatch), obj(std::move(obj)), event(std::move(event)), args(std::move(args)) {} -stmt_waittillmatch::stmt_waittillmatch(const location& loc, expr obj, expr event, expr_arguments::ptr args) : node(kind::stmt_waittillmatch, loc), obj(std::move(obj)), event(std::move(event)), args(std::move(args)) {} - -stmt_waittillframeend::stmt_waittillframeend() : node(kind::stmt_waittillframeend) {} -stmt_waittillframeend::stmt_waittillframeend(const location& loc) : node(kind::stmt_waittillframeend, loc) {} - -stmt_if::stmt_if(expr test, ast::stmt stmt) : node(kind::stmt_if), test(std::move(test)), stmt(std::move(stmt)), blk(nullptr) {} -stmt_if::stmt_if(const location& loc, expr test, ast::stmt stmt) : node(kind::stmt_if, loc), test(std::move(test)), stmt(std::move(stmt)), blk(nullptr) {} - -stmt_ifelse::stmt_ifelse(expr test, stmt stmt_if, stmt stmt_else) : node(kind::stmt_ifelse), test(std::move(test)), stmt_if(std::move(stmt_if)), stmt_else(std::move(stmt_else)), blk_if(nullptr), blk_else(nullptr) {} -stmt_ifelse::stmt_ifelse(const location& loc, expr test, stmt stmt_if, stmt stmt_else) : node(kind::stmt_ifelse, loc), test(std::move(test)), stmt_if(std::move(stmt_if)), stmt_else(std::move(stmt_else)), blk_if(nullptr), blk_else(nullptr) {} - -stmt_while::stmt_while(expr test, ast::stmt stmt) : node(kind::stmt_while), test(std::move(test)), stmt(std::move(stmt)), blk(nullptr) {} -stmt_while::stmt_while(const location& loc, expr test, ast::stmt stmt) : node(kind::stmt_while, loc), test(std::move(test)), stmt(std::move(stmt)), blk(nullptr) {} - -stmt_dowhile::stmt_dowhile(expr test, ast::stmt stmt) : node(kind::stmt_dowhile), test(std::move(test)), stmt(std::move(stmt)), blk(nullptr) {} -stmt_dowhile::stmt_dowhile(const location& loc, expr test, ast::stmt stmt) : node(kind::stmt_dowhile, loc), test(std::move(test)), stmt(std::move(stmt)), blk(nullptr) {} - -stmt_for::stmt_for(ast::stmt init, expr test, ast::stmt iter, ast::stmt stmt) : node(kind::stmt_for), init(std::move(init)), test(std::move(test)), iter(std::move(iter)), stmt(std::move(stmt)), blk(nullptr), blk_iter(nullptr) {} -stmt_for::stmt_for(const location& loc, ast::stmt init, expr test, ast::stmt iter, ast::stmt stmt) : node(kind::stmt_for, loc), init(std::move(init)), test(std::move(test)), iter(std::move(iter)), stmt(std::move(stmt)), blk(nullptr), blk_iter(nullptr) {} - -stmt_foreach::stmt_foreach(const location& loc, ast::stmt stmt, bool use_key) : node(kind::stmt_foreach, loc), array_expr(nullptr), value_expr(nullptr), key_expr(nullptr), array(nullptr), pre_expr(nullptr), cond_expr(nullptr), post_expr(nullptr), stmt0(nullptr), stmt(std::move(stmt)), ctx(nullptr), ctx_post(nullptr), use_key(use_key) {} -stmt_foreach::stmt_foreach(ast::expr element, ast::expr container, ast::stmt stmt) : node(kind::stmt_foreach), array_expr(std::move(container)), value_expr(std::move(element)), key_expr(nullptr), array(nullptr), pre_expr(nullptr), cond_expr(nullptr), post_expr(nullptr), stmt0(nullptr), stmt(std::move(stmt)), ctx(nullptr), ctx_post(nullptr), use_key(false) {} -stmt_foreach::stmt_foreach(ast::expr key, ast::expr element, ast::expr container, ast::stmt stmt) : node(kind::stmt_foreach), array_expr(std::move(container)), value_expr(std::move(element)), key_expr(std::move(key)), array(nullptr), pre_expr(nullptr), cond_expr(nullptr), post_expr(nullptr), stmt0(nullptr), stmt(std::move(stmt)), ctx(nullptr), ctx_post(nullptr), use_key(true) {} -stmt_foreach::stmt_foreach(const location& loc, ast::expr element, ast::expr container, ast::stmt stmt) : node(kind::stmt_foreach, loc), array_expr(std::move(container)), value_expr(std::move(element)), key_expr(nullptr), array(nullptr), pre_expr(nullptr), cond_expr(nullptr), post_expr(nullptr), stmt0(nullptr), stmt(std::move(stmt)), ctx(nullptr), ctx_post(nullptr), use_key(false) {} -stmt_foreach::stmt_foreach(const location& loc, ast::expr key, ast::expr element, ast::expr container, ast::stmt stmt) : node(kind::stmt_foreach, loc), array_expr(std::move(container)), value_expr(std::move(element)), key_expr(std::move(key)), array(nullptr), pre_expr(nullptr), cond_expr(nullptr), post_expr(nullptr), stmt0(nullptr), stmt(std::move(stmt)), ctx(nullptr), ctx_post(nullptr), use_key(true) {} - -stmt_switch::stmt_switch(expr test, stmt_list::ptr stmt) : node(kind::stmt_switch), test(std::move(test)), stmt(std::move(stmt)), ctx(nullptr) {} -stmt_switch::stmt_switch(const location& loc, expr test, stmt_list::ptr stmt) : node(kind::stmt_switch, loc), test(std::move(test)), stmt(std::move(stmt)), ctx(nullptr) {} - -stmt_case::stmt_case(expr label) : node(kind::stmt_case), label(std::move(label)), stmt(nullptr), blk(nullptr) {} -stmt_case::stmt_case(const location& loc, expr label) : node(kind::stmt_case, loc), label(std::move(label)), stmt(nullptr), blk(nullptr) {} -stmt_case::stmt_case(const location& loc, expr label, stmt_list::ptr stmt) : node(kind::stmt_case, loc), label(std::move(label)), stmt(std::move(stmt)), blk(nullptr) {} - -stmt_default::stmt_default() : node(kind::stmt_default), stmt(nullptr), blk(nullptr) {} -stmt_default::stmt_default(const location& loc) : node(kind::stmt_default, loc), stmt(nullptr), blk(nullptr) {} -stmt_default::stmt_default(const location& loc, stmt_list::ptr stmt) : node(kind::stmt_default, loc), stmt(std::move(stmt)), blk(nullptr) {} - -stmt_break::stmt_break() : node(kind::stmt_break) {} -stmt_break::stmt_break(const location& loc) : node(kind::stmt_break, loc) {} - -stmt_continue::stmt_continue() : node(kind::stmt_continue) {} -stmt_continue::stmt_continue(const location& loc) : node(kind::stmt_continue, loc) {} - -stmt_return::stmt_return(ast::expr expr) : node(kind::stmt_return), expr(std::move(expr)) {} -stmt_return::stmt_return(const location& loc, ast::expr expr) : node(kind::stmt_return, loc), expr(std::move(expr)) {} - -stmt_breakpoint::stmt_breakpoint() : node(kind::stmt_breakpoint) {} -stmt_breakpoint::stmt_breakpoint(const location& loc) : node(kind::stmt_breakpoint, loc) {} - -stmt_prof_begin::stmt_prof_begin(expr_arguments::ptr args) : node(kind::stmt_prof_begin), args(std::move(args)) {} -stmt_prof_begin::stmt_prof_begin(const location& loc, expr_arguments::ptr args) : node(kind::stmt_prof_begin, loc), args(std::move(args)) {} - -stmt_prof_end::stmt_prof_end(expr_arguments::ptr args) : node(kind::stmt_prof_end), args(std::move(args)) {} -stmt_prof_end::stmt_prof_end(const location& loc, expr_arguments::ptr args) : node(kind::stmt_prof_end, loc), args(std::move(args)) {} - -decl_thread::decl_thread(expr_identifier::ptr name, expr_parameters::ptr params, stmt_list::ptr stmt, export_flags flags) : node(kind::decl_thread), name(std::move(name)), params(std::move(params)), stmt(std::move(stmt)), flags(flags) {} -decl_thread::decl_thread(const location& loc, expr_identifier::ptr name, expr_parameters::ptr params, stmt_list::ptr stmt, export_flags flags) : node(kind::decl_thread, loc), name(std::move(name)), params(std::move(params)), stmt(std::move(stmt)), flags(flags) {} - -decl_usingtree::decl_usingtree(expr_string::ptr name) : node(kind::decl_usingtree), name(std::move(name)) {} -decl_usingtree::decl_usingtree(const location& loc, expr_string::ptr name) : node(kind::decl_usingtree, loc), name(std::move(name)) {} - -decl_dev_begin::decl_dev_begin() : node(kind::decl_dev_begin) {} -decl_dev_begin::decl_dev_begin(const location& loc) : node(kind::decl_dev_begin, loc) {} - -decl_dev_end::decl_dev_end() : node(kind::decl_dev_end) {} -decl_dev_end::decl_dev_end(const location& loc) : node(kind::decl_dev_end, loc) {} - -include::include(expr_path::ptr path) : node(kind::include), path(std::move(path)) {} -include::include(const location& loc, expr_path::ptr path) : node(kind::include, loc), path(std::move(path)) {} - -program::program() : node(kind::program) {} -program::program(const location& loc) : node(kind::program, loc) {} - -asm_loc::asm_loc(const std::string& value) : node(kind::asm_loc), value(value) {} -asm_loc::asm_loc(const location& loc, const std::string& value) : node(kind::asm_loc, loc), value(value) {} - -asm_jump::asm_jump(const std::string& value) : node(kind::asm_jump), value(std::move(value)) {} -asm_jump::asm_jump(const location& loc, const std::string& value) : node(kind::asm_jump, loc), value(value) {} - -asm_jump_back::asm_jump_back(const std::string& value) : node(kind::asm_jump_back), value(value) {} -asm_jump_back::asm_jump_back(const location& loc, const std::string& value) : node(kind::asm_jump_back, loc), value(value) {} - -asm_jump_cond::asm_jump_cond(ast::expr expr, const std::string& value) : node(kind::asm_jump_cond), expr(std::move(expr)), value(value) {} -asm_jump_cond::asm_jump_cond(const location& loc, ast::expr expr, const std::string& value) : node(kind::asm_jump_cond, loc), expr(std::move(expr)), value(value) {} - -asm_jump_true_expr::asm_jump_true_expr(ast::expr expr, const std::string& value) : node(kind::asm_jump_true_expr), expr(std::move(expr)), value(value) {} -asm_jump_true_expr::asm_jump_true_expr(const location& loc, ast::expr expr, const std::string& value) : node(kind::asm_jump_true_expr, loc), expr(std::move(expr)), value(value) {} - -asm_jump_false_expr::asm_jump_false_expr(ast::expr expr, const std::string& value) : node(kind::asm_jump_false_expr), expr(std::move(expr)), value(value) {} -asm_jump_false_expr::asm_jump_false_expr(const location& loc, ast::expr expr, const std::string& value) : node(kind::asm_jump_false_expr, loc), expr(std::move(expr)), value(value) {} - -asm_switch::asm_switch(ast::expr expr, const std::string& value) : node(kind::asm_switch), expr(std::move(expr)), value(value) {} -asm_switch::asm_switch(const location& loc, ast::expr expr, const std::string& value) : node(kind::asm_switch, loc), expr(std::move(expr)), value(value) {} - -asm_endswitch::asm_endswitch(std::vector data, const std::string& count) : node(kind::asm_endswitch), data(std::move(data)), count(count) {} -asm_endswitch::asm_endswitch(const location& loc, std::vector data, const std::string& count) : node(kind::asm_endswitch, loc), data(std::move(data)), count(count) {} - -asm_prescriptcall::asm_prescriptcall() : node(kind::asm_prescriptcall) {} -asm_prescriptcall::asm_prescriptcall(const location& loc) : node(kind::asm_prescriptcall, loc) {} - -asm_voidcodepos::asm_voidcodepos() : node(kind::asm_voidcodepos) {} -asm_voidcodepos::asm_voidcodepos(const location& loc) : node(kind::asm_voidcodepos, loc) {} - -asm_dev::asm_dev(const std::string& value) : node(kind::asm_dev), value(std::move(value)) {} -asm_dev::asm_dev(const location& loc, const std::string& value) : node(kind::asm_dev, loc), value(value) {} - -auto expr_true::print() const -> std::string -{ - return "true"; -} - -auto expr_false::print() const -> std::string -{ - return "false"; -} - -auto expr_integer::print() const -> std::string -{ - return value; -} - -auto expr_float::print() const -> std::string -{ - return value; -} - -auto expr_vector::print() const -> std::string -{ - return "( "s + x.print() + ", " + y.print() + ", " + z.print() + " )"; -} - -auto expr_hash::print() const -> std::string -{ - return value.starts_with("_hash_") ? value : ("\"" + value + "\""); -} - -auto expr_string::print() const -> std::string -{ - return utils::string::to_literal(value); -} - -auto expr_istring::print() const -> std::string -{ - return "&"s += utils::string::to_literal(value); -} - -auto expr_path::print() const -> std::string -{ - return utils::string::backslash(value); -} - -auto expr_identifier::print() const -> std::string -{ - return value; -} - -auto expr_animtree::print() const -> std::string -{ - return "#animtree"; -} - -auto expr_animation::print() const -> std::string -{ - return "%"s += value; -} - -auto expr_level::print() const -> std::string -{ - return "level"; -} - -auto expr_anim::print() const -> std::string -{ - return "anim"; -} - -auto expr_self::print() const -> std::string -{ - return "self"; -} - -auto expr_game::print() const -> std::string -{ - return "game"; -} - -auto expr_undefined::print() const -> std::string -{ - return "undefined"; -} - -auto expr_empty_array::print() const -> std::string -{ - return "[]"; -} - -auto expr_paren::print() const -> std::string -{ - return "( " + child.print() + " )"; -} - -auto expr_size::print() const -> std::string -{ - return obj.print() + ".size"; -} - -auto expr_field::print() const -> std::string -{ - return obj.print() + "." + field->print(); -} - -auto expr_array::print() const -> std::string -{ - return obj.print() + "[" + key.print() + "]"; -} - -auto expr_reference::print() const -> std::string -{ - return path->print() + "::" + name->print(); -} - -auto expr_getnextarraykey::print() const -> std::string -{ - return "getnextarraykey( " + arg1.print() + ", " + arg2.print() + " )"; -} - -auto expr_getfirstarraykey::print() const -> std::string -{ - return "getfirstarraykey( " + arg.print() + " )"; -} - -auto expr_getdvarcoloralpha::print() const -> std::string -{ - return "getdvarcoloralpha( " + arg.print() + " )"; -} - -auto expr_getdvarcolorblue::print() const -> std::string -{ - return "getdvarcolorblue( " + arg.print() + " )"; -} - -auto expr_getdvarcolorgreen::print() const -> std::string -{ - return "getdvarcolorgreen( " + arg.print() + " )"; -} - -auto expr_getdvarcolorred::print() const -> std::string -{ - return "getdvarcolorred( " + arg.print() + " )"; -} - -auto expr_getdvarvector::print() const -> std::string -{ - return "getdvarvector( " + arg.print() + " )"; -} - -auto expr_getdvarfloat::print() const -> std::string -{ - return "getdvarfloat( " + arg.print() + " )"; -} - -auto expr_getdvarint::print() const -> std::string -{ - return "getdvarint( " + arg.print() + " )"; -} - -auto expr_getdvar::print() const -> std::string -{ - return "getdvar( " + arg.print() + " )"; -} - -auto expr_gettime::print() const -> std::string -{ - return "gettime()"; -} - -auto expr_abs::print() const -> std::string -{ - return "abs( " + arg.print() + " )"; -} - -auto expr_vectortoangles::print() const -> std::string -{ - return "vectortoangles( " + arg.print() + " )"; -} - -auto expr_angleclamp180::print() const -> std::string -{ - return "angleclamp180( " + arg.print() + " )"; -} - -auto expr_anglestoforward::print() const -> std::string -{ - return "anglestoforward( " + arg.print() + " )"; -} - -auto expr_anglestoright::print() const -> std::string -{ - return "anglestoright( " + arg.print() + " )"; -} - -auto expr_anglestoup::print() const -> std::string -{ - return "anglestoup( " + arg.print() + " )"; -} - -auto expr_vectorscale::print() const -> std::string -{ - return "vectorscale( " + arg1.print() + ", " + arg2.print() + " )"; -} - -auto expr_isdefined::print() const -> std::string -{ - return "isdefined( " + arg.print() + " )"; -} - -auto expr_arguments::print() const -> std::string -{ - std::string data; - - for (const auto& entry : list) - { - data += " " + entry.print(); - data += (&entry != &list.back()) ? "," : " "; - } - - return data; -} - -auto expr_parameters::print() const -> std::string -{ - std::string data; - - for (const auto& entry : list) - { - data += " " + entry.print(); - data += (&entry != &list.back()) ? "," : " "; - } - - return data; -} - -auto expr_pointer::print() const -> std::string -{ - std::string data; - - if (mode == call::mode::thread) - data += "thread "; - - return data += "[[ "s + func.print() + " ]](" + args->print() + ")"; -} - -auto expr_function::print() const -> std::string -{ - std::string data; - - if (mode == call::mode::thread) - data += "thread "; - - if (path->value != "") - data += path->print() + "::"; - - return data += name->print() + "(" + args->print() + ")"; -} - -auto expr_method::print() const -> std::string -{ - return obj.print() + " " + call.print(); -} - -auto expr_call::print() const -> std::string -{ - return call.print(); -} - -auto expr_complement::print() const -> std::string -{ - return "~" + rvalue.print(); -} - -auto expr_negate::print() const -> std::string -{ - return "-" + rvalue.print(); -} - -auto expr_not::print() const -> std::string -{ - return "!" + rvalue.print(); -} - -auto expr_add::print() const -> std::string -{ - return lvalue.print() + " + " + rvalue.print(); -} - -auto expr_sub::print() const -> std::string -{ - return lvalue.print() + " - " + rvalue.print(); -} - -auto expr_mul::print() const -> std::string -{ - return lvalue.print() + " * " + rvalue.print(); -} - -auto expr_div::print() const -> std::string -{ - return lvalue.print() + " / " + rvalue.print(); -} - -auto expr_mod::print() const -> std::string -{ - return lvalue.print() + " % " + rvalue.print(); -} - -auto expr_shift_left::print() const -> std::string -{ - return lvalue.print() + " << " + rvalue.print(); -} - -auto expr_shift_right::print() const -> std::string -{ - return lvalue.print() + " >> " + rvalue.print(); -} - -auto expr_bitwise_or::print() const -> std::string -{ - return lvalue.print() + " | " + rvalue.print(); -} - -auto expr_bitwise_and::print() const -> std::string -{ - return lvalue.print() + " & " + rvalue.print(); -} - -auto expr_bitwise_exor::print() const -> std::string -{ - return lvalue.print() + " ^ " + rvalue.print(); -} - -auto expr_equality::print() const -> std::string -{ - return lvalue.print() + " == " + rvalue.print(); -} - -auto expr_inequality::print() const -> std::string -{ - return lvalue.print() + " != " + rvalue.print(); -} - -auto expr_less_equal::print() const -> std::string -{ - return lvalue.print() + " <= " + rvalue.print(); -} - -auto expr_greater_equal::print() const -> std::string -{ - return lvalue.print() + " >= " + rvalue.print(); -} - -auto expr_less::print() const -> std::string -{ - return lvalue.print() + " < " + rvalue.print(); -} - -auto expr_greater::print() const -> std::string -{ - return lvalue.print() + " > " + rvalue.print(); -} - -auto expr_or::print() const -> std::string -{ - return lvalue.print() + " || " + rvalue.print(); -} - -auto expr_and::print() const -> std::string -{ - return lvalue.print() + " && " + rvalue.print(); -} - -auto expr_ternary::print() const -> std::string -{ - return test.print() + " ? " + true_expr.print() + " : " + false_expr.print(); -} - -auto expr_increment::print() const -> std::string -{ - if (prefix) return "++" + lvalue.print(); - return lvalue.print() + "++"; -} - -auto expr_decrement::print() const -> std::string -{ - if (prefix) return "--" + lvalue.print(); - return lvalue.print() + "--"; -} - -auto expr_assign_equal::print() const -> std::string -{ - return lvalue.print() + " = " + rvalue.print(); -}; - -auto expr_assign_add::print() const -> std::string -{ - return lvalue.print() + " += " + rvalue.print() ; -}; - -auto expr_assign_sub::print() const -> std::string -{ - return lvalue.print() + " -= " + rvalue.print() ; -}; - -auto expr_assign_mul::print() const -> std::string -{ - return lvalue.print() + " *= " + rvalue.print() ; -}; - -auto expr_assign_div::print() const -> std::string -{ - return lvalue.print() + " /= " + rvalue.print() ; -}; - -auto expr_assign_mod::print() const -> std::string -{ - return lvalue.print() + " %= " + rvalue.print() ; -}; - -auto expr_assign_shift_left::print() const -> std::string -{ - return lvalue.print() + " <<= " + rvalue.print() ; -}; - -auto expr_assign_shift_right::print() const -> std::string -{ - return lvalue.print() + " >>= " + rvalue.print() ; -}; - -auto expr_assign_bitwise_or::print() const -> std::string -{ - return lvalue.print() + " |= " + rvalue.print(); -} - -auto expr_assign_bitwise_and::print() const -> std::string -{ - return lvalue.print() + " &= " + rvalue.print(); -} - -auto expr_assign_bitwise_exor::print() const -> std::string -{ - return lvalue.print() + " ^= " + rvalue.print(); -} - -auto stmt_list::print() const -> std::string -{ - if (is_expr) - { - if (list.size() > 0) - { - auto s = list[0].print(); - s.pop_back(); - return s; - } - else return ""; - } - - std::string data; - bool last_special = false; - bool last_devblock = false; - auto block_pad = indented(indent_); - indent_ += 4; - - auto stmts_pad = indented(indent_); - - if (!is_case) - data += block_pad + "{\n"; - - for (const auto& stmt : list) - { - if (((&stmt != &list.front() && stmt.as_node->is_special_stmt()) || last_special) && stmt != kind::stmt_dev && !last_devblock) - data += "\n"; - - if (stmt == kind::stmt_dev) - { - data += stmt.print(); - last_devblock = true; - } - else - { - data += stmts_pad + stmt.print(); - last_devblock = false; - } - - if (&stmt != &list.back()) - data += "\n"; - - if (stmt.as_node->is_special_stmt()) - last_special = true; - else - last_special = false; - } - - indent_ -= 4; - - if (!is_case) - data += "\n" + block_pad + "}"; - - return data; -} - -auto stmt_dev::print() const -> std::string -{ - std::string data; - bool last_special = false; - - auto stmts_pad = indented(indent_); - - data += "/#\n"; - - for (const auto& stmt : list->list) - { - if ((&stmt != &list->list.front() && stmt.as_node->is_special_stmt()) || last_special) - data += "\n"; - - data += stmts_pad + stmt.print(); - - if (&stmt != &list->list.back()) - data += "\n"; - - if (stmt.as_node->is_special_stmt()) - last_special = true; - else - last_special = false; - } - - data += "\n#/"; - - return data; -} - -auto stmt_expr::print() const -> std::string -{ - return expr.print(); -} - -auto stmt_call::print() const -> std::string -{ - return expr.print() + ";"; -}; - -auto stmt_const::print() const -> std::string -{ - return "const "s + lvalue->print() + " = " + rvalue.print() + ";"; -}; - -auto stmt_assign::print() const -> std::string -{ - return expr.print() + ";"; -}; - -auto stmt_endon::print() const -> std::string -{ - return obj.print() + " endon( " + event.print() + " );"; -}; - -auto stmt_notify::print() const -> std::string -{ - if (args->list.size() == 0) - return obj.print() + " notify( " + event.print() + " );"; - else - return obj.print() + " notify( " + event.print() + "," + args->print() + ");"; -}; - -auto stmt_realwait::print() const -> std::string -{ - if (time == kind::expr_float || time == kind::expr_integer) - return "realwait " + time.print() + ";"; - else - return "realwait( " + time.print() + " );"; -}; - -auto stmt_wait::print() const -> std::string -{ - if (time == kind::expr_float || time == kind::expr_integer) - return "wait " + time.print() + ";"; - else - return "wait( " + time.print() + " );"; -}; - -auto stmt_waittill::print() const -> std::string -{ - if (args->list.size() == 0) - return obj.print() + " waittill( " + event.print() + " );"; - else - return obj.print() + " waittill( " + event.print() + "," + args->print() + ");"; -}; - -auto stmt_waittillmatch::print() const -> std::string -{ - if (args->list.size() == 0) - return obj.print() + " waittillmatch( " + event.print() + " );"; - else - return obj.print() + " waittillmatch( " + event.print() + "," + args->print() + ");"; -}; - -auto stmt_waittillframeend::print() const -> std::string -{ - return "waittillframeend;"; -}; - -auto stmt_if::print() const -> std::string -{ - std::string data = "if ( " + test.print() + " )\n"; - - if (stmt == kind::stmt_list) - { - data += stmt.as_list->print(); - } - else - { - indent_ += 4; - data += indented(indent_) + stmt.print(); - indent_ -= 4; - } - - return data; -}; - -auto stmt_ifelse::print() const -> std::string -{ - std::string pad = indented(indent_); - std::string data = "if ( " + test.print() + " )\n"; - - if (stmt_if == kind::stmt_list) - { - data += stmt_if.print(); - } - else - { - indent_ += 4; - data += indented(indent_) + stmt_if.print(); - indent_ -= 4; - } - - data += "\n" + pad + "else"; - - if (stmt_else == kind::stmt_list) - { - data += "\n" + stmt_else.as_list->print(); - } - else - { - if (stmt_else == kind::stmt_if || stmt_else == kind::stmt_ifelse) - { - data += " " + stmt_else.print(); - } - else - { - indent_ += 4; - data += "\n" + indented(indent_) + stmt_else.print(); - indent_ -= 4; - } - } - - return data; -}; - -auto stmt_while::print() const -> std::string -{ - std::string data; - - if (test == kind::null) - { - data += "while ( true )\n"; - } - else - { - data += "while ( " + test.print() + " )\n"; - } - - std::string pad = indented(indent_); - - if (stmt == kind::stmt_list) - { - data += stmt.print(); - } - else - { - indent_ += 4; - data += indented(indent_) + stmt.print(); - indent_ -= 4; - } - - return data; -}; - -auto stmt_dowhile::print() const -> std::string -{ - std::string data; - - data += "do\n"; - - std::string pad = indented(indent_); - - if (stmt == kind::stmt_list) - { - data += stmt.print(); - } - else - { - indent_ += 4; - data += indented(indent_) + stmt.print(); - indent_ -= 4; - } - - if (test == kind::null) - { - data += "\n" + pad + "while ( true );"; - } - else - { - data += "\n" + pad + "while ( " + test.print() + " );"; - } - - return data; -}; - -auto stmt_for::print() const -> std::string -{ - std::string data; - - if (test == kind::null) - { - data += "for (;;)\n"; - } - else - { - data += "for ( " + init.print() + "; " + test.print() + "; " + iter.print() + " )"; - data += "\n"; - } - - if (stmt == kind::stmt_list) - { - data += stmt.print(); - } - else - { - indent_ += 4; - data += indented(indent_) + stmt.print(); - indent_ -= 4; - } - - return data; -}; - -auto stmt_foreach::print() const -> std::string -{ - std::string data; - - data += "foreach ( "; - - if (use_key) data += key_expr.print() + ", "; - - data += value_expr.print() + " in " + array_expr.print() + " )\n"; - - if (stmt == kind::stmt_list) - { - data += stmt.print(); - } - else - { - indent_ += 4; - data += indented(indent_) + stmt.print(); - indent_ -= 4; - } - - return data; -}; - -auto stmt_switch::print() const -> std::string -{ - std::string data; - - data += "switch ( " + test.print() + " )\n"; - data += stmt->print(); - - return data; -}; - -auto stmt_case::print() const -> std::string -{ - if (stmt != nullptr && stmt->list.size() == 0) - return "case " + label.print() + ":"; - else - return "case " + label.print() + ":\n" + stmt->print(); -}; - -auto stmt_default::print() const -> std::string -{ - if (stmt != nullptr && stmt->list.size() == 0) - return "default:"; - else - return "default:\n" + stmt->print(); -}; - -auto stmt_break::print() const -> std::string -{ - return "break;"; -}; - -auto stmt_continue::print() const -> std::string -{ - return "continue;"; -}; - -auto stmt_return::print() const -> std::string -{ - if (expr == kind::null) return "return;"; - - return "return " + expr.print() + ";"; -}; - -auto stmt_breakpoint::print() const -> std::string -{ - return "breakpoint;"; -}; - -auto stmt_prof_begin::print() const -> std::string -{ - return "prof_begin(" + args->print() + ");"; -}; - -auto stmt_prof_end::print() const -> std::string -{ - return "prof_end(" + args->print() + ");"; -}; - -auto decl_thread::print() const -> std::string -{ - std::string data; - - if (static_cast(flags) & static_cast(export_flags::export_autoexec)) - data += "autoexec "; - - if (static_cast(flags) & static_cast(export_flags::export_codecall)) - data += "codecall "; - - if (static_cast(flags) & static_cast(export_flags::export_private2)) - data += "private "; - - data += name->print() + "(" + params->print() + ")" + "\n" + stmt->print() + "\n"; - - return data; -} - -auto decl_usingtree::print() const -> std::string -{ - return "#using_animtree"s + "(" + name->print() + ");\n"; -} - -auto decl_dev_begin::print() const -> std::string -{ - return "/#\n"; -} - -auto decl_dev_end::print() const -> std::string -{ - return "#/\n"; -} - -auto include::print() const -> std::string -{ - return "#include"s + " " + path->print() + ";\n"; -} - -auto program::print() const -> std::string -{ - std::string data; - - for (const auto& include : includes) - { - data += include->print(); - } - - data += "\n"; - - for (const auto& entry : declarations) - { - data += entry.print(); - - if (&entry != &declarations.back()) - data += "\n"; - } - - return data; -} - -auto asm_loc::print() const -> std::string -{ - return value + ":"; -} - -auto asm_jump::print() const -> std::string -{ - return "asm_jump( " + value + " );"; -} - -auto asm_jump_back::print() const -> std::string -{ - return "asm_jump_back( " + value + " );"; -} - -auto asm_jump_cond::print() const -> std::string -{ - return "asm_cond( " + expr.print() + ", " + value + " );"; -} - -auto asm_jump_true_expr::print() const -> std::string -{ - return "asm_expr_true( " + value + " );"; -} - -auto asm_jump_false_expr::print() const -> std::string -{ - return "asm_expr_false( " + value + " );"; -} - -auto asm_switch::print() const -> std::string -{ - return "asm_switch( " + expr.print() + ", " + value + " );"; -} - -auto asm_endswitch::print() const -> std::string -{ - std::string result; - - for (auto& entry : data) - { - result += " " + entry; - } - return "asm_endswitch( " + count + result + " );"; -} - -auto asm_prescriptcall::print() const -> std::string -{ - return "asm_prescriptcall();"; -} - -auto asm_voidcodepos::print() const -> std::string -{ - return "asm_voidcodepos();"; -} - -auto asm_dev::print() const -> std::string -{ - return "devblock( " + value + " );"; -} - -// operators - -bool operator==(const node& n, kind k) -{ - return n.kind_ == k; -} - -bool operator==(const node& lhs, const node& rhs) -{ - return lhs.kind_ == rhs.kind_; -} - -bool operator==(const expr_true&, const expr_true&) -{ - return true; -} - -bool operator==(const expr_false&, const expr_false&) -{ - return true; -} - -bool operator==(const expr_integer& lhs, const expr_integer& rhs) -{ - return lhs.value == rhs.value; -} - -bool operator==(const expr_float& lhs, const expr_float& rhs) -{ - return lhs.value == rhs.value; -} - -bool operator==(const expr_vector& lhs, const expr_vector& rhs) -{ - return lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z; -} - -bool operator==(const expr_hash& lhs, const expr_hash& rhs) -{ - return lhs.value == rhs.value; -} - -bool operator==(const expr_string& lhs, const expr_string& rhs) -{ - return lhs.value == rhs.value; -} - -bool operator==(const expr_istring& lhs, const expr_istring& rhs) -{ - return lhs.value == rhs.value; -} - -bool operator==(const expr_path& lhs, const expr_path& rhs) -{ - return lhs.value == rhs.value; -} - -bool operator==(const expr_identifier& lhs, const expr_identifier& rhs) -{ - return lhs.value == rhs.value; -} - -bool operator==(const expr_animtree&, const expr_animtree&) -{ - return true; -} - -bool operator==(const expr_animation& lhs, const expr_animation& rhs) -{ - return lhs.value == rhs.value; -} - -bool operator==(const expr_level&, const expr_level&) -{ - return true; -} - -bool operator==(const expr_anim&, const expr_anim&) -{ - return true; -} - -bool operator==(const expr_self&, const expr_self&) -{ - return true; -} - -bool operator==(const expr_game&, const expr_game&) -{ - return true; -} - -bool operator==(const expr_undefined&, const expr_undefined&) -{ - return true; -} - -bool operator==(const expr_empty_array&, const expr_empty_array&) -{ - return true; -} - -bool operator==(const expr_paren& lhs, const expr_paren& rhs) -{ - return lhs.child == rhs.child; -} - -bool operator==(const expr_size& lhs, const expr_size& rhs) -{ - return lhs.obj == rhs.obj; -} - -bool operator==(const expr_field& lhs, const expr_field& rhs) -{ - return lhs.obj == rhs.obj && *lhs.field == *rhs.field; -} - -bool operator==(const expr_array& lhs, const expr_array& rhs) -{ - return lhs.obj == rhs.obj && lhs.key == rhs.key; -} - -call::call() : as_node(nullptr) {} - -call::call(std::unique_ptr value) : as_node(std::move(value)) {} - -call::call(call&& value) -{ - new(&as_node) std::unique_ptr(std::move(value.as_node)); -} - -call::~call() -{ - if (as_node == nullptr) return; - - switch (as_node->kind()) - { - case kind::null: as_node.~unique_ptr(); return; - case kind::expr_pointer: as_pointer.~unique_ptr(); return; - case kind::expr_function: as_function.~unique_ptr(); return; - default: return; - } -} - -bool operator==(const call& lhs, kind rhs) -{ - return *lhs.as_node == rhs; -} - -auto call::loc() const -> location -{ - return as_node->loc(); -} - -auto call::kind() const -> ast::kind -{ - return as_node->kind(); -} - -auto call::print() const -> std::string -{ - return as_node->print(); -} - -expr::expr() : as_node(nullptr) {} - -expr::expr(std::unique_ptr value) : as_node(std::move(value)) {} - -expr::expr(expr&& value) -{ - new(&as_node) std::unique_ptr(std::move(value.as_node)); -} - -expr& expr::operator=(expr&& value) -{ - new(&as_node) std::unique_ptr(std::move(value.as_node)); - return *(expr*)&as_node; -} - -expr::~expr() -{ - if (as_node == nullptr) return; - - switch (as_node->kind()) - { - case kind::null: as_node.~unique_ptr(); return; - case kind::expr_true: as_true.~unique_ptr(); return; - case kind::expr_false: as_false.~unique_ptr(); return; - case kind::expr_integer: as_integer.~unique_ptr(); return; - case kind::expr_float: as_float.~unique_ptr(); return; - case kind::expr_vector: as_vector.~unique_ptr(); return; - case kind::expr_hash: as_hash.~unique_ptr(); return; - case kind::expr_string: as_string.~unique_ptr(); return; - case kind::expr_istring: as_istring.~unique_ptr(); return; - case kind::expr_path: as_path.~unique_ptr(); return; - case kind::expr_identifier: as_identifier.~unique_ptr(); return; - case kind::expr_animtree: as_animtree.~unique_ptr(); return; - case kind::expr_animation: as_animation.~unique_ptr(); return; - case kind::expr_level: as_level.~unique_ptr(); return; - case kind::expr_anim: as_anim.~unique_ptr(); return; - case kind::expr_self: as_self.~unique_ptr(); return; - case kind::expr_game: as_game.~unique_ptr(); return; - case kind::expr_undefined: as_undefined.~unique_ptr(); return; - case kind::expr_empty_array: as_empty_array.~unique_ptr(); return; - case kind::expr_paren: as_paren.~unique_ptr(); return; - case kind::expr_size: as_size.~unique_ptr(); return; - case kind::expr_field: as_field.~unique_ptr(); return; - case kind::expr_array: as_array.~unique_ptr(); return; - case kind::expr_reference: as_reference.~unique_ptr(); return; - case kind::expr_getnextarraykey: as_getnextarraykey.~unique_ptr(); return; - case kind::expr_getfirstarraykey: as_getfirstarraykey.~unique_ptr(); return; - case kind::expr_getdvarcoloralpha: as_getdvarcoloralpha.~unique_ptr(); return; - case kind::expr_getdvarcolorblue: as_getdvarcolorblue.~unique_ptr(); return; - case kind::expr_getdvarcolorgreen: as_getdvarcolorgreen.~unique_ptr(); return; - case kind::expr_getdvarcolorred: as_getdvarcolorred.~unique_ptr(); return; - case kind::expr_getdvarvector: as_getdvarvector.~unique_ptr(); return; - case kind::expr_getdvarfloat: as_getdvarfloat.~unique_ptr(); return; - case kind::expr_getdvarint: as_getdvarint.~unique_ptr(); return; - case kind::expr_getdvar: as_getdvar.~unique_ptr(); return; - case kind::expr_gettime: as_gettime.~unique_ptr(); return; - case kind::expr_abs: as_abs.~unique_ptr(); return; - case kind::expr_vectortoangles: as_vectortoangles.~unique_ptr(); return; - case kind::expr_angleclamp180: as_angleclamp180.~unique_ptr(); return; - case kind::expr_anglestoforward: as_anglestoforward.~unique_ptr(); return; - case kind::expr_anglestoright: as_anglestoright.~unique_ptr(); return; - case kind::expr_anglestoup: as_anglestoup.~unique_ptr(); return; - case kind::expr_vectorscale: as_vectorscale.~unique_ptr(); return; - case kind::expr_isdefined: as_isdefined.~unique_ptr(); return; - case kind::expr_arguments: as_arguments.~unique_ptr(); return; - case kind::expr_parameters: as_parameters.~unique_ptr(); return; - case kind::expr_pointer: as_pointer.~unique_ptr(); return; - case kind::expr_function: as_function.~unique_ptr(); return; - case kind::expr_method: as_method.~unique_ptr(); return; - case kind::expr_call: as_call.~unique_ptr(); return; - case kind::expr_complement: as_complement.~unique_ptr(); return; - case kind::expr_negate: as_negate.~unique_ptr(); return; - case kind::expr_not: as_not.~unique_ptr(); return; - case kind::expr_add: as_add.~unique_ptr(); return; - case kind::expr_sub: as_sub.~unique_ptr(); return; - case kind::expr_mul: as_mul.~unique_ptr(); return; - case kind::expr_div: as_div.~unique_ptr(); return; - case kind::expr_mod: as_mod.~unique_ptr(); return; - case kind::expr_shift_left: as_shift_left.~unique_ptr(); return; - case kind::expr_shift_right: as_shift_right.~unique_ptr(); return; - case kind::expr_bitwise_or: as_bitwise_or.~unique_ptr(); return; - case kind::expr_bitwise_and: as_bitwise_and.~unique_ptr(); return; - case kind::expr_bitwise_exor: as_bitwise_exor.~unique_ptr(); return; - case kind::expr_equality: as_equality.~unique_ptr(); return; - case kind::expr_inequality: as_inequality.~unique_ptr(); return; - case kind::expr_less_equal: as_less_equal.~unique_ptr(); return; - case kind::expr_greater_equal: as_greater_equal.~unique_ptr(); return; - case kind::expr_less: as_less.~unique_ptr(); return; - case kind::expr_greater: as_greater.~unique_ptr(); return; - case kind::expr_or: as_or.~unique_ptr(); return; - case kind::expr_and: as_and.~unique_ptr(); return; - case kind::expr_ternary: as_ternary.~unique_ptr(); return; - case kind::expr_increment: as_increment.~unique_ptr(); return; - case kind::expr_decrement: as_decrement.~unique_ptr(); return; - case kind::expr_assign_equal: as_assign_equal.~unique_ptr(); return; - case kind::expr_assign_add: as_assign_add.~unique_ptr(); return; - case kind::expr_assign_sub: as_assign_sub.~unique_ptr(); return; - case kind::expr_assign_mul: as_assign_mul.~unique_ptr(); return; - case kind::expr_assign_div: as_assign_div.~unique_ptr(); return; - case kind::expr_assign_mod: as_assign_mod.~unique_ptr(); return; - case kind::expr_assign_shift_left: as_assign_shift_left.~unique_ptr(); return; - case kind::expr_assign_shift_right: as_assign_shift_right.~unique_ptr(); return; - case kind::expr_assign_bitwise_or: as_assign_bw_or.~unique_ptr(); return; - case kind::expr_assign_bitwise_and: as_assign_bw_and.~unique_ptr(); return; - case kind::expr_assign_bitwise_exor: as_assign_bw_exor.~unique_ptr(); return; - default: return; - } -} - -bool operator!=(const expr& lhs, kind rhs) -{ - return lhs.as_node->kind() != rhs; -} - -bool operator==(const expr& lhs, kind rhs) -{ - return *lhs.as_node == rhs; -} - -bool operator==(const expr& lhs, const expr& rhs) -{ - if (!(*lhs.as_node == *rhs.as_node)) return false; - - switch(lhs.as_node->kind()) - { - case kind::expr_true: return *lhs.as_true == *rhs.as_true; - case kind::expr_false: return *lhs.as_false == *rhs.as_false; - case kind::expr_integer: return *lhs.as_integer == *rhs.as_integer; - case kind::expr_float: return *lhs.as_float == *rhs.as_float; - case kind::expr_vector: return *lhs.as_vector == *rhs.as_vector; - case kind::expr_hash: return *lhs.as_hash == *rhs.as_hash; - case kind::expr_string: return *lhs.as_string == *rhs.as_string; - case kind::expr_istring: return *lhs.as_istring == *rhs.as_istring; - case kind::expr_path: return *lhs.as_path == *rhs.as_path; - case kind::expr_identifier: return *lhs.as_identifier == *rhs.as_identifier; - case kind::expr_animtree: return *lhs.as_animtree == *rhs.as_animtree; - case kind::expr_animation: return *lhs.as_animation == *rhs.as_animation; - case kind::expr_level: return *lhs.as_level == *rhs.as_level; - case kind::expr_anim: return *lhs.as_anim == *rhs.as_anim; - case kind::expr_self: return *lhs.as_self == *rhs.as_self; - case kind::expr_game: return *lhs.as_game == *rhs.as_game; - case kind::expr_undefined: return *lhs.as_undefined == *rhs.as_undefined; - case kind::expr_empty_array: return *lhs.as_empty_array == *rhs.as_empty_array; - case kind::expr_paren: return *lhs.as_paren == *rhs.as_paren; - case kind::expr_size: return *lhs.as_size == *rhs.as_size; - case kind::expr_field: return *lhs.as_field == *rhs.as_field; - case kind::expr_array: return *lhs.as_array == *rhs.as_array; - default: return false; - } -} - -auto expr::loc() const -> location -{ - return as_node->loc(); -} - -auto expr::kind() const -> ast::kind -{ - return as_node->kind(); -} - -auto expr::print() const -> std::string -{ - return as_node->print(); -} - -stmt::stmt() : as_node(nullptr) {} - -stmt::stmt(std::unique_ptr value) : as_node(std::move(value)) {} - -stmt::stmt(stmt&& value) -{ - new(&as_node) std::unique_ptr(std::move(value.as_node)); -} - -stmt& stmt::operator=(stmt&& value) -{ - new(&as_node) std::unique_ptr(std::move(value.as_node)); - return *(stmt*)&as_node; -} - -stmt::~stmt() -{ - if (as_node == nullptr) return; - - switch (as_node->kind()) - { - case kind::null: as_node.~unique_ptr(); return; - case kind::stmt_list: as_list.~unique_ptr(); return; - case kind::stmt_dev: as_dev.~unique_ptr(); return; - case kind::stmt_expr: as_expr.~unique_ptr(); return; - case kind::stmt_call: as_call.~unique_ptr(); return; - case kind::stmt_const: as_const.~unique_ptr(); return; - case kind::stmt_assign: as_assign.~unique_ptr(); return; - case kind::stmt_endon: as_endon.~unique_ptr(); return; - case kind::stmt_notify: as_notify.~unique_ptr(); return; - case kind::stmt_realwait: as_realwait.~unique_ptr(); return; - case kind::stmt_wait: as_wait.~unique_ptr(); return; - case kind::stmt_waittill: as_waittill.~unique_ptr(); return; - case kind::stmt_waittillmatch: as_waittillmatch.~unique_ptr(); return; - case kind::stmt_waittillframeend: as_waittillframeend.~unique_ptr(); return; - case kind::stmt_if: as_if.~unique_ptr(); return; - case kind::stmt_ifelse: as_ifelse.~unique_ptr(); return; - case kind::stmt_while: as_while.~unique_ptr(); return; - case kind::stmt_dowhile: as_dowhile.~unique_ptr(); return; - case kind::stmt_for: as_for.~unique_ptr(); return; - case kind::stmt_foreach: as_foreach.~unique_ptr(); return; - case kind::stmt_switch: as_switch.~unique_ptr(); return; - case kind::stmt_case: as_case.~unique_ptr(); return; - case kind::stmt_default: as_default.~unique_ptr(); return; - case kind::stmt_break: as_break.~unique_ptr(); return; - case kind::stmt_continue: as_continue.~unique_ptr(); return; - case kind::stmt_return: as_return.~unique_ptr(); return; - case kind::stmt_breakpoint: as_breakpoint.~unique_ptr(); return; - case kind::stmt_prof_begin: as_prof_begin.~unique_ptr(); return; - case kind::stmt_prof_end: as_prof_end.~unique_ptr(); return; - case kind::asm_loc: as_loc.~unique_ptr(); return; - case kind::asm_jump: as_jump.~unique_ptr(); return; - case kind::asm_jump_back: as_jump_back.~unique_ptr(); return; - case kind::asm_jump_cond: as_cond.~unique_ptr(); return; - case kind::asm_jump_true_expr: as_jump_true_expr.~unique_ptr(); return; - case kind::asm_jump_false_expr: as_jump_false_expr.~unique_ptr(); return; - case kind::asm_switch: as_asm_switch.~unique_ptr(); return; - case kind::asm_endswitch: as_asm_endswitch.~unique_ptr(); return; - case kind::asm_prescriptcall: as_asm_prescriptcall.~unique_ptr(); return; - case kind::asm_voidcodepos: as_asm_voidcodepos.~unique_ptr(); return; - case kind::asm_dev: as_asm_dev.~unique_ptr(); return; - default: return; - } -} - -bool operator==(const stmt& lhs, kind rhs) -{ - return *lhs.as_node == rhs; -} - -auto stmt::loc() const -> location -{ - return as_node->loc(); -} - -auto stmt::kind() const -> ast::kind -{ - return as_node->kind(); -} - -auto stmt::print() const -> std::string -{ - return as_node->print(); -} - -decl::decl() : as_node(nullptr) {} - -decl::decl(std::unique_ptr value) : as_node(std::move(value)) {} - -decl::decl(decl&& value) -{ - new(&as_node) std::unique_ptr(std::move(value.as_node)); -} - -decl& decl::operator=(decl&& value) -{ - new(&as_node) std::unique_ptr(std::move(value.as_node)); - return *(decl*)&as_node; -} - -decl::~decl() -{ - if (as_node == nullptr) return; - - switch (as_node->kind()) - { - case kind::null: as_node.~unique_ptr(); return; - case kind::decl_dev_begin: as_dev_begin.~unique_ptr(); return; - case kind::decl_dev_end: as_dev_end.~unique_ptr(); return; - case kind::decl_thread: as_thread.~unique_ptr(); return; - case kind::decl_usingtree: as_usingtree.~unique_ptr(); return; - default: return; - } -} - -bool operator==(const decl& lhs, kind rhs) -{ - return *lhs.as_node == rhs; -} - -auto decl::loc() const -> location -{ - return as_node->loc(); -} - -auto decl::kind() const -> ast::kind -{ - return as_node->kind(); -} - -auto decl::print() const -> std::string -{ - return as_node->print(); -} - -} // namespace xsk::arc::ast diff --git a/src/t6/compiler.cpp b/src/t6/compiler.cpp deleted file mode 100644 index 726ddc50..00000000 --- a/src/t6/compiler.cpp +++ /dev/null @@ -1,2496 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#include "xsk/stdinc.hpp" -#include "xsk/t6/t6.hpp" -#include "xsk/t6/parser.hpp" -#include "xsk/t6/lexer.hpp" - -namespace xsk::arc::t6 -{ - -auto compiler::output() -> assembly::ptr -{ - return std::move(assembly_); -} - -auto compiler::output_raw() -> std::vector -{ - output_ = std::make_unique(); - - output_->write_string("// T6 GSC ASSEMBLY\n"); - output_->write_string("// Compiled by https://github.com/xensik/gsc-tool\n"); - - for (const auto& func : assembly_->functions) - { - this->print_function(func); - } - - std::vector output; - - output.resize(output_->pos()); - std::memcpy(output.data(), output_->data(), output.size()); - - return output; -} - -void compiler::compile(const std::string& file, std::vector& data) -{ - filename_ = file; - - auto prog = parse_buffer(filename_, reinterpret_cast(data.data()), data.size()); - - compile_program(prog); -} - -void compiler::mode(build mode) -{ - mode_ = mode; -} - -auto compiler::parse_buffer(const std::string& file, const char* data, size_t size) -> ast::program::ptr -{ - ast::program::ptr result(nullptr); - - lexer lexer(mode_, file, data, size); - - parser parser(lexer, result); - - if (parser.parse() || result == nullptr) - { - throw comp_error(location(&file), "An unknown error ocurred while parsing gsc file."); - } - - return result; -} - -auto compiler::parse_file(const std::string& file) -> ast::program::ptr -{ - auto data = resolver::file_data(file); - - return parse_buffer(file, std::get<1>(data), std::get<2>(data)); -} - -void compiler::compile_program(const ast::program::ptr& program) -{ - assembly_ = std::make_unique(); - includes_.clear(); - animtrees_.clear(); - local_functions_.clear(); - index_ = 0; - developer_thread_ = false; - - for (const auto& entry : program->declarations) - { - if (entry == ast::kind::decl_thread) - { - local_functions_.push_back(entry.as_thread->name->value); - } - } - - for (const auto& include : program->includes) - { - emit_include(include); - } - - for (const auto& declaration : program->declarations) - { - emit_declaration(declaration); - } - - std::reverse(assembly_->includes.begin(), assembly_->includes.end()); -} - -void compiler::emit_include(const ast::include::ptr& include) -{ - const auto& path = include->path->value; - - for (const auto& entry : assembly_->includes) - { - if (entry == path) - { - throw comp_error(include->loc(), "duplicated include file '" + path + "'."); - } - } - - assembly_->includes.push_back(path); -} - -void compiler::emit_declaration(const ast::decl& decl) -{ - switch (decl.kind()) - { - case ast::kind::decl_dev_begin: - developer_thread_ = true; - break; - case ast::kind::decl_dev_end: - developer_thread_ = false; - break; - case ast::kind::decl_usingtree: - emit_decl_usingtree(decl.as_usingtree); - break; - case ast::kind::decl_thread: - emit_decl_thread(decl.as_thread); - break; - default: - throw comp_error(decl.loc(), "unknown declaration"); - } -} - -void compiler::emit_decl_usingtree(const ast::decl_usingtree::ptr& animtree) -{ - if (developer_thread_) - { - throw comp_error(animtree->loc(), "cannot put #using_animtree inside developer block comment"); - } - - animtrees_.push_back({ animtree->name->value, false }); -} - -void compiler::emit_decl_thread(const ast::decl_thread::ptr& thread) -{ - function_ = std::make_unique(); - function_->index = index_; - function_->name = thread->name->value; - function_->params = static_cast(thread->params->list.size()); - function_->flags = static_cast(thread->flags); - - stack_idx_ = 0; - label_idx_ = 0; - can_break_ = false; - can_continue_ = false; - local_stack_.clear(); - constants_.clear(); - blocks_.clear(); - - process_thread(thread); - - blocks_.push_back(block()); - - emit_expr_parameters(thread->params); - emit_stmt_list(thread->stmt); - - if (blocks_.back().abort == abort_t::abort_none) - emit_opcode(opcode::OP_End); - - blocks_.pop_back(); - - function_->size = index_ - function_->index; - assembly_->functions.push_back(std::move(function_)); -} - -void compiler::emit_stmt(const ast::stmt& stmt) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - emit_stmt_list(stmt.as_list); - break; - case ast::kind::stmt_dev: - emit_stmt_dev(stmt.as_dev); - break; - case ast::kind::stmt_expr: - emit_stmt_expr(stmt.as_expr); - break; - case ast::kind::stmt_call: - emit_stmt_call(stmt.as_call); - break; - case ast::kind::stmt_const: - emit_stmt_const(stmt.as_const); - break; - case ast::kind::stmt_assign: - emit_stmt_assign(stmt.as_assign); - break; - case ast::kind::stmt_endon: - emit_stmt_endon(stmt.as_endon); - break; - case ast::kind::stmt_notify: - emit_stmt_notify(stmt.as_notify); - break; - case ast::kind::stmt_wait: - emit_stmt_wait(stmt.as_wait); - break; - case ast::kind::stmt_waittill: - emit_stmt_waittill(stmt.as_waittill); - break; - case ast::kind::stmt_waittillmatch: - emit_stmt_waittillmatch(stmt.as_waittillmatch); - break; - case ast::kind::stmt_waittillframeend: - emit_stmt_waittillframeend(stmt.as_waittillframeend); - break; - case ast::kind::stmt_if: - emit_stmt_if(stmt.as_if); - break; - case ast::kind::stmt_ifelse: - emit_stmt_ifelse(stmt.as_ifelse); - break; - case ast::kind::stmt_while: - emit_stmt_while(stmt.as_while); - break; - case ast::kind::stmt_dowhile: - emit_stmt_dowhile(stmt.as_dowhile); - break; - case ast::kind::stmt_for: - emit_stmt_for(stmt.as_for); - break; - case ast::kind::stmt_foreach: - emit_stmt_foreach(stmt.as_foreach); - break; - case ast::kind::stmt_switch: - emit_stmt_switch(stmt.as_switch); - break; - case ast::kind::stmt_case: - emit_stmt_case(stmt.as_case);; - break; - case ast::kind::stmt_default: - emit_stmt_default(stmt.as_default); - break; - case ast::kind::stmt_break: - emit_stmt_break(stmt.as_break); - break; - case ast::kind::stmt_continue: - emit_stmt_continue(stmt.as_continue); - break; - case ast::kind::stmt_return: - emit_stmt_return(stmt.as_return); - break; - case ast::kind::stmt_prof_begin: - emit_stmt_prof_begin(stmt.as_prof_begin); - break; - case ast::kind::stmt_prof_end: - emit_stmt_prof_end(stmt.as_prof_end); - break; - default: - throw comp_error(stmt.loc(), "unknown statement"); - } -} - -void compiler::emit_stmt_list(const ast::stmt_list::ptr& stmt) -{ - for (const auto& entry : stmt->list) - { - emit_stmt(entry); - } -} - -void compiler::emit_stmt_dev(const ast::stmt_dev::ptr& stmt) -{ - developer_thread_ = true; - - auto end = create_label(); - emit_opcode(opcode::OP_DevblockBegin, end); - emit_stmt_list(stmt->list); - insert_label(end); - - developer_thread_ = false; -} - -void compiler::emit_stmt_expr(const ast::stmt_expr::ptr& stmt) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, true); - break; - case ast::kind::expr_assign_equal: - case ast::kind::expr_assign_add: - case ast::kind::expr_assign_sub: - case ast::kind::expr_assign_mul: - case ast::kind::expr_assign_div: - case ast::kind::expr_assign_mod: - case ast::kind::expr_assign_shift_left: - case ast::kind::expr_assign_shift_right: - case ast::kind::expr_assign_bitwise_or: - case ast::kind::expr_assign_bitwise_and: - case ast::kind::expr_assign_bitwise_exor: - emit_expr_assign(stmt->expr.as_assign); - break; - case ast::kind::null: - break; - default: - throw comp_error(stmt->loc(), "unknown expr statement expression"); - } -} - -void compiler::emit_stmt_call(const ast::stmt_call::ptr& stmt) -{ - if (stmt->expr == ast::kind::expr_call) - emit_expr_call(stmt->expr.as_call, true); - else if (stmt->expr == ast::kind::expr_method) - emit_expr_method(stmt->expr.as_method, true); - else - throw comp_error(stmt->loc(), "unknown call statement expression"); -} - -void compiler::emit_stmt_const(const ast::stmt_const::ptr& stmt) -{ - const auto itr = constants_.find(stmt->lvalue->value); - - if (itr != constants_.end()) - throw comp_error(stmt->loc(), "duplicated constant '" + stmt->lvalue->value + "'"); - - if (std::find(local_stack_.begin(), local_stack_.end(), stmt->lvalue->value) != local_stack_.end()) - throw comp_error(stmt->loc(), "constant already defined as local variable '" + stmt->lvalue->value + "'"); - - constants_.insert({ stmt->lvalue->value, std::move(stmt->rvalue) }); -} - -void compiler::emit_stmt_assign(const ast::stmt_assign::ptr& stmt) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - emit_expr_increment(stmt->expr.as_increment, true); - break; - case ast::kind::expr_decrement: - emit_expr_decrement(stmt->expr.as_decrement, true); - break; - case ast::kind::expr_assign_equal: - case ast::kind::expr_assign_add: - case ast::kind::expr_assign_sub: - case ast::kind::expr_assign_mul: - case ast::kind::expr_assign_div: - case ast::kind::expr_assign_mod: - case ast::kind::expr_assign_shift_left: - case ast::kind::expr_assign_shift_right: - case ast::kind::expr_assign_bitwise_or: - case ast::kind::expr_assign_bitwise_and: - case ast::kind::expr_assign_bitwise_exor: - emit_expr_assign(stmt->expr.as_assign); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::emit_stmt_endon(const ast::stmt_endon::ptr& stmt) -{ - emit_expr(stmt->event); - emit_expr(stmt->obj); - emit_opcode(opcode::OP_EndOn); -} - -void compiler::emit_stmt_notify(const ast::stmt_notify::ptr& stmt) -{ - emit_opcode(opcode::OP_VoidCodePos); - - std::reverse(stmt->args->list.begin(), stmt->args->list.end()); - - for (const auto& arg : stmt->args->list) - { - emit_expr(arg); - } - - emit_expr(stmt->event); - emit_expr(stmt->obj); - emit_opcode(opcode::OP_Notify); -} - -void compiler::emit_stmt_wait(const ast::stmt_wait::ptr& stmt) -{ - emit_expr(stmt->time); - emit_opcode(opcode::OP_Wait); -} - -void compiler::emit_stmt_waittill(const ast::stmt_waittill::ptr& stmt) -{ - emit_expr(stmt->event); - emit_expr(stmt->obj); - emit_opcode(opcode::OP_WaitTill); - - for (const auto& entry : stmt->args->list) - { - emit_opcode(opcode::OP_SafeSetWaittillVariableFieldCached, variable_access(entry.as_identifier)); - } - - emit_opcode(opcode::OP_ClearParams); -} - -void compiler::emit_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt) -{ - emit_expr_arguments(stmt->args); - emit_expr(stmt->event); - emit_expr(stmt->obj); - emit_opcode(opcode::OP_WaitTillMatch, utils::string::va("%d", stmt->args->list.size())); - emit_opcode(opcode::OP_ClearParams); -} - -void compiler::emit_stmt_waittillframeend(const ast::stmt_waittillframeend::ptr&) -{ - emit_opcode(opcode::OP_WaitTillFrameEnd); -} - -void compiler::emit_stmt_if(const ast::stmt_if::ptr& stmt) -{ - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue); - emit_opcode(opcode::OP_JumpOnTrue, end_loc); - } - else - { - emit_expr(stmt->test); - emit_opcode(opcode::OP_JumpOnFalse, end_loc); - } - - auto& paren = blocks_.back(); - blocks_.push_back(block(paren.loc_break, paren.loc_continue)); - - emit_stmt(stmt->stmt); - - blocks_.pop_back(); - - insert_label(end_loc); -} - -void compiler::emit_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt) -{ - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(stmt->test); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - auto& paren = blocks_.back(); - blocks_.push_back(block(paren.loc_break, paren.loc_continue)); - emit_stmt(stmt->stmt_if); - blocks_.pop_back(); - - emit_opcode(opcode::OP_Jump, end_loc); - - insert_label(else_loc); - - auto& root = blocks_.back(); - blocks_.push_back(block(root.loc_break, root.loc_continue)); - emit_stmt(stmt->stmt_else); - blocks_.pop_back(); - - insert_label(end_loc); -} - -void compiler::emit_stmt_while(const ast::stmt_while::ptr& stmt) -{ - auto old_break = can_break_; - auto old_continue = can_continue_; - - can_break_ = true; - can_continue_ = true; - auto break_loc = create_label(); - auto continue_loc = insert_label(); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue); - emit_opcode(opcode::OP_JumpOnTrue, break_loc); - } - else - { - emit_expr(stmt->test); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - - blocks_.push_back(block(break_loc, continue_loc)); - emit_stmt(stmt->stmt); - blocks_.pop_back(); - - emit_opcode(opcode::OP_Jump, continue_loc); - insert_label(break_loc); - - can_break_ = old_break; - can_continue_ = old_continue; -} - -void compiler::emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt) -{ - auto old_break = can_break_; - auto old_continue = can_continue_; - - can_break_ = true; - can_continue_ = true; - auto break_loc = create_label(); - auto continue_loc = create_label(); - - auto begin_loc = insert_label(); - - blocks_.push_back(block(break_loc, continue_loc)); - emit_stmt(stmt->stmt); - blocks_.pop_back(); - - insert_label(continue_loc); - - if (stmt->test == ast::kind::expr_not) - { - emit_expr(stmt->test.as_not->rvalue); - emit_opcode(opcode::OP_JumpOnFalse, begin_loc); - } - else - { - emit_expr(stmt->test); - emit_opcode(opcode::OP_JumpOnTrue, begin_loc); - } - - insert_label(break_loc); - - can_break_ = old_break; - can_continue_ = old_continue; -} - -void compiler::emit_stmt_for(const ast::stmt_for::ptr& stmt) -{ - auto old_break = can_break_; - auto old_continue = can_continue_; - - emit_stmt(stmt->init); - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - auto begin_loc = insert_label(); - - bool const_cond = is_constant_condition(stmt->test); - - if (!const_cond) - { - emit_expr(stmt->test); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - } - - can_break_ = true; - can_continue_ = true; - - blocks_.push_back(block(break_loc, continue_loc)); - emit_stmt(stmt->stmt); - blocks_.pop_back(); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - emit_stmt(stmt->iter); - emit_opcode(opcode::OP_Jump, begin_loc); - insert_label(break_loc); - - can_break_ = old_break; - can_continue_ = old_continue; -} - -void compiler::emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt) -{ - auto old_break = can_break_; - auto old_continue = can_continue_; - - emit_expr(stmt->array_expr); - emit_expr_variable_ref(stmt->array, true); - emit_expr_variable(stmt->array); - emit_opcode(opcode::OP_FirstArrayKey); - emit_expr_variable_ref(stmt->key_expr, true); - - auto break_loc = create_label(); - auto continue_loc = create_label(); - - auto begin_loc = insert_label(); - - emit_expr_variable(stmt->key_expr); - emit_opcode(opcode::OP_IsDefined); - emit_opcode(opcode::OP_JumpOnFalse, break_loc); - - can_break_ = true; - can_continue_ = true; - - emit_expr_variable(stmt->key_expr); - emit_opcode(opcode::OP_EvalLocalVariableCached, variable_access(stmt->array.as_identifier)); - emit_opcode(opcode::OP_EvalArray); - emit_expr_variable_ref(stmt->value_expr, true); - - blocks_.push_back(block(break_loc, continue_loc)); - emit_stmt(stmt->stmt); - blocks_.pop_back(); - - can_break_ = false; - can_continue_ = false; - - insert_label(continue_loc); - - emit_expr_variable(stmt->key_expr); - emit_expr_variable(stmt->array); - emit_opcode(opcode::OP_NextArrayKey); - emit_expr_variable_ref(stmt->key_expr, true); - emit_opcode(opcode::OP_Jump, begin_loc); - insert_label(break_loc); - - can_break_ = old_break; - can_continue_ = old_continue; -} - -void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt) -{ - auto old_break = can_break_; - - can_break_ = false; - - auto jmptable_loc = create_label(); - - auto break_loc = create_label(); - - emit_expr(stmt->test); - emit_opcode(opcode::OP_Switch, jmptable_loc); - - can_break_ = true; - - blocks_.push_back(block(break_loc, blocks_.back().loc_continue)); - - std::vector data; - data.push_back(utils::string::va("%d", stmt->stmt->list.size())); - - bool numerical = false; - bool has_default = false; - - for (auto i = 0u; i < stmt->stmt->list.size(); i++) - { - auto& entry = stmt->stmt->list[i]; - - if (entry == ast::kind::stmt_case) - { - if (has_default) - { - comp_error(stmt->loc(), "default must be last case"); - } - - auto& case_ = entry.as_case; - if (case_->label == ast::kind::expr_integer) - { - numerical = true; - auto loc = insert_label(); - data.push_back("case"); - data.push_back(case_->label.as_integer->value); - data.push_back(loc); - } - else if (case_->label == ast::kind::expr_string) - { - auto loc = insert_label(); - data.push_back("case"); - data.push_back(case_->label.as_string->value); - data.push_back(loc); - } - else - { - throw comp_error(stmt->loc(), "case type must be int or string"); - } - - auto& paren = blocks_.back(); - blocks_.push_back(block(paren.loc_break, paren.loc_continue)); - emit_stmt_list(case_->stmt); - blocks_.pop_back(); - } - else if (entry == ast::kind::stmt_default) - { - auto loc = insert_label(); - data.push_back("default"); - data.push_back(loc); - has_default = true; - - auto& paren = blocks_.back(); - blocks_.push_back(block(paren.loc_break, paren.loc_continue)); - emit_stmt_list(entry.as_default->stmt); - blocks_.pop_back(); - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - - blocks_.pop_back(); - data.push_back(numerical ? "i" : "s"); - - insert_label(jmptable_loc); - emit_opcode(opcode::OP_EndSwitch, data); - insert_label(break_loc); - - can_break_ = old_break; -} - -void compiler::emit_stmt_case(const ast::stmt_case::ptr& stmt) -{ - throw comp_error(stmt->loc(), "illegal case statement"); -} - -void compiler::emit_stmt_default(const ast::stmt_default::ptr& stmt) -{ - throw comp_error(stmt->loc(), "illegal default statement"); -} - -void compiler::emit_stmt_break(const ast::stmt_break::ptr& stmt) -{ - if (!can_break_ || blocks_.back().abort != abort_t::abort_none || blocks_.back().loc_break == "") - throw comp_error(stmt->loc(), "illegal break statement"); - - blocks_.back().abort = abort_t::abort_break; - emit_opcode(opcode::OP_Jump, blocks_.back().loc_break); -} - -void compiler::emit_stmt_continue(const ast::stmt_continue::ptr& stmt) -{ - if (!can_continue_ || blocks_.back().abort != abort_t::abort_none || blocks_.back().loc_continue == "") - throw comp_error(stmt->loc(), "illegal continue statement"); - - blocks_.back().abort = abort_t::abort_continue; - emit_opcode(opcode::OP_Jump, blocks_.back().loc_continue); -} - -void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt) -{ - if (blocks_.back().abort == abort_t::abort_none) - blocks_.back().abort = abort_t::abort_return; - - if (stmt->expr != ast::kind::null) - { - emit_expr(stmt->expr); - emit_opcode(opcode::OP_Return); - } - else - emit_opcode(opcode::OP_End); -} - -void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr&) -{ - // TODO: -} - -void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr&) -{ - // TODO: -} - -void compiler::emit_expr(const ast::expr& expr) -{ - switch (expr.kind()) - { - case ast::kind::expr_paren: - emit_expr(expr.as_paren->child); - break; - case ast::kind::expr_ternary: - emit_expr_ternary(expr.as_ternary); - break; - case ast::kind::expr_and: - emit_expr_and(expr.as_and); - break; - case ast::kind::expr_or: - emit_expr_or(expr.as_or); - break; - case ast::kind::expr_equality: - case ast::kind::expr_inequality: - case ast::kind::expr_less: - case ast::kind::expr_greater: - case ast::kind::expr_less_equal: - case ast::kind::expr_greater_equal: - case ast::kind::expr_bitwise_or: - case ast::kind::expr_bitwise_and: - case ast::kind::expr_bitwise_exor: - case ast::kind::expr_shift_left: - case ast::kind::expr_shift_right: - case ast::kind::expr_add: - case ast::kind::expr_sub: - case ast::kind::expr_mul: - case ast::kind::expr_div: - case ast::kind::expr_mod: - emit_expr_binary(expr.as_binary); - break; - case ast::kind::expr_complement: - emit_expr_complement(expr.as_complement); - break; - case ast::kind::expr_negate: - emit_expr_negate(expr.as_negate); - break; - case ast::kind::expr_not: - emit_expr_not(expr.as_not); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, false); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, false); - break; - case ast::kind::expr_isdefined: - emit_expr_isdefined(expr.as_isdefined); - break; - case ast::kind::expr_vectorscale: - emit_expr_vectorscale(expr.as_vectorscale); - break; - case ast::kind::expr_anglestoup: - emit_expr_anglestoup(expr.as_anglestoup); - break; - case ast::kind::expr_anglestoright: - emit_expr_anglestoright(expr.as_anglestoright); - break; - case ast::kind::expr_anglestoforward: - emit_expr_anglestoforward(expr.as_anglestoforward); - break; - case ast::kind::expr_angleclamp180: - emit_expr_angleclamp180(expr.as_angleclamp180); - break; - case ast::kind::expr_vectortoangles: - emit_expr_vectortoangles(expr.as_vectortoangles); - break; - case ast::kind::expr_abs: - emit_expr_abs(expr.as_abs); - break; - case ast::kind::expr_gettime: - emit_expr_gettime(expr.as_gettime); - break; - case ast::kind::expr_getdvar: - emit_expr_getdvar(expr.as_getdvar); - break; - case ast::kind::expr_getdvarint: - emit_expr_getdvarint(expr.as_getdvarint); - break; - case ast::kind::expr_getdvarfloat: - emit_expr_getdvarfloat(expr.as_getdvarfloat); - break; - case ast::kind::expr_getdvarvector: - emit_expr_getdvarvector(expr.as_getdvarvector); - break; - case ast::kind::expr_getdvarcolorred: - emit_expr_getdvarcolorred(expr.as_getdvarcolorred); - break; - case ast::kind::expr_getdvarcolorgreen: - emit_expr_getdvarcolorgreen(expr.as_getdvarcolorgreen); - break; - case ast::kind::expr_getdvarcolorblue: - emit_expr_getdvarcolorblue(expr.as_getdvarcolorblue); - break; - case ast::kind::expr_getdvarcoloralpha: - emit_expr_getdvarcoloralpha(expr.as_getdvarcoloralpha); - break; - case ast::kind::expr_getfirstarraykey: - emit_expr_getfirstarraykey(expr.as_getfirstarraykey); - break; - case ast::kind::expr_getnextarraykey: - emit_expr_getnextarraykey(expr.as_getnextarraykey); - break; - case ast::kind::expr_reference: - emit_expr_reference(expr.as_reference); - break; - case ast::kind::expr_array: - emit_expr_array(expr.as_array); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field); - break; - case ast::kind::expr_size: - emit_expr_size(expr.as_size); - break; - case ast::kind::expr_empty_array: - emit_opcode(opcode::OP_EmptyArray); - break; - case ast::kind::expr_undefined: - emit_opcode(opcode::OP_GetUndefined); - break; - case ast::kind::expr_game: - emit_opcode(opcode::OP_GetGame); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_GetSelf); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_GetAnim); - break; - case ast::kind::expr_level: - emit_opcode(opcode::OP_GetLevel); - break; - case ast::kind::expr_animation: - emit_expr_animation(expr.as_animation); - break; - case ast::kind::expr_animtree: - emit_expr_animtree(expr.as_animtree); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier); - break; - case ast::kind::expr_istring: - emit_expr_istring(expr.as_istring); - break; - case ast::kind::expr_string: - emit_expr_string(expr.as_string); - break; - case ast::kind::expr_vector: - emit_expr_vector(expr.as_vector); - break; - case ast::kind::expr_hash: - emit_expr_hash(expr.as_hash); - break; - case ast::kind::expr_float: - emit_expr_float(expr.as_float); - break; - case ast::kind::expr_integer: - emit_expr_integer(expr.as_integer); - break; - case ast::kind::expr_false: - emit_expr_false(expr.as_false); - break; - case ast::kind::expr_true: - emit_expr_true(expr.as_true); - break; - case ast::kind::null: - break; - default: - throw comp_error(expr.loc(), "unknown expression"); - } -} - -void compiler::emit_expr_assign(const ast::expr_assign::ptr& expr) -{ - if (expr->kind() == ast::kind::expr_assign_equal) - { - if (expr->rvalue == ast::kind::expr_undefined) - { - emit_expr_clear(expr->lvalue); - return; - } - - emit_expr(expr->rvalue); - emit_expr_variable_ref(expr->lvalue, true); - return; - } - - emit_expr(expr->lvalue); - emit_expr(expr->rvalue); - - switch (expr->kind()) - { - case ast::kind::expr_assign_add: - emit_opcode(opcode::OP_Plus); - break; - case ast::kind::expr_assign_sub: - emit_opcode(opcode::OP_Minus); - break; - case ast::kind::expr_assign_mul: - emit_opcode(opcode::OP_Multiply); - break; - case ast::kind::expr_assign_div: - emit_opcode(opcode::OP_Divide); - break; - case ast::kind::expr_assign_mod: - emit_opcode(opcode::OP_Modulus); - break; - case ast::kind::expr_assign_shift_left: - emit_opcode(opcode::OP_ShiftLeft); - break; - case ast::kind::expr_assign_shift_right: - emit_opcode(opcode::OP_ShiftRight); - break; - case ast::kind::expr_assign_bitwise_or: - emit_opcode(opcode::OP_Bit_Or); - break; - case ast::kind::expr_assign_bitwise_and: - emit_opcode(opcode::OP_Bit_And); - break; - case ast::kind::expr_assign_bitwise_exor: - emit_opcode(opcode::OP_Bit_Xor); - break; - default: - throw comp_error(expr->loc(), "unknown assign operation"); - } - - emit_expr_variable_ref(expr->lvalue, true); -} - -void compiler::emit_expr_clear(const ast::expr& expr) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr(expr.as_array->key); - expr.as_array->obj == ast::kind::expr_game ? emit_opcode(opcode::OP_GetGameRef) : emit_expr_variable_ref(expr.as_array->obj, false); - emit_opcode(opcode::OP_ClearArray); - break; - case ast::kind::expr_field: - emit_expr_object(expr.as_field->obj); - emit_opcode(opcode::OP_ClearFieldVariable, expr.as_field->field->value); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_GetUndefined); - emit_expr_local_ref(expr.as_identifier, true); - break; - default: - throw comp_error(expr.loc(), "unknown clear variable lvalue"); - } -} - -void compiler::emit_expr_increment(const ast::expr_increment::ptr& expr, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, false); - emit_opcode(opcode::OP_Inc); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_decrement(const ast::expr_decrement::ptr& expr, bool is_stmt) -{ - if (is_stmt) - { - emit_expr_variable_ref(expr->lvalue, false); - emit_opcode(opcode::OP_Dec); - } - else - { - // TODO: - } -} - -void compiler::emit_expr_ternary(const ast::expr_ternary::ptr& expr) -{ - auto else_loc = create_label(); - auto end_loc = create_label(); - - if (expr->test == ast::kind::expr_not) - { - emit_expr(expr->test.as_not->rvalue); - emit_opcode(opcode::OP_JumpOnTrue, else_loc); - } - else - { - emit_expr(expr->test); - emit_opcode(opcode::OP_JumpOnFalse, else_loc); - } - - emit_expr(expr->true_expr); - emit_opcode(opcode::OP_Jump, end_loc); - - insert_label(else_loc); - emit_expr(expr->false_expr); - insert_label(end_loc); -} - -void compiler::emit_expr_binary(const ast::expr_binary::ptr& expr) -{ - emit_expr(expr->lvalue); - emit_expr(expr->rvalue); - - switch (expr->kind()) - { - case ast::kind::expr_equality: - emit_opcode(opcode::OP_Equal); - break; - case ast::kind::expr_inequality: - emit_opcode(opcode::OP_NotEqual); - break; - case ast::kind::expr_less: - emit_opcode(opcode::OP_LessThan); - break; - case ast::kind::expr_greater: - emit_opcode(opcode::OP_GreaterThan); - break; - case ast::kind::expr_less_equal: - emit_opcode(opcode::OP_LessThanOrEqualTo); - break; - case ast::kind::expr_greater_equal: - emit_opcode(opcode::OP_GreaterThanOrEqualTo); - break; - case ast::kind::expr_bitwise_or: - emit_opcode(opcode::OP_Bit_Or); - break; - case ast::kind::expr_bitwise_and: - emit_opcode(opcode::OP_Bit_And); - break; - case ast::kind::expr_bitwise_exor: - emit_opcode(opcode::OP_Bit_Xor); - break; - case ast::kind::expr_shift_left: - emit_opcode(opcode::OP_ShiftLeft); - break; - case ast::kind::expr_shift_right: - emit_opcode(opcode::OP_ShiftRight); - break; - case ast::kind::expr_add: - emit_opcode(opcode::OP_Plus); - break; - case ast::kind::expr_sub: - emit_opcode(opcode::OP_Minus); - break; - case ast::kind::expr_mul: - emit_opcode(opcode::OP_Multiply); - break; - case ast::kind::expr_div: - emit_opcode(opcode::OP_Divide); - break; - case ast::kind::expr_mod: - emit_opcode(opcode::OP_Modulus); - break; - default: - throw comp_error(expr->loc(), "unknown binary expression"); - } -} - -void compiler::emit_expr_and(const ast::expr_and::ptr& expr) -{ - auto label = create_label(); - - emit_expr(expr->lvalue); - emit_opcode(opcode::OP_JumpOnFalseExpr, label); - emit_expr(expr->rvalue); - - insert_label(label); -} - -void compiler::emit_expr_or(const ast::expr_or::ptr& expr) -{ - auto label = create_label(); - - emit_expr(expr->lvalue); - emit_opcode(opcode::OP_JumpOnTrueExpr, label); - emit_expr(expr->rvalue); - - insert_label(label); -} - -void compiler::emit_expr_complement(const ast::expr_complement::ptr& expr) -{ - emit_expr(expr->rvalue); - emit_opcode(opcode::OP_BoolComplement); -} - -void compiler::emit_expr_negate(const ast::expr_negate::ptr& expr) -{ - emit_opcode(opcode::OP_GetZero); - emit_expr(expr->rvalue); - emit_opcode(opcode::OP_Minus); -} - -void compiler::emit_expr_not(const ast::expr_not::ptr& expr) -{ - emit_expr(expr->rvalue); - emit_opcode(opcode::OP_BoolNot); -} - -void compiler::emit_expr_call(const ast::expr_call::ptr& expr, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_call_pointer(expr->call.as_pointer, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_call_function(expr->call.as_function, is_stmt); - else - throw comp_error(expr->loc(), "unknown function call expression"); -} - -void compiler::emit_expr_call_pointer(const ast::expr_pointer::ptr& expr, bool is_stmt) -{ - emit_opcode(opcode::OP_PreScriptCall); - emit_expr_arguments(expr->args); - emit_expr(expr->func); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptFunctionCallPointer, argcount); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptThreadCallPointer, argcount); - break; - default: - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_call_function(const ast::expr_function::ptr& expr, bool is_stmt) -{ - if (expr->path->value != "") - { - bool found = false; - - for (const auto& entry : assembly_->includes) - { - if (entry == expr->path->value) - { - found = true; - break; - } - } - - if (!found) - { - assembly_->includes.push_back(expr->path->value); - } - } - - bool as_dev = false; - std::string end; - - if (!developer_thread_ && is_stmt && expr->name->value == "assert") - { - as_dev = true; - developer_thread_ = true; - end = create_label(); - emit_opcode(opcode::OP_DevblockBegin, end); - } - - emit_opcode(opcode::OP_PreScriptCall); - emit_expr_arguments(expr->args); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - auto flags = developer_thread_ ? static_cast(import_flags::developer) : 0; - - switch (expr->mode) - { - case ast::call::mode::normal: - flags |= static_cast(import_flags::func_call); - emit_opcode(opcode::OP_ScriptFunctionCall, { expr->path->value, expr->name->value, argcount, utils::string::va("%d", flags) }); - break; - case ast::call::mode::thread: - flags |= static_cast(import_flags::func_call_thread); - emit_opcode(opcode::OP_ScriptThreadCall, { expr->path->value, expr->name->value, argcount, utils::string::va("%d", flags) }); - break; - default: - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); - - if (as_dev) - { - insert_label(end); - developer_thread_ = false; - } -} - -void compiler::emit_expr_method(const ast::expr_method::ptr& expr, bool is_stmt) -{ - if (expr->call == ast::kind::expr_pointer) - emit_expr_method_pointer(expr->call.as_pointer, expr->obj, is_stmt); - else if (expr->call == ast::kind::expr_function) - emit_expr_method_function(expr->call.as_function, expr->obj, is_stmt); - else - throw comp_error(expr->loc(), "unknown method call expression"); -} - -void compiler::emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj, bool is_stmt) -{ - emit_opcode(opcode::OP_PreScriptCall); - emit_expr_arguments(expr->args); - emit_expr(obj); - emit_expr(expr->func); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - - switch (expr->mode) - { - case ast::call::mode::normal: - emit_opcode(opcode::OP_ScriptMethodCallPointer, argcount); - break; - case ast::call::mode::thread: - emit_opcode(opcode::OP_ScriptMethodThreadCallPointer, argcount); - break; - default: - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj, bool is_stmt) -{ - if (expr->path->value != "") - { - bool found = false; - - for (const auto& entry : assembly_->includes) - { - if (entry == expr->path->value) - { - found = true; - break; - } - } - - if (!found) - { - assembly_->includes.push_back(expr->path->value); - } - } - - emit_opcode(opcode::OP_PreScriptCall); - emit_expr_arguments(expr->args); - emit_expr(obj); - - auto argcount = utils::string::va("%d", expr->args->list.size()); - auto flags = developer_thread_ ? static_cast(import_flags::developer) : 0; - - switch (expr->mode) - { - case ast::call::mode::normal: - flags |= static_cast(import_flags::meth_call); - emit_opcode(opcode::OP_ScriptMethodCall, { expr->path->value, expr->name->value, argcount, utils::string::va("%d", flags) }); - break; - case ast::call::mode::thread: - flags |= static_cast(import_flags::meth_call_thread); - emit_opcode(opcode::OP_ScriptMethodThreadCall, { expr->path->value, expr->name->value, argcount, utils::string::va("%d", flags) }); - break; - default: - break; - } - - if (is_stmt) - emit_opcode(opcode::OP_DecTop); -} - -void compiler::emit_expr_parameters(const ast::expr_parameters::ptr& expr) -{ - if (local_stack_.size() == 0) - { - emit_opcode(opcode::OP_CheckClearParams); - } - else - { - emit_opcode(opcode::OP_SafeCreateLocalVariables, local_stack_); - } - - for (auto& entry : expr->list) - { - if (entry == ast::kind::expr_assign_equal) - { - auto end_loc = create_label(); - emit_expr_variable(entry.as_assign_equal->lvalue); - emit_opcode(opcode::OP_IsDefined); - emit_opcode(opcode::OP_JumpOnTrue, end_loc); - emit_expr(entry.as_assign_equal->rvalue); - emit_expr_variable_ref(entry.as_assign_equal->lvalue, true); - insert_label(end_loc); - } - } -} - -void compiler::emit_expr_arguments(const ast::expr_arguments::ptr& expr) -{ - std::reverse(expr->list.begin(), expr->list.end()); - - for (auto& entry : expr->list) - { - emit_expr(entry); - } -} - -void compiler::emit_expr_isdefined(const ast::expr_isdefined::ptr& expr) -{ - emit_expr(expr->arg); - emit_opcode(opcode::OP_IsDefined); -} - -void compiler::emit_expr_vectorscale(const ast::expr_vectorscale::ptr& expr) -{ - emit_expr(expr->arg2); - emit_expr(expr->arg1); - emit_opcode(opcode::OP_VectorScale); -} - -void compiler::emit_expr_anglestoup(const ast::expr_anglestoup::ptr& expr) -{ - emit_expr(expr->arg); - emit_opcode(opcode::OP_AnglesToUp); -} - -void compiler::emit_expr_anglestoright(const ast::expr_anglestoright::ptr& expr) -{ - emit_expr(expr->arg); - emit_opcode(opcode::OP_AnglesToRight); -} - -void compiler::emit_expr_anglestoforward(const ast::expr_anglestoforward::ptr& expr) -{ - emit_expr(expr->arg); - emit_opcode(opcode::OP_AnglesToForward); -} - -void compiler::emit_expr_angleclamp180(const ast::expr_angleclamp180::ptr& expr) -{ - emit_expr(expr->arg); - emit_opcode(opcode::OP_AngleClamp180); -} - -void compiler::emit_expr_vectortoangles(const ast::expr_vectortoangles::ptr& expr) -{ - emit_expr(expr->arg); - emit_opcode(opcode::OP_VectorToAngles); -} - -void compiler::emit_expr_abs(const ast::expr_abs::ptr& expr) -{ - emit_expr(expr->arg); - emit_opcode(opcode::OP_Abs); -} - -void compiler::emit_expr_gettime(const ast::expr_gettime::ptr&) -{ - emit_opcode(opcode::OP_GetTime); -} - -void compiler::emit_expr_getdvar(const ast::expr_getdvar::ptr& expr) -{ - emit_expr(expr->arg); - emit_opcode(opcode::OP_GetDvar); -} - -void compiler::emit_expr_getdvarint(const ast::expr_getdvarint::ptr& expr) -{ - emit_expr(expr->arg); - emit_opcode(opcode::OP_GetDvarInt); -} - -void compiler::emit_expr_getdvarfloat(const ast::expr_getdvarfloat::ptr& expr) -{ - emit_expr(expr->arg); - emit_opcode(opcode::OP_GetDvarFloat); -} - -void compiler::emit_expr_getdvarvector(const ast::expr_getdvarvector::ptr& expr) -{ - emit_expr(expr->arg); - emit_opcode(opcode::OP_GetDvarVector); -} - -void compiler::emit_expr_getdvarcolorred(const ast::expr_getdvarcolorred::ptr& expr) -{ - emit_expr(expr->arg); - emit_opcode(opcode::OP_GetDvarColorRed); -} - -void compiler::emit_expr_getdvarcolorgreen(const ast::expr_getdvarcolorgreen::ptr& expr) -{ - emit_expr(expr->arg); - emit_opcode(opcode::OP_GetDvarColorGreen); -} - -void compiler::emit_expr_getdvarcolorblue(const ast::expr_getdvarcolorblue::ptr& expr) -{ - emit_expr(expr->arg); - emit_opcode(opcode::OP_GetDvarColorBlue); -} - -void compiler::emit_expr_getdvarcoloralpha(const ast::expr_getdvarcoloralpha::ptr& expr) -{ - emit_expr(expr->arg); - emit_opcode(opcode::OP_GetDvarColorAlpha); -} - -void compiler::emit_expr_getfirstarraykey(const ast::expr_getfirstarraykey::ptr& expr) -{ - emit_expr(expr->arg); - emit_opcode(opcode::OP_FirstArrayKey); -} - -void compiler::emit_expr_getnextarraykey(const ast::expr_getnextarraykey::ptr& expr) -{ - emit_expr(expr->arg2); - emit_expr(expr->arg1); - emit_opcode(opcode::OP_NextArrayKey); -} - -void compiler::emit_expr_reference(const ast::expr_reference::ptr& expr) -{ - if (expr->path->value != "") - { - bool found = false; - - for (const auto& entry : assembly_->includes) - { - if (entry == expr->path->value) - { - found = true; - break; - } - } - - if (!found) - { - assembly_->includes.push_back(expr->path->value); - } - } - - // TODO: resolve import calls path - - auto flags = developer_thread_ ? static_cast(import_flags::developer) : 0; - - flags |= static_cast(import_flags::func_reference); - - emit_opcode(opcode::OP_GetFunction, { expr->path->value, expr->name->value, "0", utils::string::va("%d", flags) }); -} - -void compiler::emit_expr_size(const ast::expr_size::ptr& expr) -{ - emit_expr(expr->obj); - emit_opcode(opcode::OP_SizeOf); -} - -void compiler::emit_expr_variable_ref(const ast::expr& expr, bool set) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array_ref(expr.as_array, set); - break; - case ast::kind::expr_field: - emit_expr_field_ref(expr.as_field, set); - break; - case ast::kind::expr_identifier: - emit_expr_local_ref(expr.as_identifier, set); - break; - default: - throw comp_error(expr.loc(), "invalid lvalue"); - } -} - -void compiler::emit_expr_array_ref(const ast::expr_array::ptr& expr, bool set) -{ - emit_expr(expr->key); - - switch (expr->obj.kind()) - { - case ast::kind::expr_game: - emit_opcode(opcode::OP_GetGameRef); - emit_opcode(opcode::OP_EvalArrayRef); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_array: - case ast::kind::expr_field: - case ast::kind::expr_identifier: - emit_expr_variable_ref(expr->obj, false); - emit_opcode(opcode::OP_EvalArrayRef); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_call: - case ast::kind::expr_method: - default: - throw comp_error(expr->loc(), "invalid array lvalue"); - } -} - -void compiler::emit_expr_field_ref(const ast::expr_field::ptr& expr, bool set) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - emit_opcode(opcode::OP_GetLevelObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_GetAnimObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_GetSelfObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_field: - emit_expr_field(expr->obj.as_field); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableCached, variable_access(expr->obj.as_identifier)); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_call: - emit_expr_call(expr->obj.as_call, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariableRef, field); - if (set) emit_opcode(opcode::OP_SetVariableField); - break; - default: - throw comp_error(expr->obj.loc(), "not an object"); - } -} - -void compiler::emit_expr_local_ref(const ast::expr_identifier::ptr& expr, bool set) -{ - const auto itr = constants_.find(expr->value); - - if (itr != constants_.end()) - { - throw comp_error(expr->loc(), "variable name already defined as constant '" + expr->value + "'"); - } - - emit_opcode(opcode::OP_EvalLocalVariableRefCached, variable_access(expr)); - - if (set) - { - emit_opcode(opcode::OP_SetVariableField); - } -} - -void compiler::emit_expr_variable(const ast::expr& expr) -{ - switch (expr.kind()) - { - case ast::kind::expr_array: - emit_expr_array(expr.as_array); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field); - break; - case ast::kind::expr_identifier: - emit_expr_local(expr.as_identifier); - break; - default: - throw comp_error(expr.loc(), "invalid variable type."); - } -} - -void compiler::emit_expr_array(const ast::expr_array::ptr& expr) -{ - emit_expr(expr->key); - emit_expr(expr->obj); - emit_opcode(opcode::OP_EvalArray); -} - -void compiler::emit_expr_field(const ast::expr_field::ptr& expr) -{ - const auto& field = expr->field->value; - - switch (expr->obj.kind()) - { - case ast::kind::expr_level: - emit_opcode(opcode::OP_GetLevelObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_GetAnimObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_GetSelfObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_array: - emit_expr_array(expr->obj.as_array); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_field: - emit_expr_field(expr->obj.as_field); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_call: - emit_expr_call(expr->obj.as_call, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_method: - emit_expr_method(expr->obj.as_method, false); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableCached, variable_access(expr->obj.as_identifier)); - emit_opcode(opcode::OP_CastFieldObject); - emit_opcode(opcode::OP_EvalFieldVariable, field); - break; - default: - throw comp_error(expr->loc(), "unknown field variable object type"); - } -} - -void compiler::emit_expr_local(const ast::expr_identifier::ptr& expr) -{ - // is constant ( should only allow: string, loc string, number, vector) - const auto itr = constants_.find(expr->value); - - if (itr != constants_.end()) - emit_expr(itr->second); - else - emit_opcode(opcode::OP_EvalLocalVariableCached, variable_access(expr)); -} - -void compiler::emit_expr_object(const ast::expr& expr) -{ - switch (expr.kind()) - { - case ast::kind::expr_level: - emit_opcode(opcode::OP_GetLevelObject); - break; - case ast::kind::expr_anim: - emit_opcode(opcode::OP_GetAnimObject); - break; - case ast::kind::expr_self: - emit_opcode(opcode::OP_GetSelfObject); - break; - case ast::kind::expr_array: - emit_expr_array(expr.as_array); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_field: - emit_expr_field(expr.as_field); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_call: - emit_expr_call(expr.as_call, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_method: - emit_expr_method(expr.as_method, false); - emit_opcode(opcode::OP_CastFieldObject); - break; - case ast::kind::expr_identifier: - emit_opcode(opcode::OP_EvalLocalVariableCached, variable_access(expr.as_identifier)); - emit_opcode(opcode::OP_CastFieldObject); - break; - default: - throw comp_error(expr.loc(), "not an object"); - } -} - -void compiler::emit_expr_vector(const ast::expr_vector::ptr& expr) -{ - std::vector data; - bool isconst = true; - auto flags = 0; - - if (expr->x == ast::kind::expr_integer) - { - auto value = std::atoi(expr->x.as_integer->value.data()); - data.push_back(expr->x.as_integer->value); - - if (value != 1 && value != -1 && value != 0) - isconst = false; - else - flags |= (value == 1) ? 0x20 : (value == -1) ? 0x10 : 0; - } - else if (expr->x == ast::kind::expr_float) - { - auto value = std::stof(expr->x.as_float->value.data()); - data.push_back(expr->x.as_float->value); - - if (value != 1.0 && value != -1.0 && value != 0.0) - isconst = false; - else - flags |= (value == 1.0) ? 0x20 : (value == -1.0) ? 0x10 : 0; - } - else - { - isconst = false; - } - - if (expr->y == ast::kind::expr_integer) - { - auto value = std::atoi(expr->y.as_integer->value.data()); - data.push_back(expr->y.as_integer->value); - - if (value != 1 && value != -1 && value != 0) - isconst = false; - else - flags |= (value == 1) ? 0x08 : (value == -1) ? 0x04 : 0; - } - else if (expr->y == ast::kind::expr_float) - { - auto value = std::stof(expr->y.as_float->value.data()); - data.push_back(expr->y.as_float->value); - - if (value != 1.0 && value != -1.0 && value != 0.0) - isconst = false; - else - flags |= (value == 1.0) ? 0x08 : (value == -1.0) ? 0x04 : 0; - } - else - { - isconst = false; - } - - if (expr->z == ast::kind::expr_integer) - { - auto value = std::atoi(expr->z.as_integer->value.data()); - data.push_back(expr->z.as_integer->value); - - if (value != 1 && value != -1 && value != 0) - isconst = false; - else - flags |= (value == 1) ? 0x02 : (value == -1) ? 0x01 : 0; - } - else if (expr->z == ast::kind::expr_float) - { - auto value = std::stof(expr->z.as_float->value.data()); - data.push_back(expr->z.as_float->value); - - if (value != 1.0 && value != -1.0 && value != 0.0) - isconst = false; - else - flags |= (value == 1.0) ? 0x02 : (value == -1.0) ? 0x01 : 0; - } - else - { - isconst = false; - } - - if (isconst) - { - emit_opcode(opcode::OP_VectorConstant, utils::string::va("%d", flags)); - } - else - { - // OP_GetVector seems to be broken, always use OP_Vector - emit_expr(expr->z); - emit_expr(expr->y); - emit_expr(expr->x); - emit_opcode(opcode::OP_Vector); - } -} - -void compiler::emit_expr_animation(const ast::expr_animation::ptr& expr) -{ - if (animtrees_.size() == 0) - { - throw comp_error(expr->loc(), "trying to use animation without specified using animtree"); - } - - emit_opcode(opcode::OP_GetAnimation, { animtrees_.back(), expr->value }); -} - -void compiler::emit_expr_animtree(const ast::expr_animtree::ptr& expr) -{ - if (animtrees_.size() == 0) - { - throw comp_error( expr->loc(), "trying to use animtree without specified using animtree"); - } - - emit_opcode(opcode::OP_GetInteger, { animtrees_.back(), "-1" }); -} - -void compiler::emit_expr_istring(const ast::expr_istring::ptr& expr) -{ - emit_opcode(opcode::OP_GetIString, expr->value); -} - -void compiler::emit_expr_string(const ast::expr_string::ptr& expr) -{ - emit_opcode(opcode::OP_GetString, expr->value); -} - -void compiler::emit_expr_hash(const ast::expr_hash::ptr& expr) -{ - emit_opcode(opcode::OP_GetHash, expr->value); -} - -void compiler::emit_expr_float(const ast::expr_float::ptr& expr) -{ - emit_opcode(opcode::OP_GetFloat, expr->value); -} - -void compiler::emit_expr_integer(const ast::expr_integer::ptr& expr) -{ - auto value = std::atoi(expr->value.data()); - - if (value == 0) - { - emit_opcode(opcode::OP_GetZero); - } - else if (value > 0 && value < 256) - { - emit_opcode(opcode::OP_GetByte, expr->value); - } - else if (value < 0 && value > -256) - { - emit_opcode(opcode::OP_GetNegByte, expr->value.substr(1)); - } - else if (value > 0 && value < 65536) - { - emit_opcode(opcode::OP_GetUnsignedShort, expr->value); - } - else if (value < 0 && value > -65536) - { - emit_opcode(opcode::OP_GetNegUnsignedShort, expr->value.substr(1)); - } - else - { - emit_opcode(opcode::OP_GetInteger, expr->value); - } -} - -void compiler::emit_expr_false(const ast::expr_false::ptr&) -{ - emit_opcode(opcode::OP_GetZero); -} - -void compiler::emit_expr_true(const ast::expr_true::ptr&) -{ - emit_opcode(opcode::OP_GetByte, "1"); -} - -void compiler::emit_opcode(opcode op) -{ - function_->instructions.push_back(std::make_unique()); - - auto& inst = function_->instructions.back(); - inst->opcode = static_cast(op); - inst->size = opcode_size(std::uint8_t(op)); - inst->index = index_; - - index_ += inst->size; -} - -void compiler::emit_opcode(opcode op, const std::string& data) -{ - function_->instructions.push_back(std::make_unique()); - - auto& inst = function_->instructions.back(); - inst->opcode = static_cast(op); - inst->size = opcode_size(std::uint8_t(op)); - inst->index = index_; - inst->data.push_back(data); - - index_ += inst->size; -} - -void compiler::emit_opcode(opcode op, const std::vector& data) -{ - function_->instructions.push_back(std::make_unique()); - - auto& inst = function_->instructions.back(); - inst->opcode = static_cast(op); - inst->size = opcode_size(std::uint8_t(op)); - inst->index = index_; - inst->data = data; - - index_ += inst->size; -} - -void compiler::process_thread(const ast::decl_thread::ptr& decl) -{ - process_expr_parameters(decl->params); - process_stmt_list(decl->stmt); -} - -void compiler::process_stmt(const ast::stmt& stmt) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list); - break; - case ast::kind::stmt_dev: - process_stmt_dev(stmt.as_dev); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch); - break; - case ast::kind::stmt_call: - case ast::kind::stmt_const: - case ast::kind::stmt_endon: - case ast::kind::stmt_notify: - case ast::kind::stmt_wait: - case ast::kind::stmt_waittillmatch: - case ast::kind::stmt_waittillframeend: - case ast::kind::stmt_case: - case ast::kind::stmt_default: - case ast::kind::stmt_break: - case ast::kind::stmt_continue: - case ast::kind::stmt_return: - case ast::kind::stmt_prof_begin: - case ast::kind::stmt_prof_end: - break; - default: - throw comp_error(stmt.loc(), "unknown statement"); - } -} - -void compiler::process_stmt_list(const ast::stmt_list::ptr& stmt) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry); - } -} - -void compiler::process_stmt_dev(const ast::stmt_dev::ptr& stmt) -{ - process_stmt_list(stmt->list); -} - -void compiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue); - break; - case ast::kind::expr_assign_equal: - case ast::kind::expr_assign_add: - case ast::kind::expr_assign_sub: - case ast::kind::expr_assign_mul: - case ast::kind::expr_assign_div: - case ast::kind::expr_assign_mod: - case ast::kind::expr_assign_shift_left: - case ast::kind::expr_assign_shift_right: - case ast::kind::expr_assign_bitwise_or: - case ast::kind::expr_assign_bitwise_and: - case ast::kind::expr_assign_bitwise_exor: - process_expr(stmt->expr.as_assign->lvalue); - break; - case ast::kind::null: - break; - default: - throw comp_error(stmt->loc(), "unknown expr statement expression"); - } -} - -void compiler::process_stmt_assign(const ast::stmt_assign::ptr& stmt) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr(stmt->expr.as_increment->lvalue); - break; - case ast::kind::expr_decrement: - process_expr(stmt->expr.as_decrement->lvalue); - break; - case ast::kind::expr_assign_equal: - case ast::kind::expr_assign_add: - case ast::kind::expr_assign_sub: - case ast::kind::expr_assign_mul: - case ast::kind::expr_assign_div: - case ast::kind::expr_assign_mod: - case ast::kind::expr_assign_shift_left: - case ast::kind::expr_assign_shift_right: - case ast::kind::expr_assign_bitwise_or: - case ast::kind::expr_assign_bitwise_and: - case ast::kind::expr_assign_bitwise_exor: - process_expr(stmt->expr.as_assign->lvalue); - break; - default: - throw comp_error(stmt->loc(), "unknown assign statement expression"); - } -} - -void compiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt) -{ - for (const auto& entry : stmt->args->list) - { - if (entry != ast::kind::expr_identifier) - { - throw comp_error(entry.loc(), "illegal waittill param, must be a local variable"); - } - - variable_register(entry.as_identifier->value); - } -} - -void compiler::process_stmt_if(const ast::stmt_if::ptr& stmt) -{ - process_stmt(stmt->stmt); -} - -void compiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt) -{ - process_stmt(stmt->stmt_if); - process_stmt(stmt->stmt_else); -} - -void compiler::process_stmt_while(const ast::stmt_while::ptr& stmt) -{ - process_stmt(stmt->stmt); -} - -void compiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt) -{ - process_stmt(stmt->stmt); -} - -void compiler::process_stmt_for(const ast::stmt_for::ptr& stmt) -{ - process_stmt(stmt->init); - process_stmt(stmt->stmt); - process_stmt(stmt->iter); -} - -void compiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt) -{ - auto array_name = utils::string::va("_a%d", ++label_idx_); - auto key_name = utils::string::va("_k%d", label_idx_); - - stmt->array = ast::expr(std::make_unique(stmt->loc(), array_name)); - - if (!stmt->use_key) - stmt->key_expr = ast::expr(std::make_unique(stmt->loc(), key_name)); - - key_name = stmt->key_expr.as_identifier->value; - - if (stmt->use_key) - { - variable_register(key_name); - process_expr(stmt->value_expr); - } - else - { - process_expr(stmt->value_expr); - variable_register(key_name); - } - - variable_register(array_name); - process_stmt(stmt->stmt); -} - -void compiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt) -{ - auto stmt_list = std::make_unique(stmt->stmt->loc()); - auto current_case = ast::stmt(nullptr); - - auto num = stmt->stmt->list.size(); - - for (auto i = 0u; i < num; i++) - { - auto& entry = stmt->stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(stmt->stmt->list[0]); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - if (current_case.as_node != nullptr) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(entry)); - stmt->stmt->list.erase(stmt->stmt->list.begin()); - } - } - else - { - throw comp_error(entry.loc(), "missing case statement"); - } - } - } - - if (current_case.as_node != nullptr) - { - stmt_list->list.push_back(std::move(current_case)); - } - - for (auto i = 0u; i < stmt_list->list.size(); i++) - { - auto& entry = stmt_list->list[i]; - - if (entry == ast::kind::stmt_case) - { - process_stmt_list(entry.as_case->stmt); - } - else if (entry == ast::kind::stmt_default) - { - process_stmt_list(entry.as_default->stmt); - } - } - - stmt->stmt =std::move(stmt_list); -} - -void compiler::process_expr(const ast::expr& expr) -{ - if (expr == ast::kind::expr_identifier) - { - variable_register(expr.as_identifier->value); - } - else if (expr == ast::kind::expr_array) - { - process_expr(expr.as_array->obj); - } -} - -void compiler::process_expr_parameters(const ast::expr_parameters::ptr& expr) -{ - for (const auto& entry : expr->list) - { - if (entry == ast::kind::expr_identifier) - { - variable_register(entry.as_identifier->value); - } - else if (entry == ast::kind::expr_assign_equal) - { - process_expr(entry.as_assign_equal->lvalue); - } - } -} - -void compiler::variable_register(const std::string& name) -{ - auto found = false; - - for (std::size_t i = 0; i < local_stack_.size(); i++) - { - if (local_stack_[i] == name) - { - found = true; - break; - } - } - - if (!found) local_stack_.push_back(name); -} - -auto compiler::variable_access(const ast::expr_identifier::ptr& name) -> std::string -{ - for (std::size_t i = 0; i < local_stack_.size(); i++) - { - if (local_stack_[i] == name->value) - { - return utils::string::va("%d", local_stack_.size() - 1 - i); - } - } - - throw comp_error(name->loc(), "local variable '" + name->value + "' not found."); -} - -auto compiler::is_constant_condition(const ast::expr& expr) -> bool -{ - switch (expr.kind()) - { - case ast::kind::null: - case ast::kind::expr_true: - return true; - case ast::kind::expr_false: - throw comp_error(expr.loc(), "condition can't be always false!"); - case ast::kind::expr_integer: - { - auto num = std::stoi(expr.as_integer->value); - if (num != 0) - return true; - else - throw comp_error(expr.loc(), "condition can't be always false!"); - } - default: - break; - } - - return false; -} - -auto compiler::create_label() -> std::string -{ - label_idx_++; - return utils::string::va("loc_%d", label_idx_); -} - -auto compiler::insert_label() -> std::string -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - return itr->second; - } - else - { - label_idx_++; - auto name = utils::string::va("loc_%d", label_idx_); - function_->labels.insert({ index_, name }); - return name; - } -} - -void compiler::insert_label(const std::string& name) -{ - const auto itr = function_->labels.find(index_); - - if (itr != function_->labels.end()) - { - for (auto& inst : function_->instructions) - { - switch (static_cast(inst->opcode)) - { - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_Jump: - case opcode::OP_JumpBack: - case opcode::OP_Switch: - case opcode::OP_DevblockBegin: - if (inst->data[0] == name) - inst->data[0] = itr->second; - break; - case opcode::OP_EndSwitch: - default: - break; - } - } - } - else - { - function_->labels.insert({ index_, name }); - } -} - -auto compiler::map_known_includes(const std::string&) -> bool -{ - return false; -} - -void compiler::print_function(const function::ptr& func) -{ - output_->write_string("\n"); - output_->write_string(utils::string::va("sub_%s %i %i\n", func->name.data(), func->params, func->flags)); - - for (const auto& inst : func->instructions) - { - const auto itr = func->labels.find(inst->index); - - if (itr != func->labels.end()) - { - output_->write_string(utils::string::va("\t%s\n", itr->second.data())); - } - - this->print_instruction(inst); - } - - output_->write_string(utils::string::va("end_%s\n", func->name.data())); -} - -void compiler::print_instruction(const instruction::ptr& inst) -{ - output_->write_string(utils::string::va("\t\t%s(", resolver::opcode_name(inst->opcode).data())); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetHash: - case opcode::OP_GetString: - case opcode::OP_GetIString: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - output_->write_string(utils::string::va("\"%s\"", inst->data[0].data())); - break; - case opcode::OP_GetAnimation: - case opcode::OP_GetFunction: - case opcode::OP_CallBuiltin: - case opcode::OP_CallBuiltinMethod: - case opcode::OP_ScriptFunctionCall: - case opcode::OP_ScriptMethodCall: - case opcode::OP_ScriptThreadCall: - case opcode::OP_ScriptMethodThreadCall: - output_->write_string(utils::string::va("\"%s\", \"%s\"", inst->data[0].data(), inst->data[1].data())); - break; - case opcode::OP_SafeCreateLocalVariables: - for (const auto& d : inst->data) - { - output_->write_string(utils::string::va("\"%s\"%s", d.data(), &d == &inst->data.back() ? "" : ", ")); - } - break; - case opcode::OP_EndSwitch: - output_->write_string(utils::string::va("%s", inst->data[0].data())); - { - std::uint32_t totalcase = std::stoul(inst->data[0]); - auto numerical = inst->data.back() == "i"; - auto index = 0; - for (auto casenum = 0u; casenum < totalcase; casenum++) - { - if (inst->data[1 + index] == "case") - { - auto fmt = numerical ? ", %s, %s, %s"s : ", %s, \"%s\", %s"s; - output_->write_string(utils::string::va(fmt, inst->data[1 + index].data(), inst->data[1 + index + 1].data(), inst->data[1 + index + 2].data())); - index += 3; - } - else if (inst->data[1 + index] == "default") - { - output_->write_string(utils::string::va(", %s, %s", inst->data[1 + index].data(), inst->data[1 + index + 1].data())); - index += 2; - } - } - } - break; - default: - for (const auto& d : inst->data) - { - output_->write_string(utils::string::va("%s%s", d.data(), &d == &inst->data.back() ? "" : ", ")); - } - break; - } - - output_->write_string(");\n"); -} - -} // namespace xsk::arc::t6 diff --git a/src/t6/context.cpp b/src/t6/context.cpp deleted file mode 100644 index f464b3d9..00000000 --- a/src/t6/context.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#include "xsk/stdinc.hpp" -#include "xsk/t6/t6.hpp" - -namespace xsk::arc::t6 -{ - -void context::init(build mode, read_cb_type callback) -{ - compiler_.mode(mode); - resolver::init(callback); -} - -void context::cleanup() -{ - resolver::cleanup(); -} - -} // namespace xsk::arc::t6 diff --git a/src/t6/decompiler.cpp b/src/t6/decompiler.cpp deleted file mode 100644 index d3352738..00000000 --- a/src/t6/decompiler.cpp +++ /dev/null @@ -1,2837 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#include "xsk/stdinc.hpp" -#include "xsk/t6/t6.hpp" - -namespace xsk::arc::t6 -{ - -auto decompiler::output() -> std::vector -{ - std::vector output; - - auto data = std::make_unique(); - data->write_string("// T6 GSC SOURCE\n"); - data->write_string("// Decompiled by https://github.com/xensik/gsc-tool\n"); - data->write_string(program_->print()); - - output.resize(data->pos()); - std::memcpy(output.data(), data->data(), output.size()); - - return output; -} - -void decompiler::decompile(const std::string& file, const assembly::ptr& data) -{ - filename_ = file; - program_ = std::make_unique(); - - std::reverse(data->includes.begin(), data->includes.end()); - - for (const auto& inc : data->includes) - { - auto include = std::make_unique(std::make_unique(inc)); - program_->includes.push_back(std::move(include)); - } - - for (const auto& func : data->functions) - { - auto name = std::make_unique(func->name); - auto params = std::make_unique(); - auto block = std::make_unique(); - auto flags = static_cast(func->flags); - func_ = std::make_unique(std::move(name), std::move(params), std::move(block), flags); - - stack_ = std::stack(); - labels_ = func->labels; - expr_labels_.clear(); - tern_labels_.clear(); - locals_.clear(); - blocks_.clear(); - - decompile_function(func); - - for (auto i = 0; i < func->params; i++) - { - func_->params->list.push_back(ast::expr(std::make_unique(locals_.at(locals_.size() - 1 - i)))); - } - - process_thread(func_); - - program_->declarations.push_back(ast::decl(std::move(func_))); - } -} - -void decompiler::decompile_function(const function::ptr& func) -{ - in_waittill_ = false; - retbool_ = true; - retnum_ = 0; - - for (const auto& inst : func->instructions) - { - decompile_instruction(inst, &inst == &func->instructions.back()); - } - - if (stack_.size() > 0) - { - throw decomp_error("stack isn't empty at function end " + func->name); - } - - const auto& stmt = func_->stmt; - - block blk; - blk.loc_end = utils::string::va("loc_%X", stmt->list.back().as_node->loc().begin.line + 1); - - blocks_.push_back(blk); - decompile_statements(stmt); - blocks_.pop_back(); - - if (stmt->list.size() > 0 && stmt->list.back() == ast::kind::stmt_return) - { - if (stmt->list.back().as_return->expr == ast::kind::null) - stmt->list.pop_back(); - } -} - -void decompiler::decompile_instruction(const instruction::ptr& inst, bool last) -{ - decompile_expressions(inst); - - auto loc = location(&filename_, inst->index); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_End: - { - if (!last) - { - retnum_++; - retbool_ = false; - } - - auto expr = ast::expr(std::make_unique()); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_Return: - { - retnum_++; - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - - if (expr != ast::kind::expr_integer || (expr.as_integer->value != "1" && expr.as_integer->value != "0")) - { - retbool_ = false; - } - - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_GetUndefined: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetZero: - { - auto node = std::make_unique(loc, "0"); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetByte: - case opcode::OP_GetUnsignedShort: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetNegByte: - case opcode::OP_GetNegUnsignedShort: - { - auto node = std::make_unique(loc, "-" + inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetInteger: - { - if (inst->data.size() == 2) - { - bool found = false; - - //for (const auto& entry : program_->declarations) TODO: C++20 reverse_view - for (auto i = program_->declarations.rbegin(); i != program_->declarations.rend(); ++i) - { - if (*i == ast::kind::decl_usingtree) - { - if (i->as_usingtree->name->value == inst->data[0]) - found = true; - else - found = false; - - break; - } - } - - if (!found) - { - auto tree = std::make_unique(loc, inst->data[0]); - auto decl = std::make_unique(loc, std::move(tree)); - program_->declarations.push_back(ast::decl(std::move(decl))); - } - - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - } - else - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - } - break; - } - case opcode::OP_GetFloat: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetString: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetIString: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetVector: - { - auto x = ast::expr(std::make_unique(loc, inst->data[0])); - auto y = ast::expr(std::make_unique(loc, inst->data[1])); - auto z = ast::expr(std::make_unique(loc, inst->data[2])); - auto node = std::make_unique(loc, std::move(x), std::move(y), std::move(z)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetLevel: - case opcode::OP_GetLevelObject: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetAnim: - case opcode::OP_GetAnimObject: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetSelf: - case opcode::OP_GetSelfObject: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetGame: - case opcode::OP_GetGameRef: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetAnimation: - { - bool found = false; - - //for (const auto& entry : program_->declarations) TODO: C++20 reverse_view - for (auto i = program_->declarations.rbegin(); i != program_->declarations.rend(); ++i) - { - if (*i == ast::kind::decl_usingtree) - { - if (i->as_usingtree->name->value == inst->data[0]) - found = true; - else - found = false; - - break; - } - } - - if (!found) - { - auto tree = std::make_unique(loc, inst->data[0]); - auto decl = std::make_unique(loc, std::move(tree)); - program_->declarations.push_back(ast::decl(std::move(decl))); - } - - auto node = std::make_unique(loc, inst->data[1]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetFunction: - { - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - auto node = std::make_unique(loc, std::move(path), std::move(name)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_SafeCreateLocalVariables: - { - for (const auto& entry : inst->data) - locals_.insert(locals_.begin(), entry); - - break; - } - case opcode::OP_EvalLocalVariableCached: - { - auto node = std::make_unique(loc, locals_.at(std::stoi(inst->data[0]))); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalArray: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto node = std::make_unique(key.loc(), std::move(obj), std::move(key)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalLocalArrayRefCached: - { - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::make_unique(loc, locals_.at(std::stoi(inst->data[0])))); - auto node = std::make_unique(key.loc(), std::move(obj), std::move(key)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalArrayRef: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - auto node = std::make_unique(key.loc(), std::move(obj), std::move(key)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ClearArray: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto key = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = key.loc(); - auto lvalue = ast::expr(std::make_unique(loc, std::move(obj), std::move(key))); - auto rvalue = ast::expr(std::make_unique(loc)); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EmptyArray: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_EvalFieldVariable: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - auto field = std::make_unique(loc, inst->data[0]); - auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(stmt)); - break; - } - case opcode::OP_EvalFieldVariableRef: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - auto field = std::make_unique(loc, inst->data[0]); - auto stmt = std::make_unique(loc, std::move(obj), std::move(field)); - stack_.push(std::move(stmt)); - break; - } - case opcode::OP_ClearFieldVariable: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - auto name = std::make_unique(loc, inst->data[0]); - auto field = ast::expr(std::make_unique(loc, std::move(obj), std::move(name))); - auto undef = ast::expr(std::make_unique(loc)); - auto expr = ast::expr(std::make_unique(loc, std::move(field), std::move(undef))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_SafeSetWaittillVariableFieldCached: - { - auto node = std::make_unique(loc, locals_.at(std::stoi(inst->data[0]))); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ClearParams: - { - if (in_waittill_) - { - auto args = std::make_unique(loc); - auto var = std::move(stack_.top()); stack_.pop(); - - while (var->kind() != ast::kind::stmt_waittill) - { - args->list.push_back(std::move(var)); - var = std::move(stack_.top()); stack_.pop(); - } - - if (var->kind() == ast::kind::stmt_waittill) - { - std::reverse(args->list.begin(), args->list.end()); - (*(ast::stmt_waittill::ptr*)&var)->args = std::move(args); - in_waittill_ = false; - } - - func_->stmt->list.push_back(ast::stmt(std::move(var))); - } - break; - } - case opcode::OP_EvalLocalVariableRefCached: - { - auto node = std::make_unique(loc, locals_.at(std::stoi(inst->data[0]))); - stack_.push(std::move(node)); - break; - } - case opcode::OP_SetVariableField: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = rvalue.as_node->loc(); - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_CallBuiltin: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - - while (var->kind() != ast::kind::asm_prescriptcall) - { - args->list.push_back(std::move(var)); - var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - } - - auto func = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::normal)); - auto node = std::make_unique(loc, std::move(func)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_CallBuiltinMethod: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - - while (var->kind() != ast::kind::asm_prescriptcall) - { - args->list.push_back(std::move(var)); - var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - } - - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::normal)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_Wait: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = expr.loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_WaitTillFrameEnd: - { - auto stmt = ast::stmt(std::make_unique(loc)); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_PreScriptCall: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFunctionCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - - while (var->kind() != ast::kind::asm_prescriptcall) - { - args->list.push_back(std::move(var)); - var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - } - - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::normal)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptFunctionCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - - while (var->kind() != ast::kind::asm_prescriptcall) - { - args->list.push_back(std::move(var)); - var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - } - - auto call = ast::call(std::make_unique(loc, std::move(func), std::move(args), ast::call::mode::normal)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptMethodCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.loc(); - - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - - while (var->kind() != ast::kind::asm_prescriptcall) - { - args->list.push_back(std::move(var)); - var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - } - - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::normal)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptMethodCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - - while (var->kind() != ast::kind::asm_prescriptcall) - { - args->list.push_back(std::move(var)); - var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - } - - auto call = ast::call(std::make_unique(loc, std::move(func), std::move(args), ast::call::mode::normal)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptThreadCall: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - - while (var->kind() != ast::kind::asm_prescriptcall) - { - args->list.push_back(std::move(var)); - var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - } - - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = func.as_node->loc(); - - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - - while (var->kind() != ast::kind::asm_prescriptcall) - { - args->list.push_back(std::move(var)); - var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - } - - auto call = ast::call(std::make_unique(loc, std::move(func), std::move(args), ast::call::mode::thread)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptMethodThreadCall: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.loc(); - - auto args = std::make_unique(loc); - auto path = std::make_unique(loc, inst->data[0]); - auto name = std::make_unique(loc, inst->data[1]); - - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - - while (var->kind() != ast::kind::asm_prescriptcall) - { - args->list.push_back(std::move(var)); - var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - } - - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::thread)); - auto node = std::make_unique(loc, std::move(obj) ,std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ScriptMethodThreadCallPointer: - { - auto args = std::make_unique(loc); - auto func = ast::expr(std::move(stack_.top())); stack_.pop(); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = obj.as_node->loc(); - - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - - while (var->kind() != ast::kind::asm_prescriptcall) - { - args->list.push_back(std::move(var)); - var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - } - - auto call = ast::call(std::make_unique(loc, std::move(func), std::move(args), ast::call::mode::thread)); - auto node = std::make_unique(loc, std::move(obj), std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_DecTop: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - auto stmt = ast::stmt(std::make_unique(expr.loc(), std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_BoolNot: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto expr = std::make_unique(loc, std::move(lvalue)); - stack_.push(std::move(expr)); - break; - } - case opcode::OP_BoolComplement: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto expr = std::make_unique(loc, std::move(lvalue)); - stack_.push(std::move(expr)); - break; - } - case opcode::OP_JumpOnTrue: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - - if (inst->index > resolve_label(inst->data[0])) - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - } - else - { - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_JumpOnFalse: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - - if (inst->index > resolve_label(inst->data[0])) - { - auto expr = ast::expr(std::make_unique(loc, std::move(lvalue))); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - } - else - { - auto stmt = ast::stmt(std::make_unique(loc, std::move(lvalue), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - } - break; - } - case opcode::OP_JumpOnTrueExpr: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto expr = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(expr)); - expr_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_JumpOnFalseExpr: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto expr = std::make_unique(loc, std::move(lvalue), inst->data[0]); - stack_.push(std::move(expr)); - expr_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_Jump: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - if (stack_.size() != 0) tern_labels_.push_back(inst->data[0]); - break; - } - case opcode::OP_JumpBack: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_Inc: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = ast::expr(std::make_unique(loc, std::move(lvalue), false)); - auto stmt = ast::stmt(std::make_unique(loc, std::move(node))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_Dec: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = ast::expr(std::make_unique(loc, std::move(lvalue), false)); - auto stmt = ast::stmt(std::make_unique(loc, std::move(node))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_Bit_Or: - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_Bit_Xor: - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_Bit_And: - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_Equal: - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_NotEqual: - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_LessThan: - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GreaterThan: - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_LessThanOrEqualTo: - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GreaterThanOrEqualTo: - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ShiftLeft: - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_ShiftRight: - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_Plus: - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_Minus: - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_Multiply: - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_Divide: - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_Modulus: - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_SizeOf: - { - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = lvalue.as_node->loc(); - auto node = std::make_unique(loc, std::move(lvalue)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_WaitTillMatch: - { - auto args = std::make_unique(loc); - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = expr.as_node->loc(); - - for (auto i = std::stoul(inst->data[0]); i > 0; i--) - { - auto node = std::move(stack_.top()); stack_.pop(); - loc = node->loc(); - args->list.push_back(std::move(node)); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(expr), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_WaitTill: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto event = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = event.as_node->loc(); - auto args = std::make_unique(loc); - auto stmt = std::make_unique(loc, std::move(obj) , std::move(event), std::move(args)); - stack_.push(std::move(stmt)); - in_waittill_ = true; - break; - } - case opcode::OP_Notify: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto event = ast::expr(std::move(stack_.top())); stack_.pop(); - auto args = std::make_unique(loc); - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - - while (var->kind() != ast::kind::asm_voidcodepos) - { - args->list.push_back(std::move(var)); - var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - } - - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj), std::move(event), std::move(args))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EndOn: - { - auto obj = ast::expr(std::move(stack_.top())); stack_.pop(); - auto event = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = event.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(obj) , std::move(event))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_VoidCodePos: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_Switch: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = expr.as_node->loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr), inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_EndSwitch: - { - auto count = inst->data[0]; - inst->data.erase(inst->data.begin()); - auto data = inst->data; - auto stmt = ast::stmt(std::make_unique(loc, data, count)); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_Vector: - { - auto x = ast::expr(std::move(stack_.top())); stack_.pop(); - auto y = ast::expr(std::move(stack_.top())); stack_.pop(); - auto z = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = z.as_node->loc(); - auto node = std::make_unique(loc, std::move(x), std::move(y), std::move(z)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetHash: - { - auto node = std::make_unique(loc, inst->data[0]); - stack_.push(std::move(node)); - break; - } - case opcode::OP_RealWait: - { - auto expr = ast::expr(std::move(stack_.top())); stack_.pop(); - loc = expr.loc(); - auto stmt = ast::stmt(std::make_unique(loc, std::move(expr))); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_VectorConstant: - { - auto flags = static_cast(std::stoi(inst->data[0])); - auto x = ast::expr(std::make_unique(loc, (flags & 0x20) ? "1" : (flags & 0x10) ? "-1" : "0")); - auto y = ast::expr(std::make_unique(loc, (flags & 0x08) ? "1" : (flags & 0x04) ? "-1" : "0")); - auto z = ast::expr(std::make_unique(loc, (flags & 0x02) ? "1" : (flags & 0x01) ? "-1" : "0")); - auto node = std::make_unique(loc, std::move(x), std::move(y), std::move(z)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_IsDefined: - { - auto arg = std::move(stack_.top()); stack_.pop(); - loc = arg->loc(); - auto node = std::make_unique(loc, std::move(arg)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_VectorScale: - { - auto arg1 = std::move(stack_.top()); stack_.pop(); - auto arg2 = std::move(stack_.top()); stack_.pop(); - loc = arg2->loc(); - auto node = std::make_unique(loc, std::move(arg1), std::move(arg2)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_AnglesToUp: - { - auto arg = std::move(stack_.top()); stack_.pop(); - loc = arg->loc(); - auto node = std::make_unique(loc, std::move(arg)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_AnglesToRight: - { - auto arg = std::move(stack_.top()); stack_.pop(); - loc = arg->loc(); - auto node = std::make_unique(loc, std::move(arg)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_AnglesToForward: - { - auto arg = std::move(stack_.top()); stack_.pop(); - loc = arg->loc(); - auto node = std::make_unique(loc, std::move(arg)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_AngleClamp180: - { - auto arg = std::move(stack_.top()); stack_.pop(); - loc = arg->loc(); - auto node = std::make_unique(loc, std::move(arg)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_VectorToAngles: - { - auto arg = std::move(stack_.top()); stack_.pop(); - loc = arg->loc(); - auto node = std::make_unique(loc, std::move(arg)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_Abs: - { - auto arg = std::move(stack_.top()); stack_.pop(); - loc = arg->loc(); - auto node = std::make_unique(loc, std::move(arg)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetTime: - { - auto node = std::make_unique(loc); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetDvar: - { - auto arg = std::move(stack_.top()); stack_.pop(); - loc = arg->loc(); - auto node = std::make_unique(loc, std::move(arg)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetDvarInt: - { - auto arg = std::move(stack_.top()); stack_.pop(); - loc = arg->loc(); - auto node = std::make_unique(loc, std::move(arg)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetDvarFloat: - { - auto arg = std::move(stack_.top()); stack_.pop(); - loc = arg->loc(); - auto node = std::make_unique(loc, std::move(arg)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetDvarVector: - { - auto arg = std::move(stack_.top()); stack_.pop(); - loc = arg->loc(); - auto node = std::make_unique(loc, std::move(arg)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetDvarColorRed: - { - auto arg = std::move(stack_.top()); stack_.pop(); - loc = arg->loc(); - auto node = std::make_unique(loc, std::move(arg)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetDvarColorGreen: - { - auto arg = std::move(stack_.top()); stack_.pop(); - loc = arg->loc(); - auto node = std::make_unique(loc, std::move(arg)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetDvarColorBlue: - { - auto arg = std::move(stack_.top()); stack_.pop(); - loc = arg->loc(); - auto node = std::make_unique(loc, std::move(arg)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_GetDvarColorAlpha: - { - auto arg = std::move(stack_.top()); stack_.pop(); - loc = arg->loc(); - auto node = std::make_unique(loc, std::move(arg)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_FirstArrayKey: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, "getfirstarraykey"); - auto var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - args->list.push_back(std::move(var)); - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::normal)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_NextArrayKey: - { - auto args = std::make_unique(loc); - auto path = std::make_unique(loc); - auto name = std::make_unique(loc, "getnextarraykey"); - auto var = std::move(stack_.top()); stack_.pop(); - args->list.push_back(std::move(var)); - var = std::move(stack_.top()); stack_.pop(); - loc = var->loc(); - args->list.push_back(std::move(var)); - auto call = ast::call(std::make_unique(loc, std::move(path), std::move(name), std::move(args), ast::call::mode::normal)); - auto node = std::make_unique(loc, std::move(call)); - stack_.push(std::move(node)); - break; - } - case opcode::OP_DevblockBegin: - { - auto stmt = ast::stmt(std::make_unique(loc, inst->data[0])); - func_->stmt->list.push_back(std::move(stmt)); - break; - } - case opcode::OP_CheckClearParams: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - case opcode::OP_SafeDecTop: - break; - case opcode::OP_CreateLocalVariable: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_ProfileStart: - case opcode::OP_ProfileStop: - case opcode::OP_Nop: - case opcode::OP_Abort: - case opcode::OP_Object: - case opcode::OP_ThreadObject: - case opcode::OP_EvalLocalVariable: - case opcode::OP_EvalLocalVariableRef: - case opcode::OP_DevblockEnd: - default: - throw decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); - } -} - -void decompiler::decompile_expressions(const instruction::ptr& inst) -{ - const auto itr = labels_.find(inst->index); - - if (itr == labels_.end()) - return; - - for (const auto& expr : expr_labels_) - { - if (expr == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto jump = std::move(stack_.top()); stack_.pop(); - auto loc = jump->loc(); - - if (jump->kind() == ast::kind::asm_jump_true_expr) - { - auto lvalue = std::move((*(ast::asm_jump_true_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else if (jump->kind() == ast::kind::asm_jump_false_expr) - { - auto lvalue = std::move((*(ast::asm_jump_false_expr::ptr*)&jump)->expr); - auto node = std::make_unique(loc, std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID JUMP EXPR!"); - } - } - } - - for (const auto& tern : tern_labels_) - { - if (tern == itr->second) - { - auto rvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - auto lvalue = ast::expr(std::move(stack_.top())); stack_.pop(); - - func_->stmt->list.pop_back(); - auto stmt = std::move(func_->stmt->list.back()); - func_->stmt->list.pop_back(); - - if (stmt == ast::kind::asm_jump_cond) - { - auto loc = stmt.as_cond->loc(); - auto node = std::make_unique(loc, std::move(stmt.as_cond->expr), std::move(lvalue), std::move(rvalue)); - stack_.push(std::move(node)); - } - else - { - throw decomp_error("TRIED TO DECOMPILE INVALID TERNARY EXPR!"); - } - } - } -} - -void decompiler::decompile_statements(const ast::stmt_list::ptr& stmt) -{ - try - { - decompile_infinites(stmt); - decompile_loops(stmt); - decompile_switches(stmt); - decompile_ifelses(stmt); - decompile_aborts(stmt); - decompile_devblocks(stmt); - } - catch (const std::exception& e) - { - std::cerr << e.what() << "\n"; - } -} - -void decompiler::decompile_infinites(const ast::stmt_list::ptr& stmt) -{ - if (stmt->list.size() == 0) return; - - for (auto i = stmt->list.size() - 1; i > 0; i--) - { - if (stmt->list.at(i) == ast::kind::asm_jump) - { - if (stmt->list.at(i).as_node->loc().begin.line < std::stol(stmt->list.at(i).as_jump->value.substr(4), 0, 16)) - continue; - - if (stmt->list.at(i).as_jump->value == blocks_.back().loc_continue) - continue; - - auto break_loc = last_location_index(stmt, i) ? blocks_.back().loc_end : stmt->list.at(i + 1).loc().label(); - auto start = find_location_index(stmt, stmt->list.at(i).as_jump->value); - - if (stmt->list.at(i - 1).as_node->kind() == ast::kind::asm_jump_cond && stmt->list.at(i - 1).as_cond->value == break_loc) - { - continue; - } - else if (stmt->list.at(start).as_node->kind() != ast::kind::asm_jump_cond) - { - decompile_inf(stmt, start, i); - i = stmt->list.size(); - } - else if (stmt->list.at(start).as_cond->value != break_loc) - { - decompile_inf(stmt, start, i); - i = stmt->list.size(); - } - else if (stmt->list.at(start).as_cond->value == break_loc) - { - decompile_loop(stmt, start, i); - i = stmt->list.size(); - } - } - } -} - -void decompiler::decompile_loops(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond) - { - auto j = (entry.as_cond->value == blocks_.back().loc_end) ? (stmt->list.size()) : (find_location_index(stmt, entry.as_cond->value)); - - if (j < i) - { - decompile_dowhile(stmt, j, i); - i = 0; - continue; - } - - j -= 1; - - if (stmt->list.at(j) == ast::kind::asm_jump) - { - if (stmt->list.at(j).as_node->loc().begin.line < std::stol(stmt->list.at(j).as_jump->value.substr(4), 0, 16)) - continue; - - if (stmt->list.at(i).loc().label() == stmt->list.at(j).as_jump->value) - { - decompile_loop(stmt, i, j); - i = 0; - } - } - } - } -} - -void decompiler::decompile_switches(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - if (stmt->list.at(i) == ast::kind::asm_switch) - { - decompile_switch(stmt, i); - } - } -} - -void decompiler::decompile_ifelses(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond) - { - auto j = (entry.as_cond->value == blocks_.back().loc_end) ? (stmt->list.size() - 1) : (find_location_index(stmt, entry.as_cond->value) - 1); - auto last_loc = blocks_.back().loc_end; - - if (stmt->list.at(j) == ast::kind::asm_jump) - { - // if block is a loop check break, continue - if (stmt->list.at(j).as_jump->value == blocks_.back().loc_continue) - { - //if its a while, continue jumps back - if (stmt->list.at(j).as_node->loc().begin.line > std::stol(stmt->list.at(j).as_jump->value.substr(4), 0, 16)) - { - decompile_if(stmt, i, j); - } - // a dowhile, for or foreach, check for if/else or if/continue - else if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::stmt_return) - { - // block ends with a return, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (j - i > 1 && stmt->list.at(j - 1) == ast::kind::asm_jump) - { - if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_break) - { - // block ends with a break, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else if (stmt->list.at(j - 1).as_jump->value == blocks_.back().loc_continue) - { - // block ends with a continue, so jump belows to if/else - decompile_ifelse(stmt, i, j); - } - else - { - // jump belows to if/continue - decompile_if(stmt, i, j); - } - } - else - { - decompile_if(stmt, i, j); - } - } - else if (stmt->list.at(j).as_jump->value == blocks_.back().loc_break) - { - decompile_if(stmt, i, j); - } - else if (stmt->list.at(j).as_jump->value == blocks_.back().loc_end) - { - if (find_location_reference(stmt, i + 1, j, entry.as_cond->value)) - decompile_if(stmt, i, j); - else - decompile_ifelse(stmt, i, j); - } - else if (stmt->list.at(j).as_jump->value == entry.as_cond->value) - { - if (find_location_reference(stmt, i + 1, j, entry.as_cond->value)) - decompile_if(stmt, i, j); - else - decompile_ifelse(stmt, i, j); - } - else - { - decompile_ifelse(stmt, i, j); - } - } - else - { - decompile_if(stmt, i, j); - } - } - } -} - -void decompiler::decompile_aborts(const ast::stmt_list::ptr& stmt) -{ - for (auto i = static_cast>(stmt->list.size() - 1); i >= 0; i--) - //for (auto i = 0u; i < stmt->list.size(); i++) - { - if (stmt->list.at(i) == ast::kind::asm_jump) - { - auto loc = stmt->list.at(i).loc(); - auto jump_loc = stmt->list.at(i).as_jump->value; - - if (jump_loc == blocks_.back().loc_break) - { - stmt->list.erase(stmt->list.begin() + i); - auto new_stmt = ast::stmt(std::make_unique(loc)); - stmt->list.insert(stmt->list.begin() + i, std::move(new_stmt)); - } - else if (jump_loc == blocks_.back().loc_continue) - { - stmt->list.erase(stmt->list.begin() + i); - auto new_stmt = ast::stmt(std::make_unique(loc)); - stmt->list.insert(stmt->list.begin() + i, std::move(new_stmt)); - } - else - { - // fix for treyarch compiler bug: nested switch break locs are not preserved - if (jump_loc != blocks_.back().loc_end) - { - auto j = find_location_index(stmt, jump_loc); - - if (stmt->list.at(j).as_node->kind() == ast::kind::stmt_break) - { - stmt->list.erase(stmt->list.begin() + i); - auto new_stmt = ast::stmt(std::make_unique(loc)); - stmt->list.insert(stmt->list.begin() + i, std::move(new_stmt)); - - continue; - } - } - std::cout << "WARNING: unresolved jump to '" + jump_loc + "', maybe incomplete for loop\n"; - } - } - } -} - -void decompiler::decompile_devblocks(const ast::stmt_list::ptr& stmt) -{ - for (auto i = 0u; i < stmt->list.size(); i++) - { - if (stmt->list.at(i) == ast::kind::asm_dev) - { - if (blocks_.back().is_dev) - { - stmt->list.erase(stmt->list.begin() + i--); - continue; - } - - if (i + 1 < stmt->list.size()) - { - if (stmt->list.at(i + 1) == ast::kind::asm_dev && stmt->list.at(i + 1).as_asm_dev->value == stmt->list.at(i).as_asm_dev->value) - { - stmt->list.erase(stmt->list.begin() + i + 1); - } - } - - auto loc = stmt->list.at(i).loc(); - auto end = find_location_index(stmt, stmt->list.at(i).as_asm_dev->value); - - block dev_blk; - dev_blk.loc_end = stmt->list.at(i).as_asm_dev->value; - dev_blk.loc_break = blocks_.back().loc_break; - dev_blk.loc_continue = blocks_.back().loc_continue; - dev_blk.is_dev = true; - - stmt->list.erase(stmt->list.begin() + i); - end -= 1; - - auto list_stmt = std::make_unique(loc); - - for (auto j = i; j < end; j++) - { - list_stmt->list.push_back(std::move(stmt->list[i])); - stmt->list.erase(stmt->list.begin() + i); - } - - blocks_.push_back(dev_blk); - decompile_statements(list_stmt); - blocks_.pop_back(); - - if (list_stmt->list.size() == 1 && list_stmt->list.at(0) == ast::kind::stmt_call) - { - const auto& st = list_stmt->list.at(0); - - if (st.as_call->expr == ast::kind::expr_call && st.as_call->expr.as_call->call == ast::kind::expr_function) - { - if (st.as_call->expr.as_call->call.as_function->name->value == "assert") - { - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(st.as_call->expr))); - stmt->list.insert(stmt->list.begin() + i, std::move(new_stmt)); - continue; - } - - } - } - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(list_stmt))); - stmt->list.insert(stmt->list.begin() + i, std::move(new_stmt)); - } - } -} - -void decompiler::decompile_if(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_end = stmt->list.at(begin).as_cond->value; - blk.loc_break = blocks_.back().loc_break; - blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_ifelse(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block if_blk; - if_blk.loc_end = stmt->list.at(end).loc().label(); - if_blk.loc_break = blocks_.back().loc_break; - if_blk.loc_continue = blocks_.back().loc_continue; - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto if_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - if_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(if_blk); - decompile_statements(if_stmt); - blocks_.pop_back(); - - auto end_loc = stmt->list.at(begin).as_jump->value; - stmt->list.erase(stmt->list.begin() + begin); // remove 'jump' - - auto end_idx = (end_loc == blocks_.back().loc_end) ? stmt->list.size() : find_location_index(stmt, end_loc); - - block else_blk; - else_blk.loc_end = end_loc; - else_blk.loc_break = blocks_.back().loc_break; - else_blk.loc_continue = blocks_.back().loc_continue; - - auto else_stmt = std::make_unique(loc); - - for (auto i = begin; i < end_idx; i++) - { - else_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(else_blk); - decompile_statements(else_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(if_stmt)), ast::stmt(std::move(else_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_inf(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - - stmt->list.erase(stmt->list.begin() + end); // remove 'jump' - - auto for_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - for_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(for_stmt); - blocks_.pop_back(); - - auto init = ast::stmt(std::make_unique()); - auto test = ast::expr(std::make_unique()); - auto iter = ast::stmt(std::make_unique()); - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(init), std::move(test), std::move(iter), ast::stmt(std::move(for_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_loop(const ast::stmt_list::ptr& stmt, std::size_t start, std::size_t end) -{ - auto& last = stmt->list.at(end - 1); - - if (last == ast::kind::stmt_assign) - { - if (last.as_assign->expr == ast::kind::expr_assign_equal) - { - auto& call = last.as_assign->expr.as_assign_equal->rvalue; - - if (call == ast::kind::expr_call && call.as_call->call == ast::kind::expr_function) - { - if (utils::string::to_lower(call.as_call->call.as_function->name->value) == "getnextarraykey") - { - auto ref = stmt->list.at(start).loc().label(); - - if (!find_location_reference(stmt, 0, start, ref)) - { - decompile_foreach(stmt, start, end); - return; - } - } - } - } - - if (start > 0) // while at func start - { - if (stmt->list.at(start - 1) == ast::kind::stmt_assign) - { - if (!lvalues_match(stmt->list.at(start - 1).as_assign, last.as_assign)) - { - decompile_while(stmt, start, end); - return; - } - - auto ref1 = stmt->list.at(end).loc().label(); - auto ref2 = stmt->list.at(start).loc().label(); - - if (find_location_reference(stmt, start, end, ref1)) - { - // jump is referenced, not post-expr - decompile_while(stmt, start, end); - return; - } - else if (find_location_reference(stmt, start, end, ref2)) - { - // continue is at begin, not post-expr - decompile_while(stmt, start, end); - return; - } - else if (find_location_reference(stmt, 0, start, ref2)) - { - // begin is at condition, not pre-expr - decompile_while(stmt, start, end); - return; - } - else - { - decompile_for(stmt, start, end); - return; - } - } - } - } - - decompile_while(stmt, start, end); -} - -void decompiler::decompile_while(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(begin).loc().label(); - - auto loc = stmt->list.at(begin).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - stmt->list.erase(stmt->list.begin() + end); // remove 'jumpback' - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end--; - - auto while_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - while_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(while_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(while_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_dowhile(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = last_location_index(stmt, end) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - blk.loc_end = stmt->list.at(end).loc().label(); - blk.loc_continue = stmt->list.at(end).loc().label(); - - auto test = std::move(stmt->list.at(end).as_cond->expr); - auto loc = stmt->list.at(begin).loc(); - - stmt->list.erase(stmt->list.begin() + end); // remove 'test jump' - - auto while_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - while_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(while_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), ast::stmt(std::move(while_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_for(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - auto loc = stmt->list.at(begin - 1).loc(); - auto test = std::move(stmt->list.at(begin).as_cond->expr); - - auto init = ast::stmt(std::make_unique()); - init.as_list->list.push_back(std::move(stmt->list.at(begin - 1))); - init.as_list->is_expr = true; - - auto iter = ast::stmt(std::make_unique()); - iter.as_list->list.push_back(std::move(stmt->list.at(end - 1))); - iter.as_list->is_expr = true; - - begin--; // move begin from 'test' to 'init' - stmt->list.erase(stmt->list.begin() + begin); // remove 'init' - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - end -= 3; // move end to 'iter' ( minus 'init' & 'test' ) - stmt->list.erase(stmt->list.begin() + end); // remove 'iter' - stmt->list.erase(stmt->list.begin() + end); // remove 'jumpback' - - auto for_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - for_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(for_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(init), std::move(test), std::move(iter), ast::stmt(std::move(for_stmt)))); - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_foreach(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end) -{ - block blk; - blk.loc_break = stmt->list.at(begin).as_cond->value; - blk.loc_end = stmt->list.at(end - 1).loc().label(); - blk.loc_continue = stmt->list.at(end - 1).loc().label(); - - auto loc = stmt->list.at(begin - 2).loc(); - - auto init = ast::stmt(std::make_unique()); - init.as_list->list.push_back(std::move(stmt->list[begin-2])); - init.as_list->list.push_back(std::move(stmt->list[begin-1])); - auto stmt0 = std::move(stmt->list[begin+1]); - - begin -= 2; // move begin from 'test' to 'array' - stmt->list.erase(stmt->list.begin() + begin); // remove 'array' - stmt->list.erase(stmt->list.begin() + begin); // remove 'elem' - stmt->list.erase(stmt->list.begin() + begin); // remove 'test' - stmt->list.erase(stmt->list.begin() + begin); // remove 'set' - end -= 5; // move end to 'iter' ( minus 'array', 'elem', 'test' & 'set' ) - stmt->list.erase(stmt->list.begin() + end); // remove 'iter' - stmt->list.erase(stmt->list.begin() + end); // remove 'jumpback - - auto foreach_stmt = std::make_unique(loc); - - for (auto i = begin; i < end; i++) - { - foreach_stmt->list.push_back(std::move(stmt->list[begin])); - stmt->list.erase(stmt->list.begin() + begin); - } - - blocks_.push_back(blk); - decompile_statements(foreach_stmt); - blocks_.pop_back(); - - auto new_stmt = ast::stmt(std::make_unique(loc, ast::stmt(std::move(foreach_stmt)), false)); - - new_stmt.as_foreach->array_expr = std::move(init.as_list->list[0].as_assign->expr.as_assign->rvalue); - new_stmt.as_foreach->value_expr = std::move(stmt0.as_assign->expr.as_assign->lvalue); - new_stmt.as_foreach->key_expr = std::move(init.as_list->list[1].as_assign->expr.as_assign->lvalue); - - if (!new_stmt.as_foreach->key_expr.as_identifier->value.starts_with("_k")) - { - new_stmt.as_foreach->use_key = true; - } - - stmt->list.insert(stmt->list.begin() + begin, std::move(new_stmt)); -} - -void decompiler::decompile_switch(const ast::stmt_list::ptr& stmt, std::size_t start) -{ - block blk; - blk.loc_continue = blocks_.back().loc_continue; - blk.loc_end = stmt->list.at(start).as_asm_switch->value; - - auto loc = stmt->list.at(start).loc(); - auto test = std::move(stmt->list.at(start).as_asm_switch->expr); - auto end_loc = stmt->list.at(start).as_asm_switch->value; - auto end = find_location_index(stmt, end_loc); - - blk.loc_break = (end == stmt->list.size() - 1) ? blocks_.back().loc_end : stmt->list.at(end + 1).loc().label(); - - // collect cases - auto casenum = std::atol(stmt->list.at(end).as_asm_endswitch->count.data()); - auto data = stmt->list.at(end).as_asm_endswitch->data; - auto numerical = data.back() == "i"; - auto idx = 0; - - for (auto i = 0; i < casenum; i++) - { - if (data.at(idx) == "case") - { - auto loc_str = data.at(idx + 2); - auto loc_idx = find_location_index(stmt, loc_str); - auto loc_pos = location(&filename_, std::stol(loc_str.substr(4), 0, 16)); - auto value = numerical ? ast::expr(std::make_unique(loc_pos, data.at(idx + 1))) : ast::expr(std::make_unique(loc_pos, data.at(idx + 1))); - auto list = std::make_unique(loc); - list->is_case = true; - auto case_stmt = ast::stmt(std::make_unique(loc_pos, std::move(value), std::move(list))); - stmt->list.insert(stmt->list.begin() + loc_idx, std::move(case_stmt)); - idx += 3; - } - else if (data.at(idx) == "default") - { - auto loc_str = data.at(idx + 1); - auto loc_idx = find_location_index(stmt, loc_str); - auto loc_pos = location(&filename_, std::stol(loc_str.substr(4), 0, 16)); - auto list = std::make_unique(loc); - list->is_case = true; - auto def_stmt = ast::stmt(std::make_unique(loc_pos, std::move(list))); - while (stmt->list.at(loc_idx) == ast::kind::stmt_case) - loc_idx++; - stmt->list.insert(stmt->list.begin() + loc_idx, std::move(def_stmt)); - idx += 2; - } - } - - end = find_location_index(stmt, end_loc); // update end - - while (stmt->list.size() > (end + 1) && stmt->list.at(end) != ast::kind::asm_endswitch) - end++; - - if (stmt->list.at(end) != ast::kind::asm_endswitch) - decomp_error("bad empty cases in switch block!"); - - end--; - stmt->list.erase(stmt->list.begin() + start); // remove 'switch' - stmt->list.erase(stmt->list.begin() + end); // remove 'endswitch' - - //decompile block - auto sw_stmt = std::make_unique(loc); - - for (auto i = start; i < end; i++) - { - sw_stmt->list.push_back(std::move(stmt->list[start])); - stmt->list.erase(stmt->list.begin() + start); - } - - blocks_.push_back(blk); - decompile_statements(sw_stmt); - blocks_.pop_back(); - - auto stmt_list = std::make_unique(loc); - auto current_case = ast::stmt(std::make_unique()); - - auto num = sw_stmt->list.size(); - for (auto i = 0u; i < num; i++) - { - auto& entry = sw_stmt->list[0]; - - if (entry == ast::kind::stmt_case || entry == ast::kind::stmt_default) - { - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - current_case = std::move(sw_stmt->list[0]); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - if (current_case.kind() != ast::kind::null) - { - if (current_case == ast::kind::stmt_case) - { - current_case.as_case->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - else - { - current_case.as_default->stmt->list.push_back(std::move(sw_stmt->list[0])); - sw_stmt->list.erase(sw_stmt->list.begin()); - } - } - else - { - decomp_error("missing case before stmt inside switch!"); - } - } - } - - if (current_case.kind() != ast::kind::null) - { - stmt_list->list.push_back(std::move(current_case)); - } - - auto new_stmt = ast::stmt(std::make_unique(loc, std::move(test), std::move(stmt_list))); - stmt->list.insert(stmt->list.begin() + start, std::move(new_stmt)); -} - -auto decompiler::find_location_reference(const ast::stmt_list::ptr& stmt, std::size_t begin, std::size_t end, const std::string& location) -> bool -{ - for (auto i = begin; i < end; i++) - { - const auto& entry = stmt->list.at(i); - - if (entry == ast::kind::asm_jump_cond && entry.as_cond->value == location) - { - return true; - } - else if (entry == ast::kind::asm_jump && entry.as_jump->value == location) - { - return true; - } - else if (entry == ast::kind::asm_dev && entry.as_asm_dev->value == location) - { - return true; - } - } - - return false; -} - -auto decompiler::find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::size_t -{ - auto index = 0u; - - if (location == blocks_.back().loc_end) - return stmt->list.size(); - - for (const auto& entry : stmt->list) - { - if (entry.loc().label() == location) - return index; - - index++; - } - - throw decomp_error("LOCATION NOT FOUND! (" + location + ")"); -} - -auto decompiler::last_location_index(const ast::stmt_list::ptr& stmt, std::size_t index) -> bool -{ - if (index == stmt->list.size() - 1) - return true; - - return false; -} - -auto decompiler::lvalues_match(const ast::stmt_assign::ptr& stmt1, const ast::stmt_assign::ptr& stmt2) -> bool -{ - ast::expr* lvalue1 {}; - ast::expr* lvalue2 {}; - - switch (stmt1->expr.kind()) - { - case ast::kind::expr_increment: - lvalue1 = &stmt1->expr.as_increment->lvalue; - break; - case ast::kind::expr_decrement: - lvalue1 = &stmt1->expr.as_decrement->lvalue; - break; - case ast::kind::expr_assign_equal: - case ast::kind::expr_assign_add: - case ast::kind::expr_assign_sub: - case ast::kind::expr_assign_mul: - case ast::kind::expr_assign_div: - case ast::kind::expr_assign_mod: - case ast::kind::expr_assign_shift_left: - case ast::kind::expr_assign_shift_right: - case ast::kind::expr_assign_bitwise_or: - case ast::kind::expr_assign_bitwise_and: - case ast::kind::expr_assign_bitwise_exor: - lvalue1 = &stmt1->expr.as_assign->lvalue; - break; - default: - break; - } - - switch (stmt2->expr.kind()) - { - case ast::kind::expr_increment: - lvalue2 = &stmt2->expr.as_increment->lvalue; - break; - case ast::kind::expr_decrement: - lvalue2 = &stmt2->expr.as_decrement->lvalue; - break; - case ast::kind::expr_assign_equal: - case ast::kind::expr_assign_add: - case ast::kind::expr_assign_sub: - case ast::kind::expr_assign_mul: - case ast::kind::expr_assign_div: - case ast::kind::expr_assign_mod: - case ast::kind::expr_assign_shift_left: - case ast::kind::expr_assign_shift_right: - case ast::kind::expr_assign_bitwise_or: - case ast::kind::expr_assign_bitwise_and: - case ast::kind::expr_assign_bitwise_exor: - lvalue2 = &stmt2->expr.as_assign->lvalue; - break; - default: - break; - } - - if (lvalue1 && lvalue2 && *lvalue1 == *lvalue2) - return true; - - return false; -} - -auto decompiler::resolve_label(const std::string& name) -> std::uint32_t -{ - for (const auto& entry : labels_) - { - if (entry.second == name) - { - return entry.first; - } - } - - throw decomp_error("couldn't resolve label address of '" + name + "'!"); -} - -void decompiler::process_thread(const ast::decl_thread::ptr& thread) -{ - process_stmt_list(thread->stmt); - process_expr_parameters(thread->params); -} - -void decompiler::process_stmt(const ast::stmt& stmt) -{ - switch (stmt.kind()) - { - case ast::kind::stmt_list: - process_stmt_list(stmt.as_list); - break; - case ast::kind::stmt_dev: - process_stmt_dev(stmt.as_dev); - break; - case ast::kind::stmt_expr: - process_stmt_expr(stmt.as_expr); - break; - case ast::kind::stmt_call: - process_stmt_call(stmt.as_call); - break; - case ast::kind::stmt_assign: - process_stmt_assign(stmt.as_assign); - break; - case ast::kind::stmt_endon: - process_stmt_endon(stmt.as_endon); - break; - case ast::kind::stmt_notify: - process_stmt_notify(stmt.as_notify); - break; - case ast::kind::stmt_wait: - process_stmt_wait(stmt.as_wait); - break; - case ast::kind::stmt_waittill: - process_stmt_waittill(stmt.as_waittill); - break; - case ast::kind::stmt_waittillmatch: - process_stmt_waittillmatch(stmt.as_waittillmatch); - break; - case ast::kind::stmt_if: - process_stmt_if(stmt.as_if); - break; - case ast::kind::stmt_ifelse: - process_stmt_ifelse(stmt.as_ifelse); - break; - case ast::kind::stmt_while: - process_stmt_while(stmt.as_while); - break; - case ast::kind::stmt_dowhile: - process_stmt_dowhile(stmt.as_dowhile); - break; - case ast::kind::stmt_for: - process_stmt_for(stmt.as_for); - break; - case ast::kind::stmt_foreach: - process_stmt_foreach(stmt.as_foreach); - break; - case ast::kind::stmt_switch: - process_stmt_switch(stmt.as_switch); - break; - case ast::kind::stmt_return: - process_stmt_return(stmt.as_return); - break; - default: - break; - } -} - -void decompiler::process_stmt_list(const ast::stmt_list::ptr& stmt) -{ - for (const auto& entry : stmt->list) - { - process_stmt(entry); - } -} - -void decompiler::process_stmt_dev(const ast::stmt_dev::ptr& stmt) -{ - process_stmt_list(stmt->list); -} - -void decompiler::process_stmt_expr(const ast::stmt_expr::ptr& stmt) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement); - break; - case ast::kind::expr_assign_equal: - case ast::kind::expr_assign_add: - case ast::kind::expr_assign_sub: - case ast::kind::expr_assign_mul: - case ast::kind::expr_assign_div: - case ast::kind::expr_assign_mod: - case ast::kind::expr_assign_shift_left: - case ast::kind::expr_assign_shift_right: - case ast::kind::expr_assign_bitwise_or: - case ast::kind::expr_assign_bitwise_and: - case ast::kind::expr_assign_bitwise_exor: - process_expr_assign(stmt->expr.as_assign); - break; - default: - break; - } -} - -void decompiler::process_stmt_call(const ast::stmt_call::ptr& stmt) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_call: - process_expr_call(stmt->expr.as_call); - break; - case ast::kind::expr_method: - process_expr_method(stmt->expr.as_method); - break; - default: - break; - } -} - -void decompiler::process_stmt_assign(const ast::stmt_assign::ptr& stmt) -{ - switch (stmt->expr.kind()) - { - case ast::kind::expr_increment: - process_expr_increment(stmt->expr.as_increment); - break; - case ast::kind::expr_decrement: - process_expr_decrement(stmt->expr.as_decrement); - break; - case ast::kind::expr_assign_equal: - case ast::kind::expr_assign_add: - case ast::kind::expr_assign_sub: - case ast::kind::expr_assign_mul: - case ast::kind::expr_assign_div: - case ast::kind::expr_assign_mod: - case ast::kind::expr_assign_shift_left: - case ast::kind::expr_assign_shift_right: - case ast::kind::expr_assign_bitwise_or: - case ast::kind::expr_assign_bitwise_and: - case ast::kind::expr_assign_bitwise_exor: - process_expr_assign(stmt->expr.as_assign); - break; - default: - break; - } -} - -void decompiler::process_stmt_endon(const ast::stmt_endon::ptr& stmt) -{ - process_expr(stmt->event); - process_expr(stmt->obj); -} - -void decompiler::process_stmt_notify(const ast::stmt_notify::ptr& stmt) -{ - process_expr_arguments(stmt->args); - process_expr(stmt->event); - process_expr(stmt->obj); -} - -void decompiler::process_stmt_wait(const ast::stmt_wait::ptr& stmt) -{ - process_expr(stmt->time); -} - -void decompiler::process_stmt_waittill(const ast::stmt_waittill::ptr& stmt) -{ - process_expr(stmt->event); - process_expr(stmt->obj); - - for (auto& entry : stmt->args->list) - { - process_expr(entry); - } -} - -void decompiler::process_stmt_waittillmatch(const ast::stmt_waittillmatch::ptr& stmt) -{ - process_expr(stmt->event); - process_expr(stmt->obj); - process_expr_arguments(stmt->args); -} - -void decompiler::process_stmt_if(const ast::stmt_if::ptr& stmt) -{ - process_expr(stmt->test); - process_stmt(stmt->stmt); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list[0].as_node->is_special_stmt_dev()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_ifelse(const ast::stmt_ifelse::ptr& stmt) -{ - process_expr(stmt->test); - process_stmt(stmt->stmt_if); - process_stmt(stmt->stmt_else); - - if (stmt->stmt_if.as_list->list.size() == 1 && !stmt->stmt_if.as_list->list[0].as_node->is_special_stmt_dev()) - { - stmt->stmt_if = std::move(stmt->stmt_if.as_list->list.back()); - } - - if (stmt->stmt_else.as_list->list.size() == 1 && !stmt->stmt_else.as_list->list[0].as_node->is_special_stmt_dev_noif()) - { - stmt->stmt_else = std::move(stmt->stmt_else.as_list->list.back()); - } -} - -void decompiler::process_stmt_while(const ast::stmt_while::ptr& stmt) -{ - if (stmt->test == ast::kind::expr_integer && stmt->test.as_integer->value == "1") - { - stmt->test = ast::expr(std::make_unique()); - } - - process_expr(stmt->test); - process_stmt(stmt->stmt); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list[0].as_node->is_special_stmt_dev()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt) -{ - process_expr(stmt->test); - process_stmt(stmt->stmt); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list[0].as_node->is_special_stmt_dev()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_for(const ast::stmt_for::ptr& stmt) -{ - process_stmt(stmt->init); - process_expr(stmt->test); - process_stmt(stmt->stmt); - process_stmt(stmt->iter); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list[0].as_node->is_special_stmt_dev()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_foreach(const ast::stmt_foreach::ptr& stmt) -{ - process_expr(stmt->array_expr); - process_expr(stmt->value_expr); - process_expr(stmt->key_expr); - process_stmt(stmt->stmt); - - if (stmt->stmt.as_list->list.size() == 1 && !stmt->stmt.as_list->list.at(0).as_node->is_special_stmt_dev()) - { - stmt->stmt = std::move(stmt->stmt.as_list->list.back()); - } -} - -void decompiler::process_stmt_switch(const ast::stmt_switch::ptr& stmt) -{ - process_expr(stmt->test); - process_stmt_cases(stmt->stmt); -} - -void decompiler::process_stmt_cases(const ast::stmt_list::ptr& stmt) -{ - for (auto& entry : stmt->list) - { - if (entry == ast::kind::stmt_case) - { - process_stmt_list(entry.as_case->stmt); - } - else if (entry == ast::kind::stmt_default) - { - process_stmt_list(entry.as_default->stmt); - } - } -} - -void decompiler::process_stmt_return(const ast::stmt_return::ptr& stmt) -{ - if (stmt->expr != ast::kind::null) - { - if (retbool_ && retnum_ > 1) - { - if (stmt->expr.as_integer->value == "1") - { - stmt->expr = ast::expr(std::make_unique()); - } - else - { - stmt->expr = ast::expr(std::make_unique()); - } - } - else - process_expr(stmt->expr); - } -} - -void decompiler::process_expr(const ast::expr& expr) -{ - switch (expr.kind()) - { - case ast::kind::expr_ternary: - process_expr_ternary(expr.as_ternary); - break; - case ast::kind::expr_and: - process_expr_and(expr.as_and); - break; - case ast::kind::expr_or: - process_expr_or(expr.as_or); - break; - case ast::kind::expr_equality: - case ast::kind::expr_inequality: - case ast::kind::expr_less: - case ast::kind::expr_greater: - case ast::kind::expr_less_equal: - case ast::kind::expr_greater_equal: - case ast::kind::expr_bitwise_or: - case ast::kind::expr_bitwise_and: - case ast::kind::expr_bitwise_exor: - case ast::kind::expr_shift_left: - case ast::kind::expr_shift_right: - case ast::kind::expr_add: - case ast::kind::expr_sub: - case ast::kind::expr_mul: - case ast::kind::expr_div: - case ast::kind::expr_mod: - process_expr_binary(expr.as_binary); - break; - case ast::kind::expr_complement: - process_expr_complement(expr.as_complement); - break; - case ast::kind::expr_not: - process_expr_not(expr.as_not); - break; - case ast::kind::expr_call: - process_expr_call(expr.as_call); - break; - case ast::kind::expr_method: - process_expr_method(expr.as_method); - break; - case ast::kind::expr_getnextarraykey: - process_expr(expr.as_getnextarraykey->arg2); - process_expr(expr.as_getnextarraykey->arg1); - break; - case ast::kind::expr_getfirstarraykey: - process_expr(expr.as_getfirstarraykey->arg); - break; - case ast::kind::expr_getdvarcoloralpha: - process_expr(expr.as_getdvarcoloralpha->arg); - break; - case ast::kind::expr_getdvarcolorblue: - process_expr(expr.as_getdvarcolorblue->arg); - break; - case ast::kind::expr_getdvarcolorgreen: - process_expr(expr.as_getdvarcolorgreen->arg); - break; - case ast::kind::expr_getdvarcolorred: - process_expr(expr.as_getdvarcolorred->arg); - break; - case ast::kind::expr_getdvarvector: - process_expr(expr.as_getdvarvector->arg); - break; - case ast::kind::expr_getdvarfloat: - process_expr(expr.as_getdvarfloat->arg); - break; - case ast::kind::expr_getdvarint: - process_expr(expr.as_getdvarint->arg); - break; - case ast::kind::expr_getdvar: - process_expr(expr.as_getdvar->arg); - break; - case ast::kind::expr_abs: - process_expr(expr.as_abs->arg); - break; - case ast::kind::expr_vectortoangles: - process_expr(expr.as_vectortoangles->arg); - break; - case ast::kind::expr_angleclamp180: - process_expr(expr.as_angleclamp180->arg); - break; - case ast::kind::expr_anglestoforward: - process_expr(expr.as_anglestoforward->arg); - break; - case ast::kind::expr_anglestoright: - process_expr(expr.as_anglestoright->arg); - break; - case ast::kind::expr_anglestoup: - process_expr(expr.as_anglestoup->arg); - break; - case ast::kind::expr_vectorscale: - process_expr(expr.as_vectorscale->arg2); - process_expr(expr.as_vectorscale->arg1); - break; - case ast::kind::expr_isdefined: - process_expr(expr.as_isdefined->arg); - break; - case ast::kind::expr_array: - process_array_variable(expr.as_array); - break; - case ast::kind::expr_field: - process_field_variable(expr.as_field); - break; - case ast::kind::expr_size: - process_expr_size(expr.as_size); - break; - case ast::kind::expr_vector: - process_expr_vector(expr.as_vector); - break; - default: - break; - } -} - -void decompiler::process_expr_assign(ast::expr_assign::ptr& expr) -{ - process_expr(expr->rvalue); - process_expr(expr->lvalue); - - if (expr->kind() == ast::kind::expr_assign_equal) - { - switch (expr->rvalue.kind()) - { - case ast::kind::expr_bitwise_or: - if (expr->lvalue == expr->rvalue.as_bitwise_or->lvalue) - expr = std::make_unique(std::move(expr->lvalue), std::move(expr->rvalue.as_bitwise_or->rvalue)); - break; - case ast::kind::expr_bitwise_and: - if (expr->lvalue == expr->rvalue.as_bitwise_and->lvalue) - expr = std::make_unique(std::move(expr->lvalue), std::move(expr->rvalue.as_bitwise_and->rvalue)); - break; - case ast::kind::expr_bitwise_exor: - if (expr->lvalue == expr->rvalue.as_bitwise_exor->lvalue) - expr = std::make_unique(std::move(expr->lvalue), std::move(expr->rvalue.as_bitwise_exor->rvalue)); - break; - case ast::kind::expr_shift_left: - if (expr->lvalue == expr->rvalue.as_shift_left->lvalue) - expr = std::make_unique(std::move(expr->lvalue), std::move(expr->rvalue.as_shift_left->rvalue)); - break; - case ast::kind::expr_shift_right: - if (expr->lvalue == expr->rvalue.as_shift_right->lvalue) - expr = std::make_unique(std::move(expr->lvalue), std::move(expr->rvalue.as_shift_right->rvalue)); - break; - case ast::kind::expr_add: - if (expr->lvalue == expr->rvalue.as_add->lvalue) - expr = std::make_unique(std::move(expr->lvalue), std::move(expr->rvalue.as_add->rvalue)); - break; - case ast::kind::expr_sub: - if (expr->lvalue == expr->rvalue.as_sub->lvalue) - expr = std::make_unique(std::move(expr->lvalue), std::move(expr->rvalue.as_sub->rvalue)); - break; - case ast::kind::expr_mul: - if (expr->lvalue == expr->rvalue.as_mul->lvalue) - expr = std::make_unique(std::move(expr->lvalue), std::move(expr->rvalue.as_mul->rvalue)); - break; - case ast::kind::expr_div: - if (expr->lvalue == expr->rvalue.as_div->lvalue) - expr = std::make_unique(std::move(expr->lvalue), std::move(expr->rvalue.as_div->rvalue)); - break; - case ast::kind::expr_mod: - if (expr->lvalue == expr->rvalue.as_mod->lvalue) - expr = std::make_unique(std::move(expr->lvalue), std::move(expr->rvalue.as_mod->rvalue)); - break; - default: - break; - } - } -} - -void decompiler::process_expr_increment(const ast::expr_increment::ptr& expr) -{ - process_expr(expr->lvalue); -} - -void decompiler::process_expr_decrement(const ast::expr_decrement::ptr& expr) -{ - process_expr(expr->lvalue); -} - -void decompiler::process_expr_ternary(const ast::expr_ternary::ptr& expr) -{ - process_expr(expr->test); - process_expr(expr->true_expr); - process_expr(expr->false_expr); -} - -void decompiler::process_expr_binary(const ast::expr_binary::ptr& expr) -{ - process_expr(expr->lvalue); - process_expr(expr->rvalue); - - auto prec = expr->lvalue.as_node->precedence(); - - if (prec && prec < expr->precedence()) - { - expr->lvalue = ast::expr(std::make_unique(std::move(expr->lvalue))); - } - - prec = expr->rvalue.as_node->precedence(); - - if ((prec && prec < expr->precedence()) || (prec == expr->precedence() && expr->kind() == expr->rvalue.as_node->kind())) - { - expr->rvalue = ast::expr(std::make_unique(std::move(expr->rvalue))); - } -} - -void decompiler::process_expr_and(const ast::expr_and::ptr& expr) -{ - process_expr(expr->lvalue); - process_expr(expr->rvalue); - - auto prec = expr->lvalue.as_node->precedence(); - - if (prec && prec < expr->precedence()) - { - expr->lvalue = ast::expr(std::make_unique(std::move(expr->lvalue))); - } - - prec = expr->rvalue.as_node->precedence(); - - if ((prec && prec < expr->precedence()) || (prec == expr->precedence() && expr->kind() == expr->rvalue.kind())) - { - expr->rvalue = ast::expr(std::make_unique(std::move(expr->rvalue))); - } -} - -void decompiler::process_expr_or(const ast::expr_or::ptr& expr) -{ - process_expr(expr->lvalue); - process_expr(expr->rvalue); -} - -void decompiler::process_expr_complement(const ast::expr_complement::ptr& expr) -{ - process_expr(expr->rvalue); - - if (expr->rvalue.as_node->is_binary()) - { - expr->rvalue = ast::expr(std::make_unique(std::move(expr->rvalue))); - } -} - -void decompiler::process_expr_not(const ast::expr_not::ptr& expr) -{ - process_expr(expr->rvalue); - - if (expr->rvalue.as_node->is_binary()) - { - expr->rvalue = ast::expr(std::make_unique(std::move(expr->rvalue))); - } -} - -void decompiler::process_expr_call(const ast::expr_call::ptr& expr) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_call_pointer(expr->call.as_pointer); - break; - case ast::kind::expr_function: - process_expr_call_function(expr->call.as_function); - break; - default: - break; - } -} - -void decompiler::process_expr_method(const ast::expr_method::ptr& expr) -{ - switch (expr->call.kind()) - { - case ast::kind::expr_pointer: - process_expr_method_pointer(expr->call.as_pointer, expr->obj); - break; - case ast::kind::expr_function: - process_expr_method_function(expr->call.as_function, expr->obj); - break; - default: - break; - } -} - -void decompiler::process_expr_call_pointer(const ast::expr_pointer::ptr& expr) -{ - process_expr_arguments(expr->args); - process_expr(expr->func); -} - -void decompiler::process_expr_call_function(const ast::expr_function::ptr& expr) -{ - process_expr_arguments(expr->args); -} - -void decompiler::process_expr_method_pointer(const ast::expr_pointer::ptr& expr, ast::expr& obj) -{ - process_expr_arguments(expr->args); - process_expr(obj); - process_expr(expr->func); -} - -void decompiler::process_expr_method_function(const ast::expr_function::ptr& expr, ast::expr& obj) -{ - process_expr_arguments(expr->args); - process_expr(obj); -} - -void decompiler::process_expr_arguments(const ast::expr_arguments::ptr& expr) -{ - for (auto i = expr->list.size(); i > 0; i--) - { - process_expr(expr->list.at(i - 1)); - } -} - -void decompiler::process_expr_size(const ast::expr_size::ptr& expr) -{ - process_expr(expr->obj); -} - -void decompiler::process_array_variable(const ast::expr_array::ptr& expr) -{ - process_expr(expr->key); - process_expr(expr->obj); -} - -void decompiler::process_field_variable(const ast::expr_field::ptr& expr) -{ - process_expr(expr->obj); -} - -void decompiler::process_expr_vector(const ast::expr_vector::ptr& expr) -{ - process_expr(expr->z); - process_expr(expr->y); - process_expr(expr->x); -} - -void decompiler::process_expr_parameters(const ast::expr_parameters::ptr& expr) -{ - if (expr->list.empty()) return; - - while (!func_->stmt->list.empty()) - { - auto& stmt = func_->stmt->list.at(0); - - if (stmt != ast::kind::stmt_if || stmt.as_if->test != ast::kind::expr_not) - return; - - auto& test = stmt.as_if->test.as_not->rvalue; - - if (test != ast::kind::expr_isdefined || test.as_isdefined->arg != ast::kind::expr_identifier) - return; - - if (stmt.as_if->stmt != ast::kind::stmt_assign || stmt.as_if->stmt.as_assign->expr != ast::kind::expr_assign_equal) - return; - - if (test.as_isdefined->arg != stmt.as_if->stmt.as_assign->expr.as_assign_equal->lvalue) - return; - - auto index = 0u; - - for (auto& entry : expr->list) - { - if (entry == ast::kind::expr_identifier && entry.as_identifier->value == test.as_isdefined->arg.as_identifier->value) - { - expr->list.erase(expr->list.begin() + index); - expr->list.insert(expr->list.begin() + index, std::move(stmt.as_if->stmt.as_assign->expr)); - func_->stmt->list.erase(func_->stmt->list.begin()); - break; - } - index++; - } - - if (index == expr->list.size()) return; - } -} - -} // namespace xsk::arc::t6 diff --git a/src/t6/disassembler.cpp b/src/t6/disassembler.cpp deleted file mode 100644 index 0ae0b556..00000000 --- a/src/t6/disassembler.cpp +++ /dev/null @@ -1,710 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#include "xsk/stdinc.hpp" -#include "xsk/t6/t6.hpp" - -namespace xsk::arc::t6 -{ - -auto disassembler::output() -> assembly::ptr -{ - return std::move(assembly_); -} - -auto disassembler::output_raw() -> std::vector -{ - output_ = std::make_unique(); - - output_->write_string("// T6 GSC ASSEMBLY\n"); - output_->write_string("// Disassembled by https://github.com/xensik/gsc-tool\n"); - - for (const auto& func : assembly_->functions) - { - this->print_function(func); - } - - std::vector output; - - output.resize(output_->pos()); - std::memcpy(output.data(), output_->data(), output.size()); - - return output; -} - -void disassembler::disassemble(const std::string& file, std::vector& data) -{ - filename_ = file; - script_ = std::make_unique(data); - assembly_ = std::make_unique(); - exports_.clear(); - imports_.clear(); - strings_.clear(); - animtrees_.clear(); - stringlist_.clear(); - string_refs_.clear(); - anim_refs_.clear(); - import_refs_.clear(); - labels_.clear(); - std::memset(&header_, 0, sizeof(header_)); - - // header - header_.magic = script_->read(); - - if (header_.magic != magic) - { - throw error("invalid binary gsc file '" + filename_ + "'!"); - } - - header_.source_crc = script_->read(); - header_.include_offset = script_->read(); - header_.animtree_offset = script_->read(); - header_.cseg_offset = script_->read(); - header_.stringtablefixup_offset = script_->read(); - header_.exports_offset = script_->read(); - header_.imports_offset = script_->read(); - header_.fixup_offset = script_->read(); - header_.profile_offset = script_->read(); - header_.cseg_size = script_->read(); - header_.name = script_->read(); - header_.stringtablefixup_count = script_->read(); - header_.exports_count = script_->read(); - header_.imports_count = script_->read(); - header_.fixup_count = script_->read(); - header_.profile_count = script_->read(); - header_.include_count = script_->read(); - header_.animtree_count = script_->read(); - header_.flags = script_->read(); - - // string list - script_->pos(64); - - while (script_->pos() < header_.include_offset) - { - auto pos = script_->pos(); - stringlist_.insert({ pos, script_->read_cstr() }); - } - - // include list - script_->pos(header_.include_offset); - - for (auto i = 0; i < header_.include_count; i++) - { - assembly_->includes.push_back(stringlist_.at(script_->read())); - } - - // animtree list - script_->pos(header_.animtree_offset); - - for (auto i = 0; i < header_.animtree_count; i++) - { - auto entry = std::make_shared(); - entry->name = stringlist_.at(script_->read()); - auto ref_count = script_->read(); - auto anim_count = script_->read(); - script_->seek(2); - - for (auto j = 0; j < ref_count; j++) - { - auto ref = script_->read(); - entry->refs.push_back(ref); - anim_refs_.insert({ ref, entry }); - } - - for (auto k = 0; k < anim_count; k++) - { - auto name = stringlist_.at(script_->read()); - auto ref = script_->read(); - entry->anims.push_back({ name, ref }); - } - - for (auto& anim : entry->anims) - { - anim_refs_.insert({ anim.ref, entry }); - } - - animtrees_.push_back(entry); - } - - // stringtable list - script_->pos(header_.stringtablefixup_offset); - - for (auto i = 0; i < header_.stringtablefixup_count; i++) - { - auto entry = std::make_shared(); - entry->name = stringlist_.at(script_->read()); - auto ref_count = script_->read(); - entry->type = script_->read(); - - for (auto j = 0; j < ref_count; j++) - { - auto ref = script_->read(); - entry->refs.push_back(ref); - string_refs_.insert({ ref, entry }); - } - - strings_.push_back(entry); - } - - // import list - script_->pos(header_.imports_offset); - - for (auto i = 0; i < header_.imports_count; i++) - { - auto entry = std::make_shared(); - entry->name = stringlist_.at(script_->read()); - entry->space = stringlist_.at(script_->read()); - auto ref_count = script_->read(); - entry->params = script_->read(); - entry->flags = script_->read(); - - for (auto j = 0; j < ref_count; j++) - { - auto ref = script_->read(); - entry->refs.push_back(ref); - import_refs_.insert({ ref, entry }); - } - - imports_.push_back(entry); - } - - // export list - script_->pos(header_.exports_offset); - - for (auto i = 0; i < header_.exports_count; i++) - { - auto entry = std::make_shared(); - entry->checksum = script_->read(); - entry->offset = script_->read(); - entry->name = stringlist_.at(script_->read()); - entry->space = ""; - entry->params = script_->read(); - entry->flags = script_->read(); - exports_.push_back(entry); - } - - for (auto i = 0u; i < exports_.size(); i++) - { - auto& entry = exports_[i]; - - if (i < exports_.size() - 1) - { - entry->size = (exports_[i+1]->offset - entry->offset); - - auto end_pos = entry->offset + entry->size - 4; - - script_->pos(end_pos); - - if (script_->read() == 0) - { - entry->size -= 4; - - for (auto j = 1; j < 4; j++) - { - script_->pos(end_pos - j); - auto op = script_->read(); - - if (op <= 0x01) break; - - entry->size--; - } - } - } - else - { - entry->size = (header_.cseg_offset + header_.cseg_size) - entry->offset; - } - - script_->pos(entry->offset); - - assembly_->functions.push_back(std::make_unique()); - auto& func = assembly_->functions.back(); - func->index = static_cast(script_->pos()); - func->size = entry->size; - func->params = entry->params; - func->flags = entry->flags; - func->name = entry->name; - - this->disassemble_function(func); - - func->labels = labels_; - labels_.clear(); - } -} - -void disassembler::disassemble_function(const function::ptr& func) -{ - auto size = func->size; - - while (size > 0) - { - func->instructions.push_back(std::make_unique()); - auto& inst = func->instructions.back(); - inst->index = static_cast(script_->pos()); - inst->opcode = script_->read(); - inst->size = opcode_size(inst->opcode); - - if (size < 4 && inst->opcode >= std::uint8_t(opcode::OP_Count)) - { - func->instructions.pop_back(); - break; - } - - this->disassemble_instruction(inst); - size -= inst->size; - } - - for (auto i = func->instructions.size() - 1; i >= 1; i--) - { - auto& inst = func->instructions.at(i); - auto& last = func->instructions.at(i-1); - - if (labels_.contains(inst->index)) - break; - - if (inst->opcode <= 0x01 && (last->opcode > 0x01)) - break; - - func->instructions.pop_back(); - } -} - -void disassembler::disassemble_instruction(const instruction::ptr& inst) -{ - switch (static_cast(inst->opcode)) - { - case opcode::OP_End: - case opcode::OP_Return: - case opcode::OP_GetUndefined: - case opcode::OP_GetZero: - case opcode::OP_GetLevelObject: - case opcode::OP_GetAnimObject: - case opcode::OP_GetSelf: - case opcode::OP_GetLevel: - case opcode::OP_GetGame: - case opcode::OP_GetAnim: - case opcode::OP_GetGameRef: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_ClearArray: - case opcode::OP_EmptyArray: - case opcode::OP_GetSelfObject: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_ClearParams: - case opcode::OP_CheckClearParams: - case opcode::OP_SetVariableField: - case opcode::OP_Wait: - case opcode::OP_WaitTillFrameEnd: - case opcode::OP_PreScriptCall: - case opcode::OP_DecTop: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - case opcode::OP_BoolNot: - case opcode::OP_BoolComplement: - case opcode::OP_Inc: - case opcode::OP_Dec: - case opcode::OP_Bit_Or: - case opcode::OP_Bit_Xor: - case opcode::OP_Bit_And: - case opcode::OP_Equal: - case opcode::OP_NotEqual: - case opcode::OP_LessThan: - case opcode::OP_GreaterThan: - case opcode::OP_LessThanOrEqualTo: - case opcode::OP_GreaterThanOrEqualTo: - case opcode::OP_ShiftLeft: - case opcode::OP_ShiftRight: - case opcode::OP_Plus: - case opcode::OP_Minus: - case opcode::OP_Multiply: - case opcode::OP_Divide: - case opcode::OP_Modulus: - case opcode::OP_SizeOf: - case opcode::OP_WaitTill: - case opcode::OP_Notify: - case opcode::OP_EndOn: - case opcode::OP_VoidCodePos: - case opcode::OP_Vector: - case opcode::OP_RealWait: - case opcode::OP_IsDefined: - case opcode::OP_VectorScale: - case opcode::OP_AnglesToUp: - case opcode::OP_AnglesToRight: - case opcode::OP_AnglesToForward: - case opcode::OP_AngleClamp180: - case opcode::OP_VectorToAngles: - case opcode::OP_Abs: - case opcode::OP_GetTime: - case opcode::OP_GetDvar: - case opcode::OP_GetDvarInt: - case opcode::OP_GetDvarFloat: - case opcode::OP_GetDvarVector: - case opcode::OP_GetDvarColorRed: - case opcode::OP_GetDvarColorGreen: - case opcode::OP_GetDvarColorBlue: - case opcode::OP_GetDvarColorAlpha: - case opcode::OP_FirstArrayKey: - case opcode::OP_NextArrayKey: - case opcode::OP_ProfileStart: - case opcode::OP_ProfileStop: - case opcode::OP_SafeDecTop: - case opcode::OP_Nop: - case opcode::OP_Abort: - case opcode::OP_Object: - case opcode::OP_ThreadObject: - case opcode::OP_EvalLocalVariable: - case opcode::OP_EvalLocalVariableRef: - break; - case opcode::OP_GetByte: - case opcode::OP_GetNegByte: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetUnsignedShort: - case opcode::OP_GetNegUnsignedShort: - inst->size += script_->align(2); - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetInteger: - inst->size += script_->align(4); - disassemble_animtree(inst); - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetFloat: - inst->size += script_->align(4); - inst->data.push_back(utils::string::float_string(script_->read())); - break; - case opcode::OP_GetVector: - inst->size += script_->align(4); - inst->data.push_back(utils::string::float_string(script_->read())); - inst->data.push_back(utils::string::float_string(script_->read())); - inst->data.push_back(utils::string::float_string(script_->read())); - break; - case opcode::OP_GetString: - case opcode::OP_GetIString: - disassemble_string(inst); - break; - case opcode::OP_GetAnimation: - disassemble_animation(inst); - break; - case opcode::OP_WaitTillMatch: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_VectorConstant: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetHash: - inst->size += script_->align(4); - inst->data.push_back(resolver::dvar_name(script_->read())); - break; - case opcode::OP_SafeCreateLocalVariables: - disassemble_localvars(inst); - break; - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_EvalLocalVariableRefCached: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_ClearFieldVariable: - disassemble_string(inst); - break; - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - inst->data.push_back(utils::string::va("%i", script_->read())); - break; - case opcode::OP_GetFunction: - disassemble_import(inst); - break; - case opcode::OP_CallBuiltin: - case opcode::OP_CallBuiltinMethod: - case opcode::OP_ScriptFunctionCall: - case opcode::OP_ScriptMethodCall: - case opcode::OP_ScriptThreadCall: - case opcode::OP_ScriptMethodThreadCall: - script_->seek(1); - disassemble_import(inst); - break; - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_Jump: - case opcode::OP_JumpBack: - case opcode::OP_DevblockBegin: - disassemble_jump(inst); - break; - case opcode::OP_Switch: - disassemble_switch(inst); - break; - case opcode::OP_EndSwitch: - disassemble_end_switch(inst); - break; - default: - throw disasm_error(utils::string::va("unhandled opcode 0x%X at index '%04X'!", inst->opcode, inst->index)); - } -} - -void disassembler::disassemble_string(const instruction::ptr& inst) -{ - inst->size += script_->align(2); - - const auto entry = string_refs_.find(script_->pos()); - - if (entry != string_refs_.end()) - { - inst->data.push_back(entry->second->name); - script_->seek(2); - return; - } - - throw disasm_error(utils::string::va("string reference not found at index '%04X'!", inst->index)); -} - -void disassembler::disassemble_animtree(const instruction::ptr& inst) -{ - // GetInteger(-1) push animtree name if ref found - - const auto ref = script_->pos(); - const auto entry = anim_refs_.find(ref); - - if (entry != anim_refs_.end()) - { - inst->data.push_back(entry->second->name); - } -} - -void disassembler::disassemble_animation(const instruction::ptr& inst) -{ - inst->size += script_->align(4); - - const auto ref = script_->pos(); - const auto entry = anim_refs_.find(ref); - - if (entry != anim_refs_.end()) - { - inst->data.push_back(entry->second->name); - - for (const auto& anim : entry->second->anims) - { - if (anim.ref == ref) - { - inst->data.push_back(anim.name); - script_->seek(4); - return; - } - } - } - - throw disasm_error(utils::string::va("animation reference not found at index '%04X'!", inst->index)); -} - -void disassembler::disassemble_localvars(const instruction::ptr& inst) -{ - const auto count = script_->read(); - - for (auto i = 0u; i < count; i++) - { - disassemble_string(inst); - inst->size += 2; - } -} - -void disassembler::disassemble_import(const instruction::ptr& inst) -{ - inst->size += script_->align(4); - script_->seek(4); - - const auto entry = import_refs_.find(inst->index); - - if (entry != import_refs_.end()) - { - inst->data.push_back(entry->second->space); - inst->data.push_back(entry->second->name); - return; - } - - throw disasm_error(utils::string::va("import reference not found at index '%04X'!", inst->index)); -} - -void disassembler::disassemble_jump(const instruction::ptr& inst) -{ - inst->size += script_->align(2); - - const auto addr = script_->read() + script_->pos(); - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); -} - -void disassembler::disassemble_switch(const instruction::ptr& inst) -{ - inst->size += script_->align(4); - - const auto addr = script_->read() + script_->pos(); - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); -} - -void disassembler::disassemble_end_switch(const instruction::ptr& inst) -{ - inst->size += script_->align(4); - - const auto itr = labels_.find(script_->pos()); - - if (itr != labels_.end()) - { - for (const auto& entry : assembly_->functions.back()->instructions) - { - if (opcode(entry->opcode) == opcode::OP_Switch) - { - if (entry->data[0] == itr->second) - { - labels_.erase(script_->pos()); - - const auto label = utils::string::va("loc_%X", inst->index); - const auto itr2 = labels_.find(inst->index); - - if (itr2 == labels_.end()) - { - labels_.insert({ inst->index, label }); - } - - entry->data[0] = label; - break; - } - } - } - } - - auto numerical = false; - const auto count = script_->read(); - inst->data.push_back(utils::string::va("%i", count)); - - for (auto i = 0u; i < count; i++) - { - const auto value = script_->read(); - - if (value < 0x40000 && value > 0) - { - inst->data.push_back("case"); - const auto& entry = string_refs_.at(script_->pos() - 2); - inst->data.push_back(entry->name); - } - else if (value == 0) - { - inst->data.push_back("default"); - } - else - { - numerical = true; - inst->data.push_back("case"); - inst->data.push_back(utils::string::va("%i", (value - 0x800000) & 0xFFFFFF)); - } - - const auto addr = script_->read() + script_->pos(); - const auto label = utils::string::va("loc_%X", addr); - - inst->data.push_back(label); - labels_.insert({ addr, label }); - - inst->size += 8; - } - - inst->data.push_back((numerical) ? "i" : "s"); -} - -void disassembler::print_function(const function::ptr& func) -{ - output_->write_string("\n"); - output_->write_string(utils::string::va("sub_%s %i %i\n", func->name.data(), func->params, func->flags)); - - for (const auto& inst : func->instructions) - { - const auto itr = func->labels.find(inst->index); - - if (itr != func->labels.end()) - { - output_->write_string(utils::string::va("\t%s\n", itr->second.data())); - } - - this->print_instruction(inst); - } - - output_->write_string(utils::string::va("end_%s\n", func->name.data())); -} - -void disassembler::print_instruction(const instruction::ptr& inst) -{ - output_->write_string(utils::string::va("\t\t%s(", resolver::opcode_name(inst->opcode).data())); - - switch (static_cast(inst->opcode)) - { - case opcode::OP_GetHash: - case opcode::OP_GetString: - case opcode::OP_GetIString: - case opcode::OP_ClearFieldVariable: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - output_->write_string(utils::string::va("\"%s\"", inst->data[0].data())); - break; - case opcode::OP_GetAnimation: - case opcode::OP_GetFunction: - case opcode::OP_CallBuiltin: - case opcode::OP_CallBuiltinMethod: - case opcode::OP_ScriptFunctionCall: - case opcode::OP_ScriptMethodCall: - case opcode::OP_ScriptThreadCall: - case opcode::OP_ScriptMethodThreadCall: - output_->write_string(utils::string::va("\"%s\", \"%s\"", inst->data[0].data(), inst->data[1].data())); - break; - case opcode::OP_SafeCreateLocalVariables: - for (const auto& data : inst->data) - { - output_->write_string(utils::string::va("\"%s\"%s", data.data(), &data == &inst->data.back() ? "" : ", ")); - } - break; - case opcode::OP_EndSwitch: - output_->write_string(utils::string::va("%s", inst->data[0].data())); - { - std::uint32_t totalcase = std::stoul(inst->data[0]); - auto numerical = inst->data.back() == "i"; - auto index = 0; - for (auto casenum = 0u; casenum < totalcase; casenum++) - { - if (inst->data[1 + index] == "case") - { - auto fmt = numerical ? ", %s, %s, %s"s : ", %s, \"%s\", %s"s; - output_->write_string(utils::string::va(fmt, inst->data[1 + index].data(), inst->data[1 + index + 1].data(), inst->data[1 + index + 2].data())); - index += 3; - } - else if (inst->data[1 + index] == "default") - { - output_->write_string(utils::string::va(", %s, %s", inst->data[1 + index].data(), inst->data[1 + index + 1].data())); - index += 2; - } - } - } - break; - default: - for (const auto& data : inst->data) - { - output_->write_string(utils::string::va("%s%s", data.data(), &data == &inst->data.back() ? "" : ", ")); - } - break; - } - - output_->write_string(");\n"); -} - -} // namespace xsk::arc::t6 diff --git a/src/t6/lexer.cpp b/src/t6/lexer.cpp deleted file mode 100644 index f54947b4..00000000 --- a/src/t6/lexer.cpp +++ /dev/null @@ -1,880 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#include "xsk/stdinc.hpp" -#include "xsk/t6/t6.hpp" -#include "xsk/t6/parser.hpp" -#include "xsk/t6/lexer.hpp" - -xsk::arc::t6::parser::symbol_type T6lex(xsk::arc::t6::lexer& lexer) -{ - return lexer.lex(); -} - -namespace xsk::arc::t6 -{ - -const std::unordered_map keyword_map -{{ - { "#define", parser::token::SH_DEFINE }, - { "#undef", parser::token::SH_UNDEF }, - { "#ifdef", parser::token::SH_IFDEF }, - { "#ifndef", parser::token::SH_IFNDEF }, - { "#if", parser::token::SH_IF }, - { "#elif", parser::token::SH_ELIF }, - { "#else", parser::token::SH_ELSE }, - { "#endif", parser::token::SH_ENDIF }, - { "#inline", parser::token::INLINE }, - { "#include", parser::token::INCLUDE }, - { "#using_animtree", parser::token::USINGTREE }, - { "#animtree", parser::token::ANIMTREE }, - { "autoexec", parser::token::AUTOEXEC }, - { "codecall", parser::token::CODECALL }, - { "private", parser::token::PRIVATE }, - { "endon", parser::token::ENDON }, - { "notify", parser::token::NOTIFY }, - { "wait", parser::token::WAIT }, - { "waittill", parser::token::WAITTILL }, - { "waittillmatch", parser::token::WAITTILLMATCH }, - { "waittillframeend", parser::token::WAITTILLFRAMEEND }, - { "if", parser::token::IF }, - { "else", parser::token::ELSE }, - { "do", parser::token::DO }, - { "while", parser::token::WHILE }, - { "for", parser::token::FOR }, - { "foreach", parser::token::FOREACH }, - { "in", parser::token::IN }, - { "switch", parser::token::SWITCH }, - { "case", parser::token::CASE }, - { "default", parser::token::DEFAULT }, - { "break", parser::token::BREAK }, - { "continue", parser::token::CONTINUE }, - { "return", parser::token::RETURN }, - { "prof_begin", parser::token::PROFBEGIN }, - { "prof_end", parser::token::PROFEND }, - { "thread", parser::token::THREAD }, - { "true", parser::token::TRUE }, - { "false", parser::token::FALSE }, - { "undefined", parser::token::UNDEFINED }, - { "size", parser::token::SIZE }, - { "game", parser::token::GAME }, - { "self", parser::token::SELF }, - { "anim", parser::token::ANIM }, - { "level", parser::token::LEVEL }, - { "const", parser::token::CONST }, - { "isdefined", parser::token::ISDEFINED }, - { "vectorscale", parser::token::VECTORSCALE }, - { "anglestoup", parser::token::ANGLESTOUP }, - { "anglestoright", parser::token::ANGLESTORIGHT }, - { "anglestoforward", parser::token::ANGLESTOFORWARD }, - { "angleclamp180", parser::token::ANGLECLAMP180 }, - { "vectortoangles", parser::token::VECTORTOANGLES }, - { "abs", parser::token::ABS }, - { "gettime", parser::token::GETTIME }, - { "getdvar", parser::token::GETDVAR }, - { "getdvarint", parser::token::GETDVARINT }, - { "getdvarfloat", parser::token::GETDVARFLOAT }, - { "getdvarvector", parser::token::GETDVARVECTOR }, - { "getdvarcolorred", parser::token::GETDVARCOLORRED }, - { "getdvarcolorgreen", parser::token::GETDVARCOLORGREEN }, - { "getdvarcolorblue", parser::token::GETDVARCOLORBLUE }, - { "getdvarcoloralpha", parser::token::GETDVARCOLORALPHA }, - { "getfirstarraykey", parser::token::GETFIRSTARRAYKEY }, - { "getnextarraykey", parser::token::GETNEXTARRAYKEY }, -}}; - -buffer::buffer() : length(0) -{ - data = static_cast(std::malloc(max_buf_size)); -} - -buffer::~buffer() -{ - if (data) std::free(data); -} - -bool buffer::push(char c) -{ - if (length >= max_buf_size) - return false; - - data[length++] = c; - return true; -} - -reader::reader() : buffer_pos(0), bytes_remaining(0), last_byte(0), current_byte(0), state(reader::end) -{ - -} - -void reader::init(const char* data, size_t size) -{ - if (data && size) - { - state = reader::ok; - buffer_pos = data; - bytes_remaining = static_cast(size); - last_byte = 0; - current_byte = *data; - } - else - { - state = reader::end; - buffer_pos = 0; - bytes_remaining = 0; - last_byte = 0; - current_byte = 0; - } -} - -void reader::advance() -{ - ++buffer_pos; - - if (bytes_remaining-- == 1) - { - state = reader::end; - bytes_remaining = 0; - last_byte = current_byte; - current_byte = 0; - } - else - { - last_byte = current_byte; - current_byte = *buffer_pos; - } -} - -lexer::lexer(build mode, const std::string& name, const char* data, size_t size) : loc_(location(&name)), - locs_(std::stack()), readers_(std::stack()), header_top_(0), mode_(mode), indev_(false), clean_(true) -{ - reader_.init(data, size); -} - -void lexer::push_header(const std::string& file) -{ - try - { - if (header_top_++ >= 10) - throw comp_error(loc_, "maximum gsh depth exceeded '10'"); - - auto data = resolver::file_data(file + ".gsh"); - - readers_.push(reader_); - locs_.push(loc_); - loc_.initialize(std::get<0>(data)); - reader_.init(std::get<1>(data), std::get<2>(data)); - clean_ = true; - } - catch (const std::exception& e) - { - throw error("parsing header file '" + file + "': " + e.what()); - } -} - -void lexer::pop_header() -{ - header_top_--; - loc_ = locs_.top(); - locs_.pop(); - reader_ = readers_.top(); - readers_.pop(); -} - -void lexer::ban_header(const location& loc) -{ - if (header_top_ > 0) - { - throw comp_error(loc, "not allowed inside a gsh file"); - } -} - -auto lexer::lex() -> parser::symbol_type -{ - buffer_.length = 0; - state_ = state::start; - - while (true) - { - const auto& state = reader_.state; - auto& last = reader_.last_byte; - auto& curr = reader_.current_byte; - auto path = false; - loc_.step(); - - if (state == reader::end) - { - if (indev_) - throw comp_error(loc_, "unmatched devblock start ('/#')"); - - if (header_top_ > 0) - pop_header(); - else - return parser::make_T6EOF(loc_); - } - - if (clean_ && last != 0 && last != ' ' && last != '\t' && last != '\n') - clean_ = false; - - advance(); - - switch (last) - { - case ' ': - case '\t': - case '\r': - loc_.step(); - continue; - case '\n': - loc_.lines(); - loc_.step(); - clean_ = true; - continue; - case '\\': - throw comp_error(loc_, "invalid token ('\\')"); - case '/': - if (curr != '=' && curr != '#' && curr != '@' && curr != '*' && curr != '/') - return parser::make_DIV(loc_); - - advance(); - - if (last == '=') - return parser::make_ASSIGN_DIV(loc_); - - if (last == '#') - { - if (indev_) - throw comp_error(loc_, "cannot recurse devblock ('/#')"); - - if (mode_ == build::dev) - { - indev_ = true; - return parser::make_DEVBEGIN(loc_); - } - else - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched devblock start ('/#')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '#' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - } - else if (last == '@') - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched script doc comment start ('/@')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '@' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - else if (last == '*') - { - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched multiline comment start ('/*')"); - - if (curr == '\n') - { - loc_.lines(); - loc_.step(); - } - else if (last == '*' && curr == '/') - { - advance(); - break; - } - - advance(); - } - } - else if (last == '/') - { - while (true) - { - if (state == reader::end) - break; - - if (curr == '\n') - break; - - advance(); - } - } - continue; - case '#': - if (curr == '/') - { - if (!indev_) - throw comp_error(loc_, "unmatched devblock end ('#/')"); - - advance(); - indev_ = false; - return parser::make_DEVEND(loc_); - } - - buffer_.push(last); - advance(); - - while (state == reader::ok) - { - if (last != ' ' || last != '\t') - break; - - advance(); - } - - if (state == reader::end || !((last > 64 && last < 91) || (last > 96 && last < 123))) - throw comp_error(loc_, "invalid preprocessor directive ('#')"); - - state_ = state::preprocessor; - goto lex_name; - case '*': - if (curr != '=' && curr != '/') - return parser::make_MUL(loc_); - - advance(); - - if (last == '=') - return parser::make_ASSIGN_MUL(loc_); - - throw comp_error(loc_, "unmatched multiline comment end ('*/')"); - case '"': - state_ = state::string; - goto lex_string; - case '.': - if (curr < '0' || curr > '9') - return parser::make_DOT(loc_); - goto lex_number; - case '(': - return parser::make_LPAREN(loc_); - case ')': - return parser::make_RPAREN(loc_); - case '{': - return parser::make_LBRACE(loc_); - case '}': - return parser::make_RBRACE(loc_); - case '[': - return parser::make_LBRACKET(loc_); - case ']': - return parser::make_RBRACKET(loc_); - case ',': - return parser::make_COMMA(loc_); - case ';': - return parser::make_SEMICOLON(loc_); - case ':': - if (curr != ':') - return parser::make_COLON(loc_); - - advance(); - return parser::make_DOUBLECOLON(loc_); - case '?': - return parser::make_QMARK(loc_); - case '=': - if (curr != '=') - return parser::make_ASSIGN(loc_); - - advance(); - return parser::make_EQUALITY(loc_); - case '+': - if (curr != '+' && curr != '=') - return parser::make_ADD(loc_); - - advance(); - - if (last == '+') - return parser::make_INCREMENT(loc_); - - return parser::make_ASSIGN_ADD(loc_); - case '-': - if (curr != '-' && curr != '=') - return parser::make_SUB(loc_); - - advance(); - - if (last == '-') - return parser::make_DECREMENT(loc_); - - return parser::make_ASSIGN_SUB(loc_); - case '%': - if (curr != '=') - return parser::make_MOD(loc_); - - advance(); - - return parser::make_ASSIGN_MOD(loc_); - case '|': - if (curr != '|' && curr != '=') - return parser::make_BITWISE_OR(loc_); - - advance(); - - if (last == '|') - return parser::make_OR(loc_); - - return parser::make_ASSIGN_BW_OR(loc_); - case '&': - if (curr != '&' && curr != '=' && curr != '"') - return parser::make_BITWISE_AND(loc_); - - advance(); - - if (last == '&') - return parser::make_AND(loc_); - - if (last == '=') - return parser::make_ASSIGN_BW_AND(loc_); - - state_ = state::localize; - goto lex_string; - case '^': - if (curr != '=') - return parser::make_BITWISE_EXOR(loc_); - - advance(); - return parser::make_ASSIGN_BW_EXOR(loc_); - case '!': - if (curr != '=') - return parser::make_NOT(loc_); - - advance(); - return parser::make_INEQUALITY(loc_); - case '~': - return parser::make_COMPLEMENT(loc_); - case '<': - if (curr != '<' && curr != '=') - return parser::make_LESS(loc_); - - advance(); - if (last == '=') - return parser::make_LESS_EQUAL(loc_); - - if (curr != '=') - return parser::make_LSHIFT(loc_); - - advance(); - return parser::make_ASSIGN_LSHIFT(loc_); - case '>': - if (curr != '>' && curr != '=') - return parser::make_GREATER(loc_); - - advance(); - - if (last == '=') - return parser::make_GREATER_EQUAL(loc_); - - if (curr != '=') - return parser::make_RSHIFT(loc_); - - advance(); - return parser::make_ASSIGN_RSHIFT(loc_); - default: - if (last >= '0' && last <= '9') - goto lex_number; - else if (last == '_' || (last >= 'A' && last <= 'Z') || (last >= 'a' && last <= 'z')) - goto lex_name; - - throw comp_error(loc_, utils::string::va("bad token: \'%c\'", last)); - } - -lex_string: - while (true) - { - if (state == reader::end) - throw comp_error(loc_, "unmatched string start ('\"')"); - - if (curr == '"') - { - advance(); - break; - } - - if (curr == '\n') - throw comp_error(loc_, "unterminated string literal"); - - if (curr == '\\') - { - advance(); - - if (state == reader::end) - throw comp_error(loc_, "invalid token ('\')"); - - char c = curr; - switch (curr) - { - case 't': c = '\t'; break; - case 'r': c = '\r'; break; - case 'n': c = '\n'; break; - case '"': c = '\"'; break; - case '\\': c = '\\'; break; - default: break; - } - - if (!buffer_.push(c)) - throw comp_error(loc_, "max string size exceeded"); - } - else if (!buffer_.push(curr)) - throw comp_error(loc_, "max string size exceeded"); - - advance(); - } - - if (state_ == state::localize) - return parser::make_ISTRING(std::string(buffer_.data, buffer_.length), loc_); - - return parser::make_STRING(std::string(buffer_.data, buffer_.length), loc_); - -lex_name: - buffer_.push(last); - - while (true) - { - if (state == reader::end) - break; - - if (!(curr == '\\' || curr == '_' || (curr > 64 && curr < 91) || (curr > 96 && curr < 123) || (curr > 47 && curr < 58))) - break; - - if (curr == '\\') - { - if (last == '\\') - throw comp_error(loc_, "invalid path '\\\\'"); - - path = true; - if (!buffer_.push('/')) - throw comp_error(loc_, "max string size exceeded"); - } - else if (!buffer_.push(curr)) - throw comp_error(loc_, "max string size exceeded"); - - advance(); - } - - if (state_ == state::preprocessor) - { - auto token = parser::token::T6UNDEF; - - if (buffer_.length < 16) - { - const auto itr = keyword_map.find(std::string_view(buffer_.data, buffer_.length)); - - if (itr != keyword_map.end()) - { - if (itr->second > parser::token::SH_ENDIF) - return parser::symbol_type(itr->second, loc_); - - token = itr->second; - } - } - - preprocessor_run(token); - - state_ = state::start; - continue; - } - else - { - for (auto i = 0u; i < buffer_.length; i++) - { - auto c = buffer_.data[i]; - - if (c > 64 && c < 91) - buffer_.data[i] = c + 32; - } - - if (buffer_.length < 17) - { - const auto itr = keyword_map.find(std::string_view(buffer_.data, buffer_.length)); - - if (itr != keyword_map.end()) - return parser::symbol_type(itr->second, loc_); - } - - if (path) - { - if (buffer_.data[buffer_.length - 1] == '/') - throw comp_error(loc_, "invalid path end '\\'"); - - return parser::make_PATH(resolver::make_token(std::string_view(buffer_.data, buffer_.length)), loc_); - } - - if (std::string_view(buffer_.data, buffer_.length).starts_with("_hash_")) - { - return parser::make_HASH(std::string(&buffer_.data[6], buffer_.length - 6), loc_); - } - - return parser::make_IDENTIFIER(resolver::make_token(std::string_view(buffer_.data, buffer_.length)), loc_); - } - -lex_number: - if (last == '.' || last != '0' || (last == '0' && (curr != 'o' && curr != 'b' && curr != 'x'))) - { - buffer_.push(last); - - auto dot = last == '.' ? 1 : 0; - auto flt = 0; - - while (true) - { - if (state == reader::end) - break; - - if (curr == '\'' && (last == '\'' || last == 'f' || last == '.')) - throw comp_error(loc_, "invalid number literal"); - - if ((curr == '.' || curr == 'f') && last == '\'') - throw comp_error(loc_, "invalid number literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (curr == 'f') - flt++; - else if (curr == '.') - dot++; - else if (!(curr > 47 && curr < 58)) - break; - - if (!buffer_.push(curr)) - throw comp_error(loc_, "number literal size exceeded"); - - advance(); - } - - if (last == '\'') - throw comp_error(loc_, "invalid number literal"); - - if (dot > 1 || flt > 1 || (flt && buffer_.data[buffer_.length - 1] != 'f')) - throw comp_error(loc_, "invalid number literal"); - - if (dot || flt) - return parser::make_FLOAT(std::string(buffer_.data, buffer_.length), loc_); - - return parser::make_INTEGER(std::string(buffer_.data, buffer_.length), loc_); - } - else if (curr == 'o') - { - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'o')) || (curr == 'o' && last == '\'')) - throw comp_error(loc_, "invalid octal literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (!(curr > 47 && curr < 56)) - break; - - if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); - - advance(); - } - - if (last == '\'' || buffer_.length <= 0) - throw comp_error(loc_, "invalid octal literal"); - - return parser::make_INTEGER(utils::string::oct_to_dec(buffer_.data), loc_); - } - else if (curr == 'b') - { - buffer_.push(last); - buffer_.push(curr); - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'b')) || (curr == 'b' && last == '\'')) - throw comp_error(loc_, "invalid binary literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (curr != '0' && curr != '1') - break; - - if (!buffer_.push(curr)) - throw comp_error(loc_, "number literal size exceeded"); - - advance(); - } - - if (last == '\'' || buffer_.length < 3) - throw comp_error(loc_, "invalid binary literal"); - - return parser::make_INTEGER(utils::string::bin_to_dec(buffer_.data), loc_); - } - else if (curr == 'x') - { - buffer_.push(last); - buffer_.push(curr); - advance(); - - while (true) - { - if (state == reader::end) - break; - - if ((curr == '\'' && (last == '\'' || last == 'x')) || (curr == 'x' && last == '\'')) - throw comp_error(loc_, "invalid hexadecimal literal"); - - if (curr == '\'') - { - advance(); - continue; - } - - if (!((curr > 47 && curr < 58) || (curr > 64 && curr < 71) || (curr > 96 && curr < 103))) - break; - - if (!buffer_.push(curr)) - throw error("gsc lexer: out of memory!"); - - advance(); - } - - if (last == '\'' || buffer_.length < 3) - throw comp_error(loc_, "invalid hexadecimal literal"); - - return parser::make_INTEGER(utils::string::hex_to_dec(buffer_.data), loc_); - } - - throw error("UNEXPECTED LEXER INTERNAL ERROR!"); - } -} - -void lexer::advance() -{ - reader_.advance(); - loc_.end.column++; - - if (reader_.current_byte == '\\') [[unlikely]] - preprocessor_wrap(); -} - -void lexer::preprocessor_wrap() -{ - while (reader_.current_byte == '\\') - { - if (reader_.bytes_remaining == 1) - throw comp_error(loc_, "invalid token ('\\')"); - - if (reader_.buffer_pos[1] != '\r' && reader_.buffer_pos[1] != '\n') - break; - - if (reader_.buffer_pos[1] == '\r') - { - if (reader_.bytes_remaining <= 3 || reader_.buffer_pos[2] != '\n') - throw comp_error(loc_, "invalid token ('\\')"); - - reader_.buffer_pos += 3; - reader_.bytes_remaining -= 3; - } - - if ((reader_.buffer_pos[1] == '\n')) - { - if (reader_.bytes_remaining == 2) - throw comp_error(loc_, "invalid token ('\\')"); - - reader_.buffer_pos += 2; - reader_.bytes_remaining -= 2; - } - - if (reader_.bytes_remaining == 0) - { - reader_.state = reader::end; - reader_.current_byte = 0; - } - else - { - reader_.current_byte = *reader_.buffer_pos; - } - - loc_.lines(); - loc_.step(); - } -} - -void lexer::preprocessor_run(parser::token::token_kind_type token) -{ - if (!clean_) - throw comp_error(loc_, "invalid token ('#')"); - - switch (token) - { - case parser::token::SH_DEFINE: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_UNDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IFDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IFNDEF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_IF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ELIF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ELSE: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - case parser::token::SH_ENDIF: - throw comp_error(loc_, "unimplemented preprocessor directive"); - break; - default: - throw comp_error(loc_, "unknown preprocessor directive"); - } -} - -} // namespace xsk::arc::t6 diff --git a/src/t6/parser.cpp b/src/t6/parser.cpp deleted file mode 100644 index 407ff5bc..00000000 --- a/src/t6/parser.cpp +++ /dev/null @@ -1,5519 +0,0 @@ -// A Bison parser, made by GNU Bison 3.8.2. - -// Skeleton implementation for Bison LALR(1) parsers in C++ - -// Copyright (C) 2002-2015, 2018-2021 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. - -// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, -// especially those whose name start with YY_ or yy_. They are -// private implementation details that can be changed or removed. - -// "%code top" blocks. -#line 38 "parser.ypp" - -#include "xsk/stdinc.hpp" -#include "xsk/t6/parser.hpp" -#include "xsk/t6/lexer.hpp" -using namespace xsk::arc; -xsk::arc::t6::parser::symbol_type T6lex(xsk::arc::t6::lexer& lexer); - -#line 47 "parser.cpp" - -// Take the name prefix into account. -#define yylex T6lex - - - - - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include // FIXME: INFRINGES ON USER NAME SPACE. -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - - -// Whether we are compiled with exception support. -#ifndef YY_EXCEPTIONS -# if defined __GNUC__ && !defined __EXCEPTIONS -# define YY_EXCEPTIONS 0 -# else -# define YY_EXCEPTIONS 1 -# endif -#endif - -#define YYRHSLOC(Rhs, K) ((Rhs)[K].location) -/* 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). */ - -# ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).begin = YYRHSLOC (Rhs, 1).begin; \ - (Current).end = YYRHSLOC (Rhs, N).end; \ - } \ - else \ - { \ - (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ - } \ - while (false) -# endif - - -// Enable debugging if requested. -#if T6DEBUG - -// A pseudo ostream that takes yydebug_ into account. -# define YYCDEBUG if (yydebug_) (*yycdebug_) - -# define YY_SYMBOL_PRINT(Title, Symbol) \ - do { \ - if (yydebug_) \ - { \ - *yycdebug_ << Title << ' '; \ - yy_print_ (*yycdebug_, Symbol); \ - *yycdebug_ << '\n'; \ - } \ - } while (false) - -# define YY_REDUCE_PRINT(Rule) \ - do { \ - if (yydebug_) \ - yy_reduce_print_ (Rule); \ - } while (false) - -# define YY_STACK_PRINT() \ - do { \ - if (yydebug_) \ - yy_stack_print_ (); \ - } while (false) - -#else // !T6DEBUG - -# define YYCDEBUG if (false) std::cerr -# define YY_SYMBOL_PRINT(Title, Symbol) YY_USE (Symbol) -# define YY_REDUCE_PRINT(Rule) static_cast (0) -# define YY_STACK_PRINT() static_cast (0) - -#endif // !T6DEBUG - -#define yyerrok (yyerrstatus_ = 0) -#define yyclearin (yyla.clear ()) - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab -#define YYRECOVERING() (!!yyerrstatus_) - -#line 13 "parser.ypp" -namespace xsk { namespace arc { namespace t6 { -#line 149 "parser.cpp" - - /// Build a parser object. - parser::parser (xsk::arc::t6::lexer& lexer_yyarg, xsk::arc::ast::program::ptr& ast_yyarg) -#if T6DEBUG - : yydebug_ (false), - yycdebug_ (&std::cerr), -#else - : -#endif - yy_lac_established_ (false), - lexer (lexer_yyarg), - ast (ast_yyarg) - {} - - parser::~parser () - {} - - parser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW - {} - - /*---------. - | symbol. | - `---------*/ - - - - // by_state. - parser::by_state::by_state () YY_NOEXCEPT - : state (empty_state) - {} - - parser::by_state::by_state (const by_state& that) YY_NOEXCEPT - : state (that.state) - {} - - void - parser::by_state::clear () YY_NOEXCEPT - { - state = empty_state; - } - - void - parser::by_state::move (by_state& that) - { - state = that.state; - that.clear (); - } - - parser::by_state::by_state (state_type s) YY_NOEXCEPT - : state (s) - {} - - parser::symbol_kind_type - parser::by_state::kind () const YY_NOEXCEPT - { - if (state == empty_state) - return symbol_kind::S_YYEMPTY; - else - return YY_CAST (symbol_kind_type, yystos_[+state]); - } - - parser::stack_symbol_type::stack_symbol_type () - {} - - parser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) - : super_type (YY_MOVE (that.state), YY_MOVE (that.location)) - { - switch (that.kind ()) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - value.YY_MOVE_OR_COPY< ast::call > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_declaration: // declaration - value.YY_MOVE_OR_COPY< ast::decl > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_decl_thread: // decl_thread - value.YY_MOVE_OR_COPY< ast::decl_thread::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_decl_usingtree: // decl_usingtree - value.YY_MOVE_OR_COPY< ast::decl_usingtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr: // expr - case symbol_kind::S_expr_or_empty: // expr_or_empty - case symbol_kind::S_expr_assign: // expr_assign - case symbol_kind::S_expr_increment: // expr_increment - case symbol_kind::S_expr_decrement: // expr_decrement - case symbol_kind::S_expr_ternary: // expr_ternary - case symbol_kind::S_expr_binary: // expr_binary - case symbol_kind::S_expr_primitive: // expr_primitive - case symbol_kind::S_expr_parameters_default: // expr_parameters_default - case symbol_kind::S_expr_object: // expr_object - value.YY_MOVE_OR_COPY< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_abs: // expr_abs - value.YY_MOVE_OR_COPY< ast::expr_abs::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_angleclamp180: // expr_angleclamp180 - value.YY_MOVE_OR_COPY< ast::expr_angleclamp180::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anglestoforward: // expr_anglestoforward - value.YY_MOVE_OR_COPY< ast::expr_anglestoforward::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anglestoright: // expr_anglestoright - value.YY_MOVE_OR_COPY< ast::expr_anglestoright::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anglestoup: // expr_anglestoup - value.YY_MOVE_OR_COPY< ast::expr_anglestoup::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.YY_MOVE_OR_COPY< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.YY_MOVE_OR_COPY< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.YY_MOVE_OR_COPY< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.YY_MOVE_OR_COPY< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.YY_MOVE_OR_COPY< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.YY_MOVE_OR_COPY< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.YY_MOVE_OR_COPY< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.YY_MOVE_OR_COPY< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.YY_MOVE_OR_COPY< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.YY_MOVE_OR_COPY< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.YY_MOVE_OR_COPY< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.YY_MOVE_OR_COPY< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_getdvar: // expr_getdvar - value.YY_MOVE_OR_COPY< ast::expr_getdvar::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_getdvarcoloralpha: // expr_getdvarcoloralpha - value.YY_MOVE_OR_COPY< ast::expr_getdvarcoloralpha::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_getdvarcolorblue: // expr_getdvarcolorblue - value.YY_MOVE_OR_COPY< ast::expr_getdvarcolorblue::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_getdvarcolorgreen: // expr_getdvarcolorgreen - value.YY_MOVE_OR_COPY< ast::expr_getdvarcolorgreen::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_getdvarcolorred: // expr_getdvarcolorred - value.YY_MOVE_OR_COPY< ast::expr_getdvarcolorred::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_getdvarfloat: // expr_getdvarfloat - value.YY_MOVE_OR_COPY< ast::expr_getdvarfloat::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_getdvarint: // expr_getdvarint - value.YY_MOVE_OR_COPY< ast::expr_getdvarint::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_getdvarvector: // expr_getdvarvector - value.YY_MOVE_OR_COPY< ast::expr_getdvarvector::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_getfirstarraykey: // expr_getfirstarraykey - value.YY_MOVE_OR_COPY< ast::expr_getfirstarraykey::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_getnextarraykey: // expr_getnextarraykey - value.YY_MOVE_OR_COPY< ast::expr_getnextarraykey::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_gettime: // expr_gettime - value.YY_MOVE_OR_COPY< ast::expr_gettime::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_hash: // expr_hash - value.YY_MOVE_OR_COPY< ast::expr_hash::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.YY_MOVE_OR_COPY< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.YY_MOVE_OR_COPY< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_isdefined: // expr_isdefined - value.YY_MOVE_OR_COPY< ast::expr_isdefined::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.YY_MOVE_OR_COPY< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.YY_MOVE_OR_COPY< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.YY_MOVE_OR_COPY< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.YY_MOVE_OR_COPY< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.YY_MOVE_OR_COPY< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.YY_MOVE_OR_COPY< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.YY_MOVE_OR_COPY< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.YY_MOVE_OR_COPY< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.YY_MOVE_OR_COPY< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.YY_MOVE_OR_COPY< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.YY_MOVE_OR_COPY< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.YY_MOVE_OR_COPY< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_true: // expr_true - value.YY_MOVE_OR_COPY< ast::expr_true::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_undefined: // expr_undefined - value.YY_MOVE_OR_COPY< ast::expr_undefined::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_vector: // expr_vector - value.YY_MOVE_OR_COPY< ast::expr_vector::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_vectorscale: // expr_vectorscale - value.YY_MOVE_OR_COPY< ast::expr_vectorscale::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_vectortoangles: // expr_vectortoangles - value.YY_MOVE_OR_COPY< ast::expr_vectortoangles::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_include: // include - value.YY_MOVE_OR_COPY< ast::include::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_program: // program - value.YY_MOVE_OR_COPY< ast::program::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt: // stmt - case symbol_kind::S_stmt_or_dev: // stmt_or_dev - value.YY_MOVE_OR_COPY< ast::stmt > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_assign: // stmt_assign - value.YY_MOVE_OR_COPY< ast::stmt_assign::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_break: // stmt_break - value.YY_MOVE_OR_COPY< ast::stmt_break::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_call: // stmt_call - value.YY_MOVE_OR_COPY< ast::stmt_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_case: // stmt_case - value.YY_MOVE_OR_COPY< ast::stmt_case::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_const: // stmt_const - value.YY_MOVE_OR_COPY< ast::stmt_const::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_continue: // stmt_continue - value.YY_MOVE_OR_COPY< ast::stmt_continue::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_default: // stmt_default - value.YY_MOVE_OR_COPY< ast::stmt_default::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_dev: // stmt_dev - value.YY_MOVE_OR_COPY< ast::stmt_dev::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_dowhile: // stmt_dowhile - value.YY_MOVE_OR_COPY< ast::stmt_dowhile::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_endon: // stmt_endon - value.YY_MOVE_OR_COPY< ast::stmt_endon::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_expr: // stmt_expr - value.YY_MOVE_OR_COPY< ast::stmt_expr::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_for: // stmt_for - value.YY_MOVE_OR_COPY< ast::stmt_for::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_foreach: // stmt_foreach - value.YY_MOVE_OR_COPY< ast::stmt_foreach::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_if: // stmt_if - value.YY_MOVE_OR_COPY< ast::stmt_if::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_ifelse: // stmt_ifelse - value.YY_MOVE_OR_COPY< ast::stmt_ifelse::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_list: // stmt_list - case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list - case symbol_kind::S_stmt_block: // stmt_block - value.YY_MOVE_OR_COPY< ast::stmt_list::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_notify: // stmt_notify - value.YY_MOVE_OR_COPY< ast::stmt_notify::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin - value.YY_MOVE_OR_COPY< ast::stmt_prof_begin::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_prof_end: // stmt_prof_end - value.YY_MOVE_OR_COPY< ast::stmt_prof_end::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_return: // stmt_return - value.YY_MOVE_OR_COPY< ast::stmt_return::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_switch: // stmt_switch - value.YY_MOVE_OR_COPY< ast::stmt_switch::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_wait: // stmt_wait - value.YY_MOVE_OR_COPY< ast::stmt_wait::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.YY_MOVE_OR_COPY< ast::stmt_waittill::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.YY_MOVE_OR_COPY< ast::stmt_waittillframeend::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.YY_MOVE_OR_COPY< ast::stmt_waittillmatch::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.YY_MOVE_OR_COPY< ast::stmt_while::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_HASH: // "hash" - case symbol_kind::S_FLOAT: // "float" - case symbol_kind::S_INTEGER: // "integer" - value.YY_MOVE_OR_COPY< std::string > (YY_MOVE (that.value)); - break; - - default: - break; - } - -#if 201103L <= YY_CPLUSPLUS - // that is emptied. - that.state = empty_state; -#endif - } - - parser::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that) - : super_type (s, YY_MOVE (that.location)) - { - switch (that.kind ()) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - value.move< ast::call > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_declaration: // declaration - value.move< ast::decl > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_decl_thread: // decl_thread - value.move< ast::decl_thread::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_decl_usingtree: // decl_usingtree - value.move< ast::decl_usingtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr: // expr - case symbol_kind::S_expr_or_empty: // expr_or_empty - case symbol_kind::S_expr_assign: // expr_assign - case symbol_kind::S_expr_increment: // expr_increment - case symbol_kind::S_expr_decrement: // expr_decrement - case symbol_kind::S_expr_ternary: // expr_ternary - case symbol_kind::S_expr_binary: // expr_binary - case symbol_kind::S_expr_primitive: // expr_primitive - case symbol_kind::S_expr_parameters_default: // expr_parameters_default - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_abs: // expr_abs - value.move< ast::expr_abs::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_angleclamp180: // expr_angleclamp180 - value.move< ast::expr_angleclamp180::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anglestoforward: // expr_anglestoforward - value.move< ast::expr_anglestoforward::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anglestoright: // expr_anglestoright - value.move< ast::expr_anglestoright::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anglestoup: // expr_anglestoup - value.move< ast::expr_anglestoup::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_getdvar: // expr_getdvar - value.move< ast::expr_getdvar::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_getdvarcoloralpha: // expr_getdvarcoloralpha - value.move< ast::expr_getdvarcoloralpha::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_getdvarcolorblue: // expr_getdvarcolorblue - value.move< ast::expr_getdvarcolorblue::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_getdvarcolorgreen: // expr_getdvarcolorgreen - value.move< ast::expr_getdvarcolorgreen::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_getdvarcolorred: // expr_getdvarcolorred - value.move< ast::expr_getdvarcolorred::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_getdvarfloat: // expr_getdvarfloat - value.move< ast::expr_getdvarfloat::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_getdvarint: // expr_getdvarint - value.move< ast::expr_getdvarint::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_getdvarvector: // expr_getdvarvector - value.move< ast::expr_getdvarvector::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_getfirstarraykey: // expr_getfirstarraykey - value.move< ast::expr_getfirstarraykey::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_getnextarraykey: // expr_getnextarraykey - value.move< ast::expr_getnextarraykey::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_gettime: // expr_gettime - value.move< ast::expr_gettime::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_hash: // expr_hash - value.move< ast::expr_hash::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_isdefined: // expr_isdefined - value.move< ast::expr_isdefined::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_true: // expr_true - value.move< ast::expr_true::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_undefined: // expr_undefined - value.move< ast::expr_undefined::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_vector: // expr_vector - value.move< ast::expr_vector::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_vectorscale: // expr_vectorscale - value.move< ast::expr_vectorscale::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_expr_vectortoangles: // expr_vectortoangles - value.move< ast::expr_vectortoangles::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_include: // include - value.move< ast::include::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_program: // program - value.move< ast::program::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt: // stmt - case symbol_kind::S_stmt_or_dev: // stmt_or_dev - value.move< ast::stmt > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_assign: // stmt_assign - value.move< ast::stmt_assign::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_break: // stmt_break - value.move< ast::stmt_break::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_call: // stmt_call - value.move< ast::stmt_call::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_case: // stmt_case - value.move< ast::stmt_case::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_const: // stmt_const - value.move< ast::stmt_const::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_continue: // stmt_continue - value.move< ast::stmt_continue::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_default: // stmt_default - value.move< ast::stmt_default::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_dev: // stmt_dev - value.move< ast::stmt_dev::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_dowhile: // stmt_dowhile - value.move< ast::stmt_dowhile::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_endon: // stmt_endon - value.move< ast::stmt_endon::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_expr: // stmt_expr - value.move< ast::stmt_expr::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_for: // stmt_for - value.move< ast::stmt_for::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_foreach: // stmt_foreach - value.move< ast::stmt_foreach::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_if: // stmt_if - value.move< ast::stmt_if::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_ifelse: // stmt_ifelse - value.move< ast::stmt_ifelse::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_list: // stmt_list - case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list - case symbol_kind::S_stmt_block: // stmt_block - value.move< ast::stmt_list::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_notify: // stmt_notify - value.move< ast::stmt_notify::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin - value.move< ast::stmt_prof_begin::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_prof_end: // stmt_prof_end - value.move< ast::stmt_prof_end::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_return: // stmt_return - value.move< ast::stmt_return::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_switch: // stmt_switch - value.move< ast::stmt_switch::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_wait: // stmt_wait - value.move< ast::stmt_wait::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.move< ast::stmt_waittill::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.move< ast::stmt_waittillframeend::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.move< ast::stmt_waittillmatch::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.move< ast::stmt_while::ptr > (YY_MOVE (that.value)); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_HASH: // "hash" - case symbol_kind::S_FLOAT: // "float" - case symbol_kind::S_INTEGER: // "integer" - value.move< std::string > (YY_MOVE (that.value)); - break; - - default: - break; - } - - // that is emptied. - that.kind_ = symbol_kind::S_YYEMPTY; - } - -#if YY_CPLUSPLUS < 201103L - parser::stack_symbol_type& - parser::stack_symbol_type::operator= (const stack_symbol_type& that) - { - state = that.state; - switch (that.kind ()) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - value.copy< ast::call > (that.value); - break; - - case symbol_kind::S_declaration: // declaration - value.copy< ast::decl > (that.value); - break; - - case symbol_kind::S_decl_thread: // decl_thread - value.copy< ast::decl_thread::ptr > (that.value); - break; - - case symbol_kind::S_decl_usingtree: // decl_usingtree - value.copy< ast::decl_usingtree::ptr > (that.value); - break; - - case symbol_kind::S_expr: // expr - case symbol_kind::S_expr_or_empty: // expr_or_empty - case symbol_kind::S_expr_assign: // expr_assign - case symbol_kind::S_expr_increment: // expr_increment - case symbol_kind::S_expr_decrement: // expr_decrement - case symbol_kind::S_expr_ternary: // expr_ternary - case symbol_kind::S_expr_binary: // expr_binary - case symbol_kind::S_expr_primitive: // expr_primitive - case symbol_kind::S_expr_parameters_default: // expr_parameters_default - case symbol_kind::S_expr_object: // expr_object - value.copy< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_abs: // expr_abs - value.copy< ast::expr_abs::ptr > (that.value); - break; - - case symbol_kind::S_expr_angleclamp180: // expr_angleclamp180 - value.copy< ast::expr_angleclamp180::ptr > (that.value); - break; - - case symbol_kind::S_expr_anglestoforward: // expr_anglestoforward - value.copy< ast::expr_anglestoforward::ptr > (that.value); - break; - - case symbol_kind::S_expr_anglestoright: // expr_anglestoright - value.copy< ast::expr_anglestoright::ptr > (that.value); - break; - - case symbol_kind::S_expr_anglestoup: // expr_anglestoup - value.copy< ast::expr_anglestoup::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.copy< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.copy< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.copy< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.copy< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.copy< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.copy< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.copy< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.copy< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.copy< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.copy< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.copy< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.copy< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_getdvar: // expr_getdvar - value.copy< ast::expr_getdvar::ptr > (that.value); - break; - - case symbol_kind::S_expr_getdvarcoloralpha: // expr_getdvarcoloralpha - value.copy< ast::expr_getdvarcoloralpha::ptr > (that.value); - break; - - case symbol_kind::S_expr_getdvarcolorblue: // expr_getdvarcolorblue - value.copy< ast::expr_getdvarcolorblue::ptr > (that.value); - break; - - case symbol_kind::S_expr_getdvarcolorgreen: // expr_getdvarcolorgreen - value.copy< ast::expr_getdvarcolorgreen::ptr > (that.value); - break; - - case symbol_kind::S_expr_getdvarcolorred: // expr_getdvarcolorred - value.copy< ast::expr_getdvarcolorred::ptr > (that.value); - break; - - case symbol_kind::S_expr_getdvarfloat: // expr_getdvarfloat - value.copy< ast::expr_getdvarfloat::ptr > (that.value); - break; - - case symbol_kind::S_expr_getdvarint: // expr_getdvarint - value.copy< ast::expr_getdvarint::ptr > (that.value); - break; - - case symbol_kind::S_expr_getdvarvector: // expr_getdvarvector - value.copy< ast::expr_getdvarvector::ptr > (that.value); - break; - - case symbol_kind::S_expr_getfirstarraykey: // expr_getfirstarraykey - value.copy< ast::expr_getfirstarraykey::ptr > (that.value); - break; - - case symbol_kind::S_expr_getnextarraykey: // expr_getnextarraykey - value.copy< ast::expr_getnextarraykey::ptr > (that.value); - break; - - case symbol_kind::S_expr_gettime: // expr_gettime - value.copy< ast::expr_gettime::ptr > (that.value); - break; - - case symbol_kind::S_expr_hash: // expr_hash - value.copy< ast::expr_hash::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.copy< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.copy< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_isdefined: // expr_isdefined - value.copy< ast::expr_isdefined::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.copy< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.copy< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.copy< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.copy< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.copy< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.copy< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.copy< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.copy< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.copy< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.copy< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.copy< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.copy< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_true: // expr_true - value.copy< ast::expr_true::ptr > (that.value); - break; - - case symbol_kind::S_expr_undefined: // expr_undefined - value.copy< ast::expr_undefined::ptr > (that.value); - break; - - case symbol_kind::S_expr_vector: // expr_vector - value.copy< ast::expr_vector::ptr > (that.value); - break; - - case symbol_kind::S_expr_vectorscale: // expr_vectorscale - value.copy< ast::expr_vectorscale::ptr > (that.value); - break; - - case symbol_kind::S_expr_vectortoangles: // expr_vectortoangles - value.copy< ast::expr_vectortoangles::ptr > (that.value); - break; - - case symbol_kind::S_include: // include - value.copy< ast::include::ptr > (that.value); - break; - - case symbol_kind::S_program: // program - value.copy< ast::program::ptr > (that.value); - break; - - case symbol_kind::S_stmt: // stmt - case symbol_kind::S_stmt_or_dev: // stmt_or_dev - value.copy< ast::stmt > (that.value); - break; - - case symbol_kind::S_stmt_assign: // stmt_assign - value.copy< ast::stmt_assign::ptr > (that.value); - break; - - case symbol_kind::S_stmt_break: // stmt_break - value.copy< ast::stmt_break::ptr > (that.value); - break; - - case symbol_kind::S_stmt_call: // stmt_call - value.copy< ast::stmt_call::ptr > (that.value); - break; - - case symbol_kind::S_stmt_case: // stmt_case - value.copy< ast::stmt_case::ptr > (that.value); - break; - - case symbol_kind::S_stmt_const: // stmt_const - value.copy< ast::stmt_const::ptr > (that.value); - break; - - case symbol_kind::S_stmt_continue: // stmt_continue - value.copy< ast::stmt_continue::ptr > (that.value); - break; - - case symbol_kind::S_stmt_default: // stmt_default - value.copy< ast::stmt_default::ptr > (that.value); - break; - - case symbol_kind::S_stmt_dev: // stmt_dev - value.copy< ast::stmt_dev::ptr > (that.value); - break; - - case symbol_kind::S_stmt_dowhile: // stmt_dowhile - value.copy< ast::stmt_dowhile::ptr > (that.value); - break; - - case symbol_kind::S_stmt_endon: // stmt_endon - value.copy< ast::stmt_endon::ptr > (that.value); - break; - - case symbol_kind::S_stmt_expr: // stmt_expr - value.copy< ast::stmt_expr::ptr > (that.value); - break; - - case symbol_kind::S_stmt_for: // stmt_for - value.copy< ast::stmt_for::ptr > (that.value); - break; - - case symbol_kind::S_stmt_foreach: // stmt_foreach - value.copy< ast::stmt_foreach::ptr > (that.value); - break; - - case symbol_kind::S_stmt_if: // stmt_if - value.copy< ast::stmt_if::ptr > (that.value); - break; - - case symbol_kind::S_stmt_ifelse: // stmt_ifelse - value.copy< ast::stmt_ifelse::ptr > (that.value); - break; - - case symbol_kind::S_stmt_list: // stmt_list - case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list - case symbol_kind::S_stmt_block: // stmt_block - value.copy< ast::stmt_list::ptr > (that.value); - break; - - case symbol_kind::S_stmt_notify: // stmt_notify - value.copy< ast::stmt_notify::ptr > (that.value); - break; - - case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin - value.copy< ast::stmt_prof_begin::ptr > (that.value); - break; - - case symbol_kind::S_stmt_prof_end: // stmt_prof_end - value.copy< ast::stmt_prof_end::ptr > (that.value); - break; - - case symbol_kind::S_stmt_return: // stmt_return - value.copy< ast::stmt_return::ptr > (that.value); - break; - - case symbol_kind::S_stmt_switch: // stmt_switch - value.copy< ast::stmt_switch::ptr > (that.value); - break; - - case symbol_kind::S_stmt_wait: // stmt_wait - value.copy< ast::stmt_wait::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.copy< ast::stmt_waittill::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.copy< ast::stmt_waittillframeend::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.copy< ast::stmt_waittillmatch::ptr > (that.value); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.copy< ast::stmt_while::ptr > (that.value); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_HASH: // "hash" - case symbol_kind::S_FLOAT: // "float" - case symbol_kind::S_INTEGER: // "integer" - value.copy< std::string > (that.value); - break; - - default: - break; - } - - location = that.location; - return *this; - } - - parser::stack_symbol_type& - parser::stack_symbol_type::operator= (stack_symbol_type& that) - { - state = that.state; - switch (that.kind ()) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - value.move< ast::call > (that.value); - break; - - case symbol_kind::S_declaration: // declaration - value.move< ast::decl > (that.value); - break; - - case symbol_kind::S_decl_thread: // decl_thread - value.move< ast::decl_thread::ptr > (that.value); - break; - - case symbol_kind::S_decl_usingtree: // decl_usingtree - value.move< ast::decl_usingtree::ptr > (that.value); - break; - - case symbol_kind::S_expr: // expr - case symbol_kind::S_expr_or_empty: // expr_or_empty - case symbol_kind::S_expr_assign: // expr_assign - case symbol_kind::S_expr_increment: // expr_increment - case symbol_kind::S_expr_decrement: // expr_decrement - case symbol_kind::S_expr_ternary: // expr_ternary - case symbol_kind::S_expr_binary: // expr_binary - case symbol_kind::S_expr_primitive: // expr_primitive - case symbol_kind::S_expr_parameters_default: // expr_parameters_default - case symbol_kind::S_expr_object: // expr_object - value.move< ast::expr > (that.value); - break; - - case symbol_kind::S_expr_abs: // expr_abs - value.move< ast::expr_abs::ptr > (that.value); - break; - - case symbol_kind::S_expr_angleclamp180: // expr_angleclamp180 - value.move< ast::expr_angleclamp180::ptr > (that.value); - break; - - case symbol_kind::S_expr_anglestoforward: // expr_anglestoforward - value.move< ast::expr_anglestoforward::ptr > (that.value); - break; - - case symbol_kind::S_expr_anglestoright: // expr_anglestoright - value.move< ast::expr_anglestoright::ptr > (that.value); - break; - - case symbol_kind::S_expr_anglestoup: // expr_anglestoup - value.move< ast::expr_anglestoup::ptr > (that.value); - break; - - case symbol_kind::S_expr_anim: // expr_anim - value.move< ast::expr_anim::ptr > (that.value); - break; - - case symbol_kind::S_expr_animation: // expr_animation - value.move< ast::expr_animation::ptr > (that.value); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - value.move< ast::expr_animtree::ptr > (that.value); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - value.move< ast::expr_arguments::ptr > (that.value); - break; - - case symbol_kind::S_expr_array: // expr_array - value.move< ast::expr_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_call: // expr_call - value.move< ast::expr_call::ptr > (that.value); - break; - - case symbol_kind::S_expr_complement: // expr_complement - value.move< ast::expr_complement::ptr > (that.value); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - value.move< ast::expr_empty_array::ptr > (that.value); - break; - - case symbol_kind::S_expr_false: // expr_false - value.move< ast::expr_false::ptr > (that.value); - break; - - case symbol_kind::S_expr_field: // expr_field - value.move< ast::expr_field::ptr > (that.value); - break; - - case symbol_kind::S_expr_float: // expr_float - value.move< ast::expr_float::ptr > (that.value); - break; - - case symbol_kind::S_expr_game: // expr_game - value.move< ast::expr_game::ptr > (that.value); - break; - - case symbol_kind::S_expr_getdvar: // expr_getdvar - value.move< ast::expr_getdvar::ptr > (that.value); - break; - - case symbol_kind::S_expr_getdvarcoloralpha: // expr_getdvarcoloralpha - value.move< ast::expr_getdvarcoloralpha::ptr > (that.value); - break; - - case symbol_kind::S_expr_getdvarcolorblue: // expr_getdvarcolorblue - value.move< ast::expr_getdvarcolorblue::ptr > (that.value); - break; - - case symbol_kind::S_expr_getdvarcolorgreen: // expr_getdvarcolorgreen - value.move< ast::expr_getdvarcolorgreen::ptr > (that.value); - break; - - case symbol_kind::S_expr_getdvarcolorred: // expr_getdvarcolorred - value.move< ast::expr_getdvarcolorred::ptr > (that.value); - break; - - case symbol_kind::S_expr_getdvarfloat: // expr_getdvarfloat - value.move< ast::expr_getdvarfloat::ptr > (that.value); - break; - - case symbol_kind::S_expr_getdvarint: // expr_getdvarint - value.move< ast::expr_getdvarint::ptr > (that.value); - break; - - case symbol_kind::S_expr_getdvarvector: // expr_getdvarvector - value.move< ast::expr_getdvarvector::ptr > (that.value); - break; - - case symbol_kind::S_expr_getfirstarraykey: // expr_getfirstarraykey - value.move< ast::expr_getfirstarraykey::ptr > (that.value); - break; - - case symbol_kind::S_expr_getnextarraykey: // expr_getnextarraykey - value.move< ast::expr_getnextarraykey::ptr > (that.value); - break; - - case symbol_kind::S_expr_gettime: // expr_gettime - value.move< ast::expr_gettime::ptr > (that.value); - break; - - case symbol_kind::S_expr_hash: // expr_hash - value.move< ast::expr_hash::ptr > (that.value); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - value.move< ast::expr_identifier::ptr > (that.value); - break; - - case symbol_kind::S_expr_integer: // expr_integer - value.move< ast::expr_integer::ptr > (that.value); - break; - - case symbol_kind::S_expr_isdefined: // expr_isdefined - value.move< ast::expr_isdefined::ptr > (that.value); - break; - - case symbol_kind::S_expr_istring: // expr_istring - value.move< ast::expr_istring::ptr > (that.value); - break; - - case symbol_kind::S_expr_level: // expr_level - value.move< ast::expr_level::ptr > (that.value); - break; - - case symbol_kind::S_expr_method: // expr_method - value.move< ast::expr_method::ptr > (that.value); - break; - - case symbol_kind::S_expr_negate: // expr_negate - value.move< ast::expr_negate::ptr > (that.value); - break; - - case symbol_kind::S_expr_not: // expr_not - value.move< ast::expr_not::ptr > (that.value); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - value.move< ast::expr_parameters::ptr > (that.value); - break; - - case symbol_kind::S_expr_paren: // expr_paren - value.move< ast::expr_paren::ptr > (that.value); - break; - - case symbol_kind::S_expr_path: // expr_path - value.move< ast::expr_path::ptr > (that.value); - break; - - case symbol_kind::S_expr_reference: // expr_reference - value.move< ast::expr_reference::ptr > (that.value); - break; - - case symbol_kind::S_expr_self: // expr_self - value.move< ast::expr_self::ptr > (that.value); - break; - - case symbol_kind::S_expr_size: // expr_size - value.move< ast::expr_size::ptr > (that.value); - break; - - case symbol_kind::S_expr_string: // expr_string - value.move< ast::expr_string::ptr > (that.value); - break; - - case symbol_kind::S_expr_true: // expr_true - value.move< ast::expr_true::ptr > (that.value); - break; - - case symbol_kind::S_expr_undefined: // expr_undefined - value.move< ast::expr_undefined::ptr > (that.value); - break; - - case symbol_kind::S_expr_vector: // expr_vector - value.move< ast::expr_vector::ptr > (that.value); - break; - - case symbol_kind::S_expr_vectorscale: // expr_vectorscale - value.move< ast::expr_vectorscale::ptr > (that.value); - break; - - case symbol_kind::S_expr_vectortoangles: // expr_vectortoangles - value.move< ast::expr_vectortoangles::ptr > (that.value); - break; - - case symbol_kind::S_include: // include - value.move< ast::include::ptr > (that.value); - break; - - case symbol_kind::S_program: // program - value.move< ast::program::ptr > (that.value); - break; - - case symbol_kind::S_stmt: // stmt - case symbol_kind::S_stmt_or_dev: // stmt_or_dev - value.move< ast::stmt > (that.value); - break; - - case symbol_kind::S_stmt_assign: // stmt_assign - value.move< ast::stmt_assign::ptr > (that.value); - break; - - case symbol_kind::S_stmt_break: // stmt_break - value.move< ast::stmt_break::ptr > (that.value); - break; - - case symbol_kind::S_stmt_call: // stmt_call - value.move< ast::stmt_call::ptr > (that.value); - break; - - case symbol_kind::S_stmt_case: // stmt_case - value.move< ast::stmt_case::ptr > (that.value); - break; - - case symbol_kind::S_stmt_const: // stmt_const - value.move< ast::stmt_const::ptr > (that.value); - break; - - case symbol_kind::S_stmt_continue: // stmt_continue - value.move< ast::stmt_continue::ptr > (that.value); - break; - - case symbol_kind::S_stmt_default: // stmt_default - value.move< ast::stmt_default::ptr > (that.value); - break; - - case symbol_kind::S_stmt_dev: // stmt_dev - value.move< ast::stmt_dev::ptr > (that.value); - break; - - case symbol_kind::S_stmt_dowhile: // stmt_dowhile - value.move< ast::stmt_dowhile::ptr > (that.value); - break; - - case symbol_kind::S_stmt_endon: // stmt_endon - value.move< ast::stmt_endon::ptr > (that.value); - break; - - case symbol_kind::S_stmt_expr: // stmt_expr - value.move< ast::stmt_expr::ptr > (that.value); - break; - - case symbol_kind::S_stmt_for: // stmt_for - value.move< ast::stmt_for::ptr > (that.value); - break; - - case symbol_kind::S_stmt_foreach: // stmt_foreach - value.move< ast::stmt_foreach::ptr > (that.value); - break; - - case symbol_kind::S_stmt_if: // stmt_if - value.move< ast::stmt_if::ptr > (that.value); - break; - - case symbol_kind::S_stmt_ifelse: // stmt_ifelse - value.move< ast::stmt_ifelse::ptr > (that.value); - break; - - case symbol_kind::S_stmt_list: // stmt_list - case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list - case symbol_kind::S_stmt_block: // stmt_block - value.move< ast::stmt_list::ptr > (that.value); - break; - - case symbol_kind::S_stmt_notify: // stmt_notify - value.move< ast::stmt_notify::ptr > (that.value); - break; - - case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin - value.move< ast::stmt_prof_begin::ptr > (that.value); - break; - - case symbol_kind::S_stmt_prof_end: // stmt_prof_end - value.move< ast::stmt_prof_end::ptr > (that.value); - break; - - case symbol_kind::S_stmt_return: // stmt_return - value.move< ast::stmt_return::ptr > (that.value); - break; - - case symbol_kind::S_stmt_switch: // stmt_switch - value.move< ast::stmt_switch::ptr > (that.value); - break; - - case symbol_kind::S_stmt_wait: // stmt_wait - value.move< ast::stmt_wait::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - value.move< ast::stmt_waittill::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - value.move< ast::stmt_waittillframeend::ptr > (that.value); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - value.move< ast::stmt_waittillmatch::ptr > (that.value); - break; - - case symbol_kind::S_stmt_while: // stmt_while - value.move< ast::stmt_while::ptr > (that.value); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_HASH: // "hash" - case symbol_kind::S_FLOAT: // "float" - case symbol_kind::S_INTEGER: // "integer" - value.move< std::string > (that.value); - break; - - default: - break; - } - - location = that.location; - // that is emptied. - that.state = empty_state; - return *this; - } -#endif - - template - void - parser::yy_destroy_ (const char* yymsg, basic_symbol& yysym) const - { - if (yymsg) - YY_SYMBOL_PRINT (yymsg, yysym); - } - -#if T6DEBUG - template - void - parser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const - { - std::ostream& yyoutput = yyo; - YY_USE (yyoutput); - if (yysym.empty ()) - yyo << "empty symbol"; - else - { - symbol_kind_type yykind = yysym.kind (); - yyo << (yykind < YYNTOKENS ? "token" : "nterm") - << ' ' << yysym.name () << " (" - << yysym.location << ": "; - YY_USE (yykind); - yyo << ')'; - } - } -#endif - - void - parser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) - { - if (m) - YY_SYMBOL_PRINT (m, sym); - yystack_.push (YY_MOVE (sym)); - } - - void - parser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) - { -#if 201103L <= YY_CPLUSPLUS - yypush_ (m, stack_symbol_type (s, std::move (sym))); -#else - stack_symbol_type ss (s, sym); - yypush_ (m, ss); -#endif - } - - void - parser::yypop_ (int n) YY_NOEXCEPT - { - yystack_.pop (n); - } - -#if T6DEBUG - std::ostream& - parser::debug_stream () const - { - return *yycdebug_; - } - - void - parser::set_debug_stream (std::ostream& o) - { - yycdebug_ = &o; - } - - - parser::debug_level_type - parser::debug_level () const - { - return yydebug_; - } - - void - parser::set_debug_level (debug_level_type l) - { - yydebug_ = l; - } -#endif // T6DEBUG - - parser::state_type - parser::yy_lr_goto_state_ (state_type yystate, int yysym) - { - int yyr = yypgoto_[yysym - YYNTOKENS] + yystate; - if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) - return yytable_[yyr]; - else - return yydefgoto_[yysym - YYNTOKENS]; - } - - bool - parser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yypact_ninf_; - } - - bool - parser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT - { - return yyvalue == yytable_ninf_; - } - - int - parser::operator() () - { - return parse (); - } - - int - parser::parse () - { - int yyn; - /// Length of the RHS of the rule being reduced. - int yylen = 0; - - // Error handling. - int yynerrs_ = 0; - int yyerrstatus_ = 0; - - /// The lookahead symbol. - symbol_type yyla; - - /// The locations where the error started and ended. - stack_symbol_type yyerror_range[3]; - - /// The return value of parse (). - int yyresult; - - // Discard the LAC context in case there still is one left from a - // previous invocation. - yy_lac_discard_ ("init"); - -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - YYCDEBUG << "Starting parse\n"; - - - /* Initialize the stack. The initial state will be set in - yynewstate, since the latter expects the semantical and the - location values to have been already stored, initialize these - stacks with a primary value. */ - yystack_.clear (); - yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); - - /*-----------------------------------------------. - | yynewstate -- push a new symbol on the stack. | - `-----------------------------------------------*/ - yynewstate: - YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; - YY_STACK_PRINT (); - - // Accept? - if (yystack_[0].state == yyfinal_) - YYACCEPT; - - goto yybackup; - - - /*-----------. - | yybackup. | - `-----------*/ - yybackup: - // Try to take a decision without lookahead. - yyn = yypact_[+yystack_[0].state]; - if (yy_pact_value_is_default_ (yyn)) - goto yydefault; - - // Read a lookahead token. - if (yyla.empty ()) - { - YYCDEBUG << "Reading a token\n"; -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - symbol_type yylookahead (yylex (lexer)); - yyla.move (yylookahead); - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - goto yyerrlab1; - } -#endif // YY_EXCEPTIONS - } - YY_SYMBOL_PRINT ("Next token is", yyla); - - if (yyla.kind () == symbol_kind::S_YYerror) - { - // The scanner already issued an error message, process directly - // to error recovery. But do not keep the error token as - // lookahead, it is too special and may lead us to an endless - // loop in error recovery. */ - yyla.kind_ = symbol_kind::S_YYUNDEF; - goto yyerrlab1; - } - - /* If the proper action on seeing token YYLA.TYPE is to reduce or - to detect an error, take that action. */ - yyn += yyla.kind (); - if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) - { - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - goto yydefault; - } - - // Reduce or error. - yyn = yytable_[yyn]; - if (yyn <= 0) - { - if (yy_table_value_is_error_ (yyn)) - goto yyerrlab; - if (!yy_lac_establish_ (yyla.kind ())) - goto yyerrlab; - - yyn = -yyn; - goto yyreduce; - } - - // Count tokens shifted since error; after three, turn off error status. - if (yyerrstatus_) - --yyerrstatus_; - - // Shift the lookahead token. - yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); - yy_lac_discard_ ("shift"); - goto yynewstate; - - - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ - yydefault: - yyn = yydefact_[+yystack_[0].state]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - - /*-----------------------------. - | yyreduce -- do a reduction. | - `-----------------------------*/ - yyreduce: - yylen = yyr2_[yyn]; - { - stack_symbol_type yylhs; - yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); - /* Variants are always initialized to an empty instance of the - correct type. The default '$$ = $1' action is NOT applied - when using variants. */ - switch (yyr1_[yyn]) - { - case symbol_kind::S_expr_function: // expr_function - case symbol_kind::S_expr_pointer: // expr_pointer - yylhs.value.emplace< ast::call > (); - break; - - case symbol_kind::S_declaration: // declaration - yylhs.value.emplace< ast::decl > (); - break; - - case symbol_kind::S_decl_thread: // decl_thread - yylhs.value.emplace< ast::decl_thread::ptr > (); - break; - - case symbol_kind::S_decl_usingtree: // decl_usingtree - yylhs.value.emplace< ast::decl_usingtree::ptr > (); - break; - - case symbol_kind::S_expr: // expr - case symbol_kind::S_expr_or_empty: // expr_or_empty - case symbol_kind::S_expr_assign: // expr_assign - case symbol_kind::S_expr_increment: // expr_increment - case symbol_kind::S_expr_decrement: // expr_decrement - case symbol_kind::S_expr_ternary: // expr_ternary - case symbol_kind::S_expr_binary: // expr_binary - case symbol_kind::S_expr_primitive: // expr_primitive - case symbol_kind::S_expr_parameters_default: // expr_parameters_default - case symbol_kind::S_expr_object: // expr_object - yylhs.value.emplace< ast::expr > (); - break; - - case symbol_kind::S_expr_abs: // expr_abs - yylhs.value.emplace< ast::expr_abs::ptr > (); - break; - - case symbol_kind::S_expr_angleclamp180: // expr_angleclamp180 - yylhs.value.emplace< ast::expr_angleclamp180::ptr > (); - break; - - case symbol_kind::S_expr_anglestoforward: // expr_anglestoforward - yylhs.value.emplace< ast::expr_anglestoforward::ptr > (); - break; - - case symbol_kind::S_expr_anglestoright: // expr_anglestoright - yylhs.value.emplace< ast::expr_anglestoright::ptr > (); - break; - - case symbol_kind::S_expr_anglestoup: // expr_anglestoup - yylhs.value.emplace< ast::expr_anglestoup::ptr > (); - break; - - case symbol_kind::S_expr_anim: // expr_anim - yylhs.value.emplace< ast::expr_anim::ptr > (); - break; - - case symbol_kind::S_expr_animation: // expr_animation - yylhs.value.emplace< ast::expr_animation::ptr > (); - break; - - case symbol_kind::S_expr_animtree: // expr_animtree - yylhs.value.emplace< ast::expr_animtree::ptr > (); - break; - - case symbol_kind::S_expr_arguments: // expr_arguments - case symbol_kind::S_expr_arguments_no_empty: // expr_arguments_no_empty - yylhs.value.emplace< ast::expr_arguments::ptr > (); - break; - - case symbol_kind::S_expr_array: // expr_array - yylhs.value.emplace< ast::expr_array::ptr > (); - break; - - case symbol_kind::S_expr_call: // expr_call - yylhs.value.emplace< ast::expr_call::ptr > (); - break; - - case symbol_kind::S_expr_complement: // expr_complement - yylhs.value.emplace< ast::expr_complement::ptr > (); - break; - - case symbol_kind::S_expr_empty_array: // expr_empty_array - yylhs.value.emplace< ast::expr_empty_array::ptr > (); - break; - - case symbol_kind::S_expr_false: // expr_false - yylhs.value.emplace< ast::expr_false::ptr > (); - break; - - case symbol_kind::S_expr_field: // expr_field - yylhs.value.emplace< ast::expr_field::ptr > (); - break; - - case symbol_kind::S_expr_float: // expr_float - yylhs.value.emplace< ast::expr_float::ptr > (); - break; - - case symbol_kind::S_expr_game: // expr_game - yylhs.value.emplace< ast::expr_game::ptr > (); - break; - - case symbol_kind::S_expr_getdvar: // expr_getdvar - yylhs.value.emplace< ast::expr_getdvar::ptr > (); - break; - - case symbol_kind::S_expr_getdvarcoloralpha: // expr_getdvarcoloralpha - yylhs.value.emplace< ast::expr_getdvarcoloralpha::ptr > (); - break; - - case symbol_kind::S_expr_getdvarcolorblue: // expr_getdvarcolorblue - yylhs.value.emplace< ast::expr_getdvarcolorblue::ptr > (); - break; - - case symbol_kind::S_expr_getdvarcolorgreen: // expr_getdvarcolorgreen - yylhs.value.emplace< ast::expr_getdvarcolorgreen::ptr > (); - break; - - case symbol_kind::S_expr_getdvarcolorred: // expr_getdvarcolorred - yylhs.value.emplace< ast::expr_getdvarcolorred::ptr > (); - break; - - case symbol_kind::S_expr_getdvarfloat: // expr_getdvarfloat - yylhs.value.emplace< ast::expr_getdvarfloat::ptr > (); - break; - - case symbol_kind::S_expr_getdvarint: // expr_getdvarint - yylhs.value.emplace< ast::expr_getdvarint::ptr > (); - break; - - case symbol_kind::S_expr_getdvarvector: // expr_getdvarvector - yylhs.value.emplace< ast::expr_getdvarvector::ptr > (); - break; - - case symbol_kind::S_expr_getfirstarraykey: // expr_getfirstarraykey - yylhs.value.emplace< ast::expr_getfirstarraykey::ptr > (); - break; - - case symbol_kind::S_expr_getnextarraykey: // expr_getnextarraykey - yylhs.value.emplace< ast::expr_getnextarraykey::ptr > (); - break; - - case symbol_kind::S_expr_gettime: // expr_gettime - yylhs.value.emplace< ast::expr_gettime::ptr > (); - break; - - case symbol_kind::S_expr_hash: // expr_hash - yylhs.value.emplace< ast::expr_hash::ptr > (); - break; - - case symbol_kind::S_expr_identifier_nosize: // expr_identifier_nosize - case symbol_kind::S_expr_identifier: // expr_identifier - yylhs.value.emplace< ast::expr_identifier::ptr > (); - break; - - case symbol_kind::S_expr_integer: // expr_integer - yylhs.value.emplace< ast::expr_integer::ptr > (); - break; - - case symbol_kind::S_expr_isdefined: // expr_isdefined - yylhs.value.emplace< ast::expr_isdefined::ptr > (); - break; - - case symbol_kind::S_expr_istring: // expr_istring - yylhs.value.emplace< ast::expr_istring::ptr > (); - break; - - case symbol_kind::S_expr_level: // expr_level - yylhs.value.emplace< ast::expr_level::ptr > (); - break; - - case symbol_kind::S_expr_method: // expr_method - yylhs.value.emplace< ast::expr_method::ptr > (); - break; - - case symbol_kind::S_expr_negate: // expr_negate - yylhs.value.emplace< ast::expr_negate::ptr > (); - break; - - case symbol_kind::S_expr_not: // expr_not - yylhs.value.emplace< ast::expr_not::ptr > (); - break; - - case symbol_kind::S_expr_parameters: // expr_parameters - yylhs.value.emplace< ast::expr_parameters::ptr > (); - break; - - case symbol_kind::S_expr_paren: // expr_paren - yylhs.value.emplace< ast::expr_paren::ptr > (); - break; - - case symbol_kind::S_expr_path: // expr_path - yylhs.value.emplace< ast::expr_path::ptr > (); - break; - - case symbol_kind::S_expr_reference: // expr_reference - yylhs.value.emplace< ast::expr_reference::ptr > (); - break; - - case symbol_kind::S_expr_self: // expr_self - yylhs.value.emplace< ast::expr_self::ptr > (); - break; - - case symbol_kind::S_expr_size: // expr_size - yylhs.value.emplace< ast::expr_size::ptr > (); - break; - - case symbol_kind::S_expr_string: // expr_string - yylhs.value.emplace< ast::expr_string::ptr > (); - break; - - case symbol_kind::S_expr_true: // expr_true - yylhs.value.emplace< ast::expr_true::ptr > (); - break; - - case symbol_kind::S_expr_undefined: // expr_undefined - yylhs.value.emplace< ast::expr_undefined::ptr > (); - break; - - case symbol_kind::S_expr_vector: // expr_vector - yylhs.value.emplace< ast::expr_vector::ptr > (); - break; - - case symbol_kind::S_expr_vectorscale: // expr_vectorscale - yylhs.value.emplace< ast::expr_vectorscale::ptr > (); - break; - - case symbol_kind::S_expr_vectortoangles: // expr_vectortoangles - yylhs.value.emplace< ast::expr_vectortoangles::ptr > (); - break; - - case symbol_kind::S_include: // include - yylhs.value.emplace< ast::include::ptr > (); - break; - - case symbol_kind::S_program: // program - yylhs.value.emplace< ast::program::ptr > (); - break; - - case symbol_kind::S_stmt: // stmt - case symbol_kind::S_stmt_or_dev: // stmt_or_dev - yylhs.value.emplace< ast::stmt > (); - break; - - case symbol_kind::S_stmt_assign: // stmt_assign - yylhs.value.emplace< ast::stmt_assign::ptr > (); - break; - - case symbol_kind::S_stmt_break: // stmt_break - yylhs.value.emplace< ast::stmt_break::ptr > (); - break; - - case symbol_kind::S_stmt_call: // stmt_call - yylhs.value.emplace< ast::stmt_call::ptr > (); - break; - - case symbol_kind::S_stmt_case: // stmt_case - yylhs.value.emplace< ast::stmt_case::ptr > (); - break; - - case symbol_kind::S_stmt_const: // stmt_const - yylhs.value.emplace< ast::stmt_const::ptr > (); - break; - - case symbol_kind::S_stmt_continue: // stmt_continue - yylhs.value.emplace< ast::stmt_continue::ptr > (); - break; - - case symbol_kind::S_stmt_default: // stmt_default - yylhs.value.emplace< ast::stmt_default::ptr > (); - break; - - case symbol_kind::S_stmt_dev: // stmt_dev - yylhs.value.emplace< ast::stmt_dev::ptr > (); - break; - - case symbol_kind::S_stmt_dowhile: // stmt_dowhile - yylhs.value.emplace< ast::stmt_dowhile::ptr > (); - break; - - case symbol_kind::S_stmt_endon: // stmt_endon - yylhs.value.emplace< ast::stmt_endon::ptr > (); - break; - - case symbol_kind::S_stmt_expr: // stmt_expr - yylhs.value.emplace< ast::stmt_expr::ptr > (); - break; - - case symbol_kind::S_stmt_for: // stmt_for - yylhs.value.emplace< ast::stmt_for::ptr > (); - break; - - case symbol_kind::S_stmt_foreach: // stmt_foreach - yylhs.value.emplace< ast::stmt_foreach::ptr > (); - break; - - case symbol_kind::S_stmt_if: // stmt_if - yylhs.value.emplace< ast::stmt_if::ptr > (); - break; - - case symbol_kind::S_stmt_ifelse: // stmt_ifelse - yylhs.value.emplace< ast::stmt_ifelse::ptr > (); - break; - - case symbol_kind::S_stmt_list: // stmt_list - case symbol_kind::S_stmt_or_dev_list: // stmt_or_dev_list - case symbol_kind::S_stmt_block: // stmt_block - yylhs.value.emplace< ast::stmt_list::ptr > (); - break; - - case symbol_kind::S_stmt_notify: // stmt_notify - yylhs.value.emplace< ast::stmt_notify::ptr > (); - break; - - case symbol_kind::S_stmt_prof_begin: // stmt_prof_begin - yylhs.value.emplace< ast::stmt_prof_begin::ptr > (); - break; - - case symbol_kind::S_stmt_prof_end: // stmt_prof_end - yylhs.value.emplace< ast::stmt_prof_end::ptr > (); - break; - - case symbol_kind::S_stmt_return: // stmt_return - yylhs.value.emplace< ast::stmt_return::ptr > (); - break; - - case symbol_kind::S_stmt_switch: // stmt_switch - yylhs.value.emplace< ast::stmt_switch::ptr > (); - break; - - case symbol_kind::S_stmt_wait: // stmt_wait - yylhs.value.emplace< ast::stmt_wait::ptr > (); - break; - - case symbol_kind::S_stmt_waittill: // stmt_waittill - yylhs.value.emplace< ast::stmt_waittill::ptr > (); - break; - - case symbol_kind::S_stmt_waittillframeend: // stmt_waittillframeend - yylhs.value.emplace< ast::stmt_waittillframeend::ptr > (); - break; - - case symbol_kind::S_stmt_waittillmatch: // stmt_waittillmatch - yylhs.value.emplace< ast::stmt_waittillmatch::ptr > (); - break; - - case symbol_kind::S_stmt_while: // stmt_while - yylhs.value.emplace< ast::stmt_while::ptr > (); - break; - - case symbol_kind::S_PATH: // "path" - case symbol_kind::S_IDENTIFIER: // "identifier" - case symbol_kind::S_STRING: // "string literal" - case symbol_kind::S_ISTRING: // "localized string" - case symbol_kind::S_HASH: // "hash" - case symbol_kind::S_FLOAT: // "float" - case symbol_kind::S_INTEGER: // "integer" - yylhs.value.emplace< std::string > (); - break; - - default: - break; - } - - - // Default location. - { - stack_type::slice range (yystack_, yylen); - YYLLOC_DEFAULT (yylhs.location, range, yylen); - yyerror_range[1].location = yylhs.location; - } - - // Perform the reduction. - YY_REDUCE_PRINT (yyn); -#if YY_EXCEPTIONS - try -#endif // YY_EXCEPTIONS - { - switch (yyn) - { - case 2: // root: program -#line 295 "parser.ypp" - { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } -#line 2340 "parser.cpp" - break; - - case 3: // root: %empty -#line 296 "parser.ypp" - { ast = std::make_unique(yylhs.location); } -#line 2346 "parser.cpp" - break; - - case 4: // program: program inline -#line 301 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } -#line 2352 "parser.cpp" - break; - - case 5: // program: program include -#line 303 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); yylhs.value.as < ast::program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < ast::include::ptr > ())); } -#line 2358 "parser.cpp" - break; - - case 6: // program: program declaration -#line 305 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); yylhs.value.as < ast::program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < ast::decl > ())); } -#line 2364 "parser.cpp" - break; - - case 7: // program: inline -#line 307 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } -#line 2370 "parser.cpp" - break; - - case 8: // program: include -#line 309 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::program::ptr > ()->includes.push_back(std::move(yystack_[0].value.as < ast::include::ptr > ())); } -#line 2376 "parser.cpp" - break; - - case 9: // program: declaration -#line 311 "parser.ypp" - { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::program::ptr > ()->declarations.push_back(std::move(yystack_[0].value.as < ast::decl > ())); } -#line 2382 "parser.cpp" - break; - - case 10: // inline: "#inline" expr_path ";" -#line 315 "parser.ypp" - { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } -#line 2388 "parser.cpp" - break; - - case 11: // include: "#include" expr_path ";" -#line 320 "parser.ypp" - { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } -#line 2394 "parser.cpp" - break; - - case 12: // declaration: "/#" -#line 324 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } -#line 2400 "parser.cpp" - break; - - case 13: // declaration: "#/" -#line 325 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } -#line 2406 "parser.cpp" - break; - - case 14: // declaration: decl_usingtree -#line 326 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } -#line 2412 "parser.cpp" - break; - - case 15: // declaration: decl_thread -#line 327 "parser.ypp" - { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } -#line 2418 "parser.cpp" - break; - - case 16: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" -#line 332 "parser.ypp" - { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_usingtree::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_string::ptr > ())); } -#line 2424 "parser.cpp" - break; - - case 17: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block -#line 337 "parser.ypp" - { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_thread::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()), export_flags::export_none); } -#line 2430 "parser.cpp" - break; - - case 18: // decl_thread: "autoexec" expr_identifier "(" expr_parameters ")" stmt_block -#line 339 "parser.ypp" - { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_thread::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()), export_flags::export_autoexec); } -#line 2436 "parser.cpp" - break; - - case 19: // decl_thread: "codecall" expr_identifier "(" expr_parameters ")" stmt_block -#line 341 "parser.ypp" - { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_thread::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()), export_flags::export_codecall); } -#line 2442 "parser.cpp" - break; - - case 20: // decl_thread: "private" expr_identifier "(" expr_parameters ")" stmt_block -#line 343 "parser.ypp" - { lexer.ban_header(yylhs.location); yylhs.value.as < ast::decl_thread::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()), export_flags::export_private2); } -#line 2448 "parser.cpp" - break; - - case 21: // stmt: stmt_block -#line 347 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } -#line 2454 "parser.cpp" - break; - - case 22: // stmt: stmt_call -#line 348 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } -#line 2460 "parser.cpp" - break; - - case 23: // stmt: stmt_const -#line 349 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_const = std::move(yystack_[0].value.as < ast::stmt_const::ptr > ()); } -#line 2466 "parser.cpp" - break; - - case 24: // stmt: stmt_assign -#line 350 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } -#line 2472 "parser.cpp" - break; - - case 25: // stmt: stmt_endon -#line 351 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } -#line 2478 "parser.cpp" - break; - - case 26: // stmt: stmt_notify -#line 352 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } -#line 2484 "parser.cpp" - break; - - case 27: // stmt: stmt_wait -#line 353 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } -#line 2490 "parser.cpp" - break; - - case 28: // stmt: stmt_waittill -#line 354 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } -#line 2496 "parser.cpp" - break; - - case 29: // stmt: stmt_waittillmatch -#line 355 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } -#line 2502 "parser.cpp" - break; - - case 30: // stmt: stmt_waittillframeend -#line 356 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } -#line 2508 "parser.cpp" - break; - - case 31: // stmt: stmt_if -#line 357 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } -#line 2514 "parser.cpp" - break; - - case 32: // stmt: stmt_ifelse -#line 358 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } -#line 2520 "parser.cpp" - break; - - case 33: // stmt: stmt_while -#line 359 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } -#line 2526 "parser.cpp" - break; - - case 34: // stmt: stmt_dowhile -#line 360 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } -#line 2532 "parser.cpp" - break; - - case 35: // stmt: stmt_for -#line 361 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } -#line 2538 "parser.cpp" - break; - - case 36: // stmt: stmt_foreach -#line 362 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } -#line 2544 "parser.cpp" - break; - - case 37: // stmt: stmt_switch -#line 363 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } -#line 2550 "parser.cpp" - break; - - case 38: // stmt: stmt_case -#line 364 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } -#line 2556 "parser.cpp" - break; - - case 39: // stmt: stmt_default -#line 365 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } -#line 2562 "parser.cpp" - break; - - case 40: // stmt: stmt_break -#line 366 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } -#line 2568 "parser.cpp" - break; - - case 41: // stmt: stmt_continue -#line 367 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } -#line 2574 "parser.cpp" - break; - - case 42: // stmt: stmt_return -#line 368 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } -#line 2580 "parser.cpp" - break; - - case 43: // stmt: stmt_prof_begin -#line 369 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } -#line 2586 "parser.cpp" - break; - - case 44: // stmt: stmt_prof_end -#line 370 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } -#line 2592 "parser.cpp" - break; - - case 45: // stmt_or_dev: stmt -#line 374 "parser.ypp" - { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } -#line 2598 "parser.cpp" - break; - - case 46: // stmt_or_dev: stmt_dev -#line 375 "parser.ypp" - { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } -#line 2604 "parser.cpp" - break; - - case 47: // stmt_list: stmt_list stmt -#line 380 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } -#line 2610 "parser.cpp" - break; - - case 48: // stmt_list: stmt -#line 382 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } -#line 2616 "parser.cpp" - break; - - case 49: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev -#line 387 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } -#line 2622 "parser.cpp" - break; - - case 50: // stmt_or_dev_list: stmt_or_dev -#line 389 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::stmt_list::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::stmt > ())); } -#line 2628 "parser.cpp" - break; - - case 51: // stmt_dev: "/#" stmt_list "#/" -#line 393 "parser.ypp" - { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::stmt_list::ptr > ())); } -#line 2634 "parser.cpp" - break; - - case 52: // stmt_dev: "/#" "#/" -#line 394 "parser.ypp" - { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2640 "parser.cpp" - break; - - case 53: // stmt_block: "{" stmt_or_dev_list "}" -#line 398 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } -#line 2646 "parser.cpp" - break; - - case 54: // stmt_block: "{" "}" -#line 399 "parser.ypp" - { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } -#line 2652 "parser.cpp" - break; - - case 55: // stmt_expr: expr_assign -#line 404 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2658 "parser.cpp" - break; - - case 56: // stmt_expr: expr_increment -#line 406 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2664 "parser.cpp" - break; - - case 57: // stmt_expr: expr_decrement -#line 408 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2670 "parser.cpp" - break; - - case 58: // stmt_expr: %empty -#line 410 "parser.ypp" - { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2676 "parser.cpp" - break; - - case 59: // stmt_call: expr_call ";" -#line 415 "parser.ypp" - { yylhs.value.as < ast::stmt_call::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_call::ptr > ()))); } -#line 2682 "parser.cpp" - break; - - case 60: // stmt_call: expr_method ";" -#line 417 "parser.ypp" - { yylhs.value.as < ast::stmt_call::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_method::ptr > ()))); } -#line 2688 "parser.cpp" - break; - - case 61: // stmt_const: "const" expr_identifier "=" expr ";" -#line 422 "parser.ypp" - { yylhs.value.as < ast::stmt_const::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2694 "parser.cpp" - break; - - case 62: // stmt_assign: expr_assign ";" -#line 427 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2700 "parser.cpp" - break; - - case 63: // stmt_assign: expr_increment ";" -#line 429 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2706 "parser.cpp" - break; - - case 64: // stmt_assign: expr_decrement ";" -#line 431 "parser.ypp" - { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2712 "parser.cpp" - break; - - case 65: // stmt_endon: expr_object "endon" "(" expr ")" ";" -#line 436 "parser.ypp" - { yylhs.value.as < ast::stmt_endon::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ())); } -#line 2718 "parser.cpp" - break; - - case 66: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" -#line 441 "parser.ypp" - { yylhs.value.as < ast::stmt_notify::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } -#line 2724 "parser.cpp" - break; - - case 67: // stmt_notify: expr_object "notify" "(" expr ")" ";" -#line 443 "parser.ypp" - { yylhs.value.as < ast::stmt_notify::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } -#line 2730 "parser.cpp" - break; - - case 68: // stmt_wait: "wait" expr ";" -#line 448 "parser.ypp" - { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2736 "parser.cpp" - break; - - case 69: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" -#line 453 "parser.ypp" - { yylhs.value.as < ast::stmt_waittill::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } -#line 2742 "parser.cpp" - break; - - case 70: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" -#line 455 "parser.ypp" - { yylhs.value.as < ast::stmt_waittill::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } -#line 2748 "parser.cpp" - break; - - case 71: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" -#line 460 "parser.ypp" - { yylhs.value.as < ast::stmt_waittillmatch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[7].value.as < ast::expr > ()), std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } -#line 2754 "parser.cpp" - break; - - case 72: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" -#line 462 "parser.ypp" - { yylhs.value.as < ast::stmt_waittillmatch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::make_unique(yylhs.location)); } -#line 2760 "parser.cpp" - break; - - case 73: // stmt_waittillframeend: "waittillframeend" ";" -#line 467 "parser.ypp" - { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } -#line 2766 "parser.cpp" - break; - - case 74: // stmt_if: "if" "(" expr ")" stmt -#line 472 "parser.ypp" - { yylhs.value.as < ast::stmt_if::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } -#line 2772 "parser.cpp" - break; - - case 75: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt -#line 477 "parser.ypp" - { yylhs.value.as < ast::stmt_ifelse::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::stmt > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } -#line 2778 "parser.cpp" - break; - - case 76: // stmt_while: "while" "(" expr ")" stmt -#line 482 "parser.ypp" - { yylhs.value.as < ast::stmt_while::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } -#line 2784 "parser.cpp" - break; - - case 77: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" -#line 487 "parser.ypp" - { yylhs.value.as < ast::stmt_dowhile::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[5].value.as < ast::stmt > ())); } -#line 2790 "parser.cpp" - break; - - case 78: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt -#line 492 "parser.ypp" - { yylhs.value.as < ast::stmt_for::ptr > () = std::make_unique(yylhs.location, ast::stmt(std::move(yystack_[6].value.as < ast::stmt_expr::ptr > ())), std::move(yystack_[4].value.as < ast::expr > ()), ast::stmt(std::move(yystack_[2].value.as < ast::stmt_expr::ptr > ())), std::move(yystack_[0].value.as < ast::stmt > ())); } -#line 2796 "parser.cpp" - break; - - case 79: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt -#line 497 "parser.ypp" - { yylhs.value.as < ast::stmt_foreach::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } -#line 2802 "parser.cpp" - break; - - case 80: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt -#line 499 "parser.ypp" - { yylhs.value.as < ast::stmt_foreach::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[6].value.as < ast::expr_identifier::ptr > ())), ast::expr(std::move(yystack_[4].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt > ())); } -#line 2808 "parser.cpp" - break; - - case 81: // stmt_switch: "switch" "(" expr ")" stmt_block -#line 504 "parser.ypp" - { yylhs.value.as < ast::stmt_switch::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::stmt_list::ptr > ())); } -#line 2814 "parser.cpp" - break; - - case 82: // stmt_case: "case" expr_integer ":" -#line 509 "parser.ypp" - { yylhs.value.as < ast::stmt_case::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_integer::ptr > ())), std::make_unique(yylhs.location)); } -#line 2820 "parser.cpp" - break; - - case 83: // stmt_case: "case" expr_string ":" -#line 511 "parser.ypp" - { yylhs.value.as < ast::stmt_case::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[1].value.as < ast::expr_string::ptr > ())), std::make_unique(yylhs.location)); } -#line 2826 "parser.cpp" - break; - - case 84: // stmt_default: "default" ":" -#line 516 "parser.ypp" - { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2832 "parser.cpp" - break; - - case 85: // stmt_break: "break" ";" -#line 521 "parser.ypp" - { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } -#line 2838 "parser.cpp" - break; - - case 86: // stmt_continue: "continue" ";" -#line 526 "parser.ypp" - { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } -#line 2844 "parser.cpp" - break; - - case 87: // stmt_return: "return" expr ";" -#line 531 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 2850 "parser.cpp" - break; - - case 88: // stmt_return: "return" ";" -#line 533 "parser.ypp" - { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } -#line 2856 "parser.cpp" - break; - - case 89: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" -#line 538 "parser.ypp" - { yylhs.value.as < ast::stmt_prof_begin::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } -#line 2862 "parser.cpp" - break; - - case 90: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" -#line 543 "parser.ypp" - { yylhs.value.as < ast::stmt_prof_end::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ())); } -#line 2868 "parser.cpp" - break; - - case 91: // expr: expr_ternary -#line 547 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2874 "parser.cpp" - break; - - case 92: // expr: expr_binary -#line 548 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2880 "parser.cpp" - break; - - case 93: // expr: expr_primitive -#line 549 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2886 "parser.cpp" - break; - - case 94: // expr_or_empty: expr -#line 553 "parser.ypp" - { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } -#line 2892 "parser.cpp" - break; - - case 95: // expr_or_empty: %empty -#line 554 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } -#line 2898 "parser.cpp" - break; - - case 96: // expr_assign: expr_object "=" expr -#line 559 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2904 "parser.cpp" - break; - - case 97: // expr_assign: expr_object "|=" expr -#line 561 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2910 "parser.cpp" - break; - - case 98: // expr_assign: expr_object "&=" expr -#line 563 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2916 "parser.cpp" - break; - - case 99: // expr_assign: expr_object "^=" expr -#line 565 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2922 "parser.cpp" - break; - - case 100: // expr_assign: expr_object "<<=" expr -#line 567 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()),std::move( yystack_[0].value.as < ast::expr > ())); } -#line 2928 "parser.cpp" - break; - - case 101: // expr_assign: expr_object ">>=" expr -#line 569 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2934 "parser.cpp" - break; - - case 102: // expr_assign: expr_object "+=" expr -#line 571 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2940 "parser.cpp" - break; - - case 103: // expr_assign: expr_object "-=" expr -#line 573 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2946 "parser.cpp" - break; - - case 104: // expr_assign: expr_object "*=" expr -#line 575 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2952 "parser.cpp" - break; - - case 105: // expr_assign: expr_object "/=" expr -#line 577 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2958 "parser.cpp" - break; - - case 106: // expr_assign: expr_object "%=" expr -#line 579 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2964 "parser.cpp" - break; - - case 107: // expr_increment: "++" expr_object -#line 584 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } -#line 2970 "parser.cpp" - break; - - case 108: // expr_increment: expr_object "++" -#line 586 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } -#line 2976 "parser.cpp" - break; - - case 109: // expr_decrement: "--" expr_object -#line 591 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } -#line 2982 "parser.cpp" - break; - - case 110: // expr_decrement: expr_object "--" -#line 593 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } -#line 2988 "parser.cpp" - break; - - case 111: // expr_ternary: expr "?" expr ":" expr -#line 598 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[4].value.as < ast::expr > ()), std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 2994 "parser.cpp" - break; - - case 112: // expr_binary: expr "||" expr -#line 603 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3000 "parser.cpp" - break; - - case 113: // expr_binary: expr "&&" expr -#line 605 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3006 "parser.cpp" - break; - - case 114: // expr_binary: expr "==" expr -#line 607 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3012 "parser.cpp" - break; - - case 115: // expr_binary: expr "!=" expr -#line 609 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3018 "parser.cpp" - break; - - case 116: // expr_binary: expr "<=" expr -#line 611 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3024 "parser.cpp" - break; - - case 117: // expr_binary: expr ">=" expr -#line 613 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3030 "parser.cpp" - break; - - case 118: // expr_binary: expr "<" expr -#line 615 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3036 "parser.cpp" - break; - - case 119: // expr_binary: expr ">" expr -#line 617 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3042 "parser.cpp" - break; - - case 120: // expr_binary: expr "|" expr -#line 619 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3048 "parser.cpp" - break; - - case 121: // expr_binary: expr "&" expr -#line 621 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3054 "parser.cpp" - break; - - case 122: // expr_binary: expr "^" expr -#line 623 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3060 "parser.cpp" - break; - - case 123: // expr_binary: expr "<<" expr -#line 625 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3066 "parser.cpp" - break; - - case 124: // expr_binary: expr ">>" expr -#line 627 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3072 "parser.cpp" - break; - - case 125: // expr_binary: expr "+" expr -#line 629 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3078 "parser.cpp" - break; - - case 126: // expr_binary: expr "-" expr -#line 631 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3084 "parser.cpp" - break; - - case 127: // expr_binary: expr "*" expr -#line 633 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3090 "parser.cpp" - break; - - case 128: // expr_binary: expr "/" expr -#line 635 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3096 "parser.cpp" - break; - - case 129: // expr_binary: expr "%" expr -#line 637 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3102 "parser.cpp" - break; - - case 130: // expr_primitive: expr_complement -#line 641 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } -#line 3108 "parser.cpp" - break; - - case 131: // expr_primitive: expr_negate -#line 642 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_negate::ptr > ()); } -#line 3114 "parser.cpp" - break; - - case 132: // expr_primitive: expr_not -#line 643 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } -#line 3120 "parser.cpp" - break; - - case 133: // expr_primitive: expr_call -#line 644 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 3126 "parser.cpp" - break; - - case 134: // expr_primitive: expr_method -#line 645 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 3132 "parser.cpp" - break; - - case 135: // expr_primitive: expr_getnextarraykey -#line 646 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getnextarraykey::ptr > ()); } -#line 3138 "parser.cpp" - break; - - case 136: // expr_primitive: expr_getfirstarraykey -#line 647 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getfirstarraykey::ptr > ()); } -#line 3144 "parser.cpp" - break; - - case 137: // expr_primitive: expr_getdvarcoloralpha -#line 648 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarcoloralpha::ptr > ()); } -#line 3150 "parser.cpp" - break; - - case 138: // expr_primitive: expr_getdvarcolorblue -#line 649 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarcolorblue::ptr > ()); } -#line 3156 "parser.cpp" - break; - - case 139: // expr_primitive: expr_getdvarcolorgreen -#line 650 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarcolorgreen::ptr > ()); } -#line 3162 "parser.cpp" - break; - - case 140: // expr_primitive: expr_getdvarcolorred -#line 651 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarcolorred::ptr > ()); } -#line 3168 "parser.cpp" - break; - - case 141: // expr_primitive: expr_getdvarvector -#line 652 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarvector::ptr > ()); } -#line 3174 "parser.cpp" - break; - - case 142: // expr_primitive: expr_getdvarfloat -#line 653 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarfloat::ptr > ()); } -#line 3180 "parser.cpp" - break; - - case 143: // expr_primitive: expr_getdvarint -#line 654 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarint::ptr > ()); } -#line 3186 "parser.cpp" - break; - - case 144: // expr_primitive: expr_getdvar -#line 655 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvar::ptr > ()); } -#line 3192 "parser.cpp" - break; - - case 145: // expr_primitive: expr_gettime -#line 656 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_gettime::ptr > ()); } -#line 3198 "parser.cpp" - break; - - case 146: // expr_primitive: expr_abs -#line 657 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_abs::ptr > ()); } -#line 3204 "parser.cpp" - break; - - case 147: // expr_primitive: expr_vectortoangles -#line 658 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vectortoangles::ptr > ()); } -#line 3210 "parser.cpp" - break; - - case 148: // expr_primitive: expr_angleclamp180 -#line 659 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_angleclamp180::ptr > ()); } -#line 3216 "parser.cpp" - break; - - case 149: // expr_primitive: expr_anglestoforward -#line 660 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anglestoforward::ptr > ()); } -#line 3222 "parser.cpp" - break; - - case 150: // expr_primitive: expr_anglestoright -#line 661 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anglestoright::ptr > ()); } -#line 3228 "parser.cpp" - break; - - case 151: // expr_primitive: expr_anglestoup -#line 662 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anglestoup::ptr > ()); } -#line 3234 "parser.cpp" - break; - - case 152: // expr_primitive: expr_vectorscale -#line 663 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vectorscale::ptr > ()); } -#line 3240 "parser.cpp" - break; - - case 153: // expr_primitive: expr_isdefined -#line 664 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_isdefined::ptr > ()); } -#line 3246 "parser.cpp" - break; - - case 154: // expr_primitive: expr_reference -#line 665 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } -#line 3252 "parser.cpp" - break; - - case 155: // expr_primitive: expr_array -#line 666 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3258 "parser.cpp" - break; - - case 156: // expr_primitive: expr_field -#line 667 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3264 "parser.cpp" - break; - - case 157: // expr_primitive: expr_size -#line 668 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } -#line 3270 "parser.cpp" - break; - - case 158: // expr_primitive: expr_paren -#line 669 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } -#line 3276 "parser.cpp" - break; - - case 159: // expr_primitive: expr_empty_array -#line 670 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } -#line 3282 "parser.cpp" - break; - - case 160: // expr_primitive: expr_undefined -#line 671 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } -#line 3288 "parser.cpp" - break; - - case 161: // expr_primitive: expr_game -#line 672 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 3294 "parser.cpp" - break; - - case 162: // expr_primitive: expr_self -#line 673 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 3300 "parser.cpp" - break; - - case 163: // expr_primitive: expr_anim -#line 674 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 3306 "parser.cpp" - break; - - case 164: // expr_primitive: expr_level -#line 675 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 3312 "parser.cpp" - break; - - case 165: // expr_primitive: expr_animation -#line 676 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } -#line 3318 "parser.cpp" - break; - - case 166: // expr_primitive: expr_animtree -#line 677 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animtree::ptr > ()); } -#line 3324 "parser.cpp" - break; - - case 167: // expr_primitive: expr_identifier -#line 678 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3330 "parser.cpp" - break; - - case 168: // expr_primitive: expr_istring -#line 679 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } -#line 3336 "parser.cpp" - break; - - case 169: // expr_primitive: expr_string -#line 680 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } -#line 3342 "parser.cpp" - break; - - case 170: // expr_primitive: expr_vector -#line 681 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } -#line 3348 "parser.cpp" - break; - - case 171: // expr_primitive: expr_hash -#line 682 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_hash::ptr > ()); } -#line 3354 "parser.cpp" - break; - - case 172: // expr_primitive: expr_float -#line 683 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } -#line 3360 "parser.cpp" - break; - - case 173: // expr_primitive: expr_integer -#line 684 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } -#line 3366 "parser.cpp" - break; - - case 174: // expr_primitive: expr_false -#line 685 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } -#line 3372 "parser.cpp" - break; - - case 175: // expr_primitive: expr_true -#line 686 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } -#line 3378 "parser.cpp" - break; - - case 176: // expr_complement: "~" expr -#line 691 "parser.ypp" - { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3384 "parser.cpp" - break; - - case 177: // expr_negate: "-" expr_identifier -#line 696 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()))); } -#line 3390 "parser.cpp" - break; - - case 178: // expr_negate: "-" expr_paren -#line 698 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()))); } -#line 3396 "parser.cpp" - break; - - case 179: // expr_negate: "-" expr_array -#line 700 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_array::ptr > ()))); } -#line 3402 "parser.cpp" - break; - - case 180: // expr_negate: "-" expr_field -#line 702 "parser.ypp" - { yylhs.value.as < ast::expr_negate::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[0].value.as < ast::expr_field::ptr > ()))); } -#line 3408 "parser.cpp" - break; - - case 181: // expr_not: "!" expr -#line 707 "parser.ypp" - { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3414 "parser.cpp" - break; - - case 182: // expr_call: expr_function -#line 711 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 3420 "parser.cpp" - break; - - case 183: // expr_call: expr_pointer -#line 712 "parser.ypp" - { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } -#line 3426 "parser.cpp" - break; - - case 184: // expr_method: expr_object expr_function -#line 715 "parser.ypp" - { yylhs.value.as < ast::expr_method::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::call > ())); } -#line 3432 "parser.cpp" - break; - - case 185: // expr_method: expr_object expr_pointer -#line 716 "parser.ypp" - { yylhs.value.as < ast::expr_method::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::call > ())); } -#line 3438 "parser.cpp" - break; - - case 186: // expr_function: expr_identifier "(" expr_arguments ")" -#line 721 "parser.ypp" - { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } -#line 3444 "parser.cpp" - break; - - case 187: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" -#line 723 "parser.ypp" - { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } -#line 3450 "parser.cpp" - break; - - case 188: // expr_function: "thread" expr_identifier "(" expr_arguments ")" -#line 725 "parser.ypp" - { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } -#line 3456 "parser.cpp" - break; - - case 189: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" -#line 727 "parser.ypp" - { yylhs.value.as < ast::call > ().as_function = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr_path::ptr > ()), std::move(yystack_[3].value.as < ast::expr_identifier::ptr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } -#line 3462 "parser.cpp" - break; - - case 190: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 732 "parser.ypp" - { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::normal); } -#line 3468 "parser.cpp" - break; - - case 191: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" -#line 734 "parser.ypp" - { yylhs.value.as < ast::call > ().as_pointer = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr_arguments::ptr > ()), ast::call::mode::thread); } -#line 3474 "parser.cpp" - break; - - case 192: // expr_parameters: expr_parameters "," expr_parameters_default -#line 739 "parser.ypp" - { yylhs.value.as < ast::expr_parameters::ptr > () = std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3480 "parser.cpp" - break; - - case 193: // expr_parameters: expr_parameters "," expr_identifier -#line 741 "parser.ypp" - { yylhs.value.as < ast::expr_parameters::ptr > () = std::move(yystack_[2].value.as < ast::expr_parameters::ptr > ()); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(ast::expr(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()))); } -#line 3486 "parser.cpp" - break; - - case 194: // expr_parameters: expr_parameters_default -#line 743 "parser.ypp" - { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3492 "parser.cpp" - break; - - case 195: // expr_parameters: expr_identifier -#line 745 "parser.ypp" - { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_parameters::ptr > ()->list.push_back(ast::expr(std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()))); } -#line 3498 "parser.cpp" - break; - - case 196: // expr_parameters: %empty -#line 747 "parser.ypp" - { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } -#line 3504 "parser.cpp" - break; - - case 197: // expr_parameters_default: expr_identifier "=" expr -#line 752 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[2].value.as < ast::expr_identifier::ptr > ())), std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3510 "parser.cpp" - break; - - case 198: // expr_arguments: expr_arguments_no_empty -#line 757 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } -#line 3516 "parser.cpp" - break; - - case 199: // expr_arguments: %empty -#line 759 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } -#line 3522 "parser.cpp" - break; - - case 200: // expr_arguments_no_empty: expr_arguments "," expr -#line 764 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[2].value.as < ast::expr_arguments::ptr > ()); yylhs.value.as < ast::expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3528 "parser.cpp" - break; - - case 201: // expr_arguments_no_empty: expr -#line 766 "parser.ypp" - { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); yylhs.value.as < ast::expr_arguments::ptr > ()->list.push_back(std::move(yystack_[0].value.as < ast::expr > ())); } -#line 3534 "parser.cpp" - break; - - case 202: // expr_getnextarraykey: "getnextarraykey" "(" expr "," expr ")" -#line 771 "parser.ypp" - { yylhs.value.as < ast::expr_getnextarraykey::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3540 "parser.cpp" - break; - - case 203: // expr_getfirstarraykey: "getfirstarraykey" "(" expr ")" -#line 776 "parser.ypp" - { yylhs.value.as < ast::expr_getfirstarraykey::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3546 "parser.cpp" - break; - - case 204: // expr_getdvarcoloralpha: "getdvarcoloralpha" "(" expr ")" -#line 781 "parser.ypp" - { yylhs.value.as < ast::expr_getdvarcoloralpha::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3552 "parser.cpp" - break; - - case 205: // expr_getdvarcolorblue: "getdvarcolorblue" "(" expr ")" -#line 786 "parser.ypp" - { yylhs.value.as < ast::expr_getdvarcolorblue::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3558 "parser.cpp" - break; - - case 206: // expr_getdvarcolorgreen: "getdvarcolorgreen" "(" expr ")" -#line 791 "parser.ypp" - { yylhs.value.as < ast::expr_getdvarcolorgreen::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3564 "parser.cpp" - break; - - case 207: // expr_getdvarcolorred: "getdvarcolorred" "(" expr ")" -#line 796 "parser.ypp" - { yylhs.value.as < ast::expr_getdvarcolorred::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3570 "parser.cpp" - break; - - case 208: // expr_getdvarvector: "getdvarvector" "(" expr ")" -#line 801 "parser.ypp" - { yylhs.value.as < ast::expr_getdvarvector::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3576 "parser.cpp" - break; - - case 209: // expr_getdvarfloat: "getdvarfloat" "(" expr ")" -#line 806 "parser.ypp" - { yylhs.value.as < ast::expr_getdvarfloat::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3582 "parser.cpp" - break; - - case 210: // expr_getdvarint: "getdvarint" "(" expr ")" -#line 811 "parser.ypp" - { yylhs.value.as < ast::expr_getdvarint::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3588 "parser.cpp" - break; - - case 211: // expr_getdvar: "getdvar" "(" expr ")" -#line 816 "parser.ypp" - { yylhs.value.as < ast::expr_getdvar::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3594 "parser.cpp" - break; - - case 212: // expr_gettime: "gettime" "(" ")" -#line 821 "parser.ypp" - { yylhs.value.as < ast::expr_gettime::ptr > () = std::make_unique(yylhs.location); } -#line 3600 "parser.cpp" - break; - - case 213: // expr_abs: "abs" "(" expr ")" -#line 826 "parser.ypp" - { yylhs.value.as < ast::expr_abs::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3606 "parser.cpp" - break; - - case 214: // expr_vectortoangles: "vectortoangles" "(" expr ")" -#line 831 "parser.ypp" - { yylhs.value.as < ast::expr_vectortoangles::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3612 "parser.cpp" - break; - - case 215: // expr_angleclamp180: "angleclamp180" "(" expr ")" -#line 836 "parser.ypp" - { yylhs.value.as < ast::expr_angleclamp180::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3618 "parser.cpp" - break; - - case 216: // expr_anglestoforward: "anglestoforward" "(" expr ")" -#line 841 "parser.ypp" - { yylhs.value.as < ast::expr_anglestoforward::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3624 "parser.cpp" - break; - - case 217: // expr_anglestoright: "anglestoright" "(" expr ")" -#line 846 "parser.ypp" - { yylhs.value.as < ast::expr_anglestoright::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3630 "parser.cpp" - break; - - case 218: // expr_anglestoup: "anglestoup" "(" expr ")" -#line 851 "parser.ypp" - { yylhs.value.as < ast::expr_anglestoup::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3636 "parser.cpp" - break; - - case 219: // expr_vectorscale: "vectorscale" "(" expr "," expr ")" -#line 856 "parser.ypp" - { yylhs.value.as < ast::expr_vectorscale::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3642 "parser.cpp" - break; - - case 220: // expr_isdefined: "isdefined" "(" expr ")" -#line 861 "parser.ypp" - { yylhs.value.as < ast::expr_isdefined::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3648 "parser.cpp" - break; - - case 221: // expr_reference: "::" expr_identifier -#line 866 "parser.ypp" - { yylhs.value.as < ast::expr_reference::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } -#line 3654 "parser.cpp" - break; - - case 222: // expr_reference: expr_path "::" expr_identifier -#line 868 "parser.ypp" - { yylhs.value.as < ast::expr_reference::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr_path::ptr > ()), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } -#line 3660 "parser.cpp" - break; - - case 223: // expr_array: expr_object "[" expr "]" -#line 873 "parser.ypp" - { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3666 "parser.cpp" - break; - - case 224: // expr_array: expr_getdvarvector "[" expr "]" -#line 875 "parser.ypp" - { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[3].value.as < ast::expr_getdvarvector::ptr > ())), std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3672 "parser.cpp" - break; - - case 225: // expr_array: expr_vectortoangles "[" expr "]" -#line 877 "parser.ypp" - { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[3].value.as < ast::expr_vectortoangles::ptr > ())), std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3678 "parser.cpp" - break; - - case 226: // expr_array: expr_angleclamp180 "[" expr "]" -#line 879 "parser.ypp" - { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[3].value.as < ast::expr_angleclamp180::ptr > ())), std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3684 "parser.cpp" - break; - - case 227: // expr_array: expr_anglestoforward "[" expr "]" -#line 881 "parser.ypp" - { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[3].value.as < ast::expr_anglestoforward::ptr > ())), std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3690 "parser.cpp" - break; - - case 228: // expr_array: expr_anglestoright "[" expr "]" -#line 883 "parser.ypp" - { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[3].value.as < ast::expr_anglestoright::ptr > ())), std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3696 "parser.cpp" - break; - - case 229: // expr_array: expr_anglestoup "[" expr "]" -#line 885 "parser.ypp" - { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[3].value.as < ast::expr_anglestoup::ptr > ())), std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3702 "parser.cpp" - break; - - case 230: // expr_array: expr_vectorscale "[" expr "]" -#line 887 "parser.ypp" - { yylhs.value.as < ast::expr_array::ptr > () = std::make_unique(yylhs.location, ast::expr(std::move(yystack_[3].value.as < ast::expr_vectorscale::ptr > ())), std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3708 "parser.cpp" - break; - - case 231: // expr_field: expr_object "." expr_identifier_nosize -#line 892 "parser.ypp" - { yylhs.value.as < ast::expr_field::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ()), std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ())); } -#line 3714 "parser.cpp" - break; - - case 232: // expr_size: expr_object "." "size" -#line 897 "parser.ypp" - { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[2].value.as < ast::expr > ())); } -#line 3720 "parser.cpp" - break; - - case 233: // expr_paren: "(" expr ")" -#line 902 "parser.ypp" - { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3726 "parser.cpp" - break; - - case 234: // expr_object: expr_call -#line 906 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } -#line 3732 "parser.cpp" - break; - - case 235: // expr_object: expr_method -#line 907 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } -#line 3738 "parser.cpp" - break; - - case 236: // expr_object: expr_array -#line 908 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } -#line 3744 "parser.cpp" - break; - - case 237: // expr_object: expr_field -#line 909 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } -#line 3750 "parser.cpp" - break; - - case 238: // expr_object: expr_game -#line 910 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } -#line 3756 "parser.cpp" - break; - - case 239: // expr_object: expr_self -#line 911 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } -#line 3762 "parser.cpp" - break; - - case 240: // expr_object: expr_anim -#line 912 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } -#line 3768 "parser.cpp" - break; - - case 241: // expr_object: expr_level -#line 913 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } -#line 3774 "parser.cpp" - break; - - case 242: // expr_object: expr_identifier -#line 914 "parser.ypp" - { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } -#line 3780 "parser.cpp" - break; - - case 243: // expr_empty_array: "[" "]" -#line 919 "parser.ypp" - { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } -#line 3786 "parser.cpp" - break; - - case 244: // expr_undefined: "undefined" -#line 924 "parser.ypp" - { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } -#line 3792 "parser.cpp" - break; - - case 245: // expr_game: "game" -#line 929 "parser.ypp" - { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } -#line 3798 "parser.cpp" - break; - - case 246: // expr_self: "self" -#line 934 "parser.ypp" - { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } -#line 3804 "parser.cpp" - break; - - case 247: // expr_anim: "anim" -#line 939 "parser.ypp" - { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } -#line 3810 "parser.cpp" - break; - - case 248: // expr_level: "level" -#line 944 "parser.ypp" - { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } -#line 3816 "parser.cpp" - break; - - case 249: // expr_animation: "%" "identifier" -#line 949 "parser.ypp" - { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3822 "parser.cpp" - break; - - case 250: // expr_animtree: "#animtree" -#line 954 "parser.ypp" - { yylhs.value.as < ast::expr_animtree::ptr > () = std::make_unique(yylhs.location); } -#line 3828 "parser.cpp" - break; - - case 251: // expr_identifier_nosize: "identifier" -#line 959 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3834 "parser.cpp" - break; - - case 252: // expr_identifier: "identifier" -#line 964 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3840 "parser.cpp" - break; - - case 253: // expr_identifier: "size" -#line 966 "parser.ypp" - { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, "size"); } -#line 3846 "parser.cpp" - break; - - case 254: // expr_path: "path" "/" "identifier" -#line 971 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[2].value.as < std::string > () + "/" + yystack_[0].value.as < std::string > ()); } -#line 3852 "parser.cpp" - break; - - case 255: // expr_path: "identifier" -#line 973 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3858 "parser.cpp" - break; - - case 256: // expr_path: "path" -#line 975 "parser.ypp" - { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3864 "parser.cpp" - break; - - case 257: // expr_istring: "localized string" -#line 980 "parser.ypp" - { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3870 "parser.cpp" - break; - - case 258: // expr_string: "string literal" -#line 985 "parser.ypp" - { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3876 "parser.cpp" - break; - - case 259: // expr_vector: "(" expr "," expr "," expr ")" -#line 990 "parser.ypp" - { yylhs.value.as < ast::expr_vector::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[5].value.as < ast::expr > ()), std::move(yystack_[3].value.as < ast::expr > ()), std::move(yystack_[1].value.as < ast::expr > ())); } -#line 3882 "parser.cpp" - break; - - case 260: // expr_hash: "hash" -#line 995 "parser.ypp" - { yylhs.value.as < ast::expr_hash::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3888 "parser.cpp" - break; - - case 261: // expr_float: "-" "float" -#line 1000 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3894 "parser.cpp" - break; - - case 262: // expr_float: "float" -#line 1002 "parser.ypp" - { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3900 "parser.cpp" - break; - - case 263: // expr_integer: "-" "integer" -#line 1007 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } -#line 3906 "parser.cpp" - break; - - case 264: // expr_integer: "integer" -#line 1009 "parser.ypp" - { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } -#line 3912 "parser.cpp" - break; - - case 265: // expr_false: "false" -#line 1014 "parser.ypp" - { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } -#line 3918 "parser.cpp" - break; - - case 266: // expr_true: "true" -#line 1019 "parser.ypp" - { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } -#line 3924 "parser.cpp" - break; - - -#line 3928 "parser.cpp" - - default: - break; - } - } -#if YY_EXCEPTIONS - catch (const syntax_error& yyexc) - { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error (yyexc); - YYERROR; - } -#endif // YY_EXCEPTIONS - YY_SYMBOL_PRINT ("-> $$ =", yylhs); - yypop_ (yylen); - yylen = 0; - - // Shift the result of the reduction. - yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); - } - goto yynewstate; - - - /*--------------------------------------. - | yyerrlab -- here on detecting error. | - `--------------------------------------*/ - yyerrlab: - // If not already recovering from an error, report this error. - if (!yyerrstatus_) - { - ++yynerrs_; - context yyctx (*this, yyla); - std::string msg = yysyntax_error_ (yyctx); - error (yyla.location, YY_MOVE (msg)); - } - - - yyerror_range[1].location = yyla.location; - if (yyerrstatus_ == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - // Return failure if at end of input. - if (yyla.kind () == symbol_kind::S_YYEOF) - YYABORT; - else if (!yyla.empty ()) - { - yy_destroy_ ("Error: discarding", yyla); - yyla.clear (); - } - } - - // Else will try to reuse lookahead token after shifting the error token. - goto yyerrlab1; - - - /*---------------------------------------------------. - | yyerrorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ - yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and - the label yyerrorlab therefore never appears in user code. */ - if (false) - YYERROR; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - yypop_ (yylen); - yylen = 0; - YY_STACK_PRINT (); - goto yyerrlab1; - - - /*-------------------------------------------------------------. - | yyerrlab1 -- common code for both syntax error and YYERROR. | - `-------------------------------------------------------------*/ - yyerrlab1: - yyerrstatus_ = 3; // Each real token shifted decrements this. - // Pop stack until we find a state that shifts the error token. - for (;;) - { - yyn = yypact_[+yystack_[0].state]; - if (!yy_pact_value_is_default_ (yyn)) - { - yyn += symbol_kind::S_YYerror; - if (0 <= yyn && yyn <= yylast_ - && yycheck_[yyn] == symbol_kind::S_YYerror) - { - yyn = yytable_[yyn]; - if (0 < yyn) - break; - } - } - - // Pop the current state because it cannot handle the error token. - if (yystack_.size () == 1) - YYABORT; - - yyerror_range[1].location = yystack_[0].location; - yy_destroy_ ("Error: popping", yystack_[0]); - yypop_ (); - YY_STACK_PRINT (); - } - { - stack_symbol_type error_token; - - yyerror_range[2].location = yyla.location; - YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); - - // Shift the error token. - yy_lac_discard_ ("error recovery"); - error_token.state = state_type (yyn); - yypush_ ("Shifting", YY_MOVE (error_token)); - } - goto yynewstate; - - - /*-------------------------------------. - | yyacceptlab -- YYACCEPT comes here. | - `-------------------------------------*/ - yyacceptlab: - yyresult = 0; - goto yyreturn; - - - /*-----------------------------------. - | yyabortlab -- YYABORT comes here. | - `-----------------------------------*/ - yyabortlab: - yyresult = 1; - goto yyreturn; - - - /*-----------------------------------------------------. - | yyreturn -- parsing is finished, return the result. | - `-----------------------------------------------------*/ - yyreturn: - if (!yyla.empty ()) - yy_destroy_ ("Cleanup: discarding lookahead", yyla); - - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - yypop_ (yylen); - YY_STACK_PRINT (); - while (1 < yystack_.size ()) - { - yy_destroy_ ("Cleanup: popping", yystack_[0]); - yypop_ (); - } - - return yyresult; - } -#if YY_EXCEPTIONS - catch (...) - { - YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; - // Do not try to display the values of the reclaimed symbols, - // as their printers might throw an exception. - if (!yyla.empty ()) - yy_destroy_ (YY_NULLPTR, yyla); - - while (1 < yystack_.size ()) - { - yy_destroy_ (YY_NULLPTR, yystack_[0]); - yypop_ (); - } - throw; - } -#endif // YY_EXCEPTIONS - } - - void - parser::error (const syntax_error& yyexc) - { - error (yyexc.location, yyexc.what ()); - } - - const char * - parser::symbol_name (symbol_kind_type yysymbol) - { - static const char *const yy_sname[] = - { - "end of file", "error", "invalid token", "#define", "#undef", "#ifdef", - "#ifndef", "#if", "#elif", "#else", "#endif", "/#", "#/", "#inline", - "#include", "#using_animtree", "#animtree", "autoexec", "codecall", - "private", "endon", "notify", "wait", "waittill", "waittillmatch", - "waittillframeend", "if", "else", "do", "while", "for", "foreach", "in", - "switch", "case", "default", "break", "continue", "return", "prof_begin", - "prof_end", "thread", "true", "false", "undefined", "size", "game", - "self", "anim", "level", "const", "getnextarraykey", "getfirstarraykey", - "getdvarcoloralpha", "getdvarcolorblue", "getdvarcolorgreen", - "getdvarcolorred", "getdvarvector", "getdvarfloat", "getdvarint", - "getdvar", "gettime", "abs", "vectortoangles", "angleclamp180", - "anglestoforward", "anglestoright", "anglestoup", "vectorscale", - "isdefined", "(", ")", "{", "}", "[", "]", ",", ".", "::", ":", ";", "?", - "++", "--", "<<", ">>", "||", "&&", "==", "!=", "<=", ">=", "<", ">", - "!", "~", "=", "+=", "-=", "*=", "/=", "%=", "|=", "&=", "^=", ">>=", - "<<=", "|", "&", "^", "+", "-", "*", "/", "%", "path", "identifier", - "string literal", "localized string", "hash", "float", "integer", - "SIZEOF", "THEN", "TERN", "NEG", "ANIMREF", "PREINC", "PREDEC", - "POSTINC", "POSTDEC", "$accept", "root", "program", "inline", "include", - "declaration", "decl_usingtree", "decl_thread", "stmt", "stmt_or_dev", - "stmt_list", "stmt_or_dev_list", "stmt_dev", "stmt_block", "stmt_expr", - "stmt_call", "stmt_const", "stmt_assign", "stmt_endon", "stmt_notify", - "stmt_wait", "stmt_waittill", "stmt_waittillmatch", - "stmt_waittillframeend", "stmt_if", "stmt_ifelse", "stmt_while", - "stmt_dowhile", "stmt_for", "stmt_foreach", "stmt_switch", "stmt_case", - "stmt_default", "stmt_break", "stmt_continue", "stmt_return", - "stmt_prof_begin", "stmt_prof_end", "expr", "expr_or_empty", - "expr_assign", "expr_increment", "expr_decrement", "expr_ternary", - "expr_binary", "expr_primitive", "expr_complement", "expr_negate", - "expr_not", "expr_call", "expr_method", "expr_function", "expr_pointer", - "expr_parameters", "expr_parameters_default", "expr_arguments", - "expr_arguments_no_empty", "expr_getnextarraykey", - "expr_getfirstarraykey", "expr_getdvarcoloralpha", - "expr_getdvarcolorblue", "expr_getdvarcolorgreen", - "expr_getdvarcolorred", "expr_getdvarvector", "expr_getdvarfloat", - "expr_getdvarint", "expr_getdvar", "expr_gettime", "expr_abs", - "expr_vectortoangles", "expr_angleclamp180", "expr_anglestoforward", - "expr_anglestoright", "expr_anglestoup", "expr_vectorscale", - "expr_isdefined", "expr_reference", "expr_array", "expr_field", - "expr_size", "expr_paren", "expr_object", "expr_empty_array", - "expr_undefined", "expr_game", "expr_self", "expr_anim", "expr_level", - "expr_animation", "expr_animtree", "expr_identifier_nosize", - "expr_identifier", "expr_path", "expr_istring", "expr_string", - "expr_vector", "expr_hash", "expr_float", "expr_integer", "expr_false", - "expr_true", YY_NULLPTR - }; - return yy_sname[yysymbol]; - } - - - - // parser::context. - parser::context::context (const parser& yyparser, const symbol_type& yyla) - : yyparser_ (yyparser) - , yyla_ (yyla) - {} - - int - parser::context::expected_tokens (symbol_kind_type yyarg[], int yyargn) const - { - // Actual number of expected tokens - int yycount = 0; - -#if T6DEBUG - // Execute LAC once. We don't care if it is successful, we - // only do it for the sake of debugging output. - if (!yyparser_.yy_lac_established_) - yyparser_.yy_lac_check_ (yyla_.kind ()); -#endif - - for (int yyx = 0; yyx < YYNTOKENS; ++yyx) - { - symbol_kind_type yysym = YY_CAST (symbol_kind_type, yyx); - if (yysym != symbol_kind::S_YYerror - && yysym != symbol_kind::S_YYUNDEF - && yyparser_.yy_lac_check_ (yysym)) - { - if (!yyarg) - ++yycount; - else if (yycount == yyargn) - return 0; - else - yyarg[yycount++] = yysym; - } - } - if (yyarg && yycount == 0 && 0 < yyargn) - yyarg[0] = symbol_kind::S_YYEMPTY; - return yycount; - } - - - - - bool - parser::yy_lac_check_ (symbol_kind_type yytoken) const - { - // Logically, the yylac_stack's lifetime is confined to this function. - // Clear it, to get rid of potential left-overs from previous call. - yylac_stack_.clear (); - // Reduce until we encounter a shift and thereby accept the token. -#if T6DEBUG - YYCDEBUG << "LAC: checking lookahead " << symbol_name (yytoken) << ':'; -#endif - std::ptrdiff_t lac_top = 0; - while (true) - { - state_type top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - int yyrule = yypact_[+top_state]; - if (yy_pact_value_is_default_ (yyrule) - || (yyrule += yytoken) < 0 || yylast_ < yyrule - || yycheck_[yyrule] != yytoken) - { - // Use the default action. - yyrule = yydefact_[+top_state]; - if (yyrule == 0) - { - YYCDEBUG << " Err\n"; - return false; - } - } - else - { - // Use the action from yytable. - yyrule = yytable_[yyrule]; - if (yy_table_value_is_error_ (yyrule)) - { - YYCDEBUG << " Err\n"; - return false; - } - if (0 < yyrule) - { - YYCDEBUG << " S" << yyrule << '\n'; - return true; - } - yyrule = -yyrule; - } - // By now we know we have to simulate a reduce. - YYCDEBUG << " R" << yyrule - 1; - // Pop the corresponding number of values from the stack. - { - std::ptrdiff_t yylen = yyr2_[yyrule]; - // First pop from the LAC stack as many tokens as possible. - std::ptrdiff_t lac_size = std::ptrdiff_t (yylac_stack_.size ()); - if (yylen < lac_size) - { - yylac_stack_.resize (std::size_t (lac_size - yylen)); - yylen = 0; - } - else if (lac_size) - { - yylac_stack_.clear (); - yylen -= lac_size; - } - // Only afterwards look at the main stack. - // We simulate popping elements by incrementing lac_top. - lac_top += yylen; - } - // Keep top_state in sync with the updated stack. - top_state = (yylac_stack_.empty () - ? yystack_[lac_top].state - : yylac_stack_.back ()); - // Push the resulting state of the reduction. - state_type state = yy_lr_goto_state_ (top_state, yyr1_[yyrule]); - YYCDEBUG << " G" << int (state); - yylac_stack_.push_back (state); - } - } - - // Establish the initial context if no initial context currently exists. - bool - parser::yy_lac_establish_ (symbol_kind_type yytoken) - { - /* Establish the initial context for the current lookahead if no initial - context is currently established. - - We define a context as a snapshot of the parser stacks. We define - the initial context for a lookahead as the context in which the - parser initially examines that lookahead in order to select a - syntactic action. Thus, if the lookahead eventually proves - syntactically unacceptable (possibly in a later context reached via a - series of reductions), the initial context can be used to determine - the exact set of tokens that would be syntactically acceptable in the - lookahead's place. Moreover, it is the context after which any - further semantic actions would be erroneous because they would be - determined by a syntactically unacceptable token. - - yy_lac_establish_ should be invoked when a reduction is about to be - performed in an inconsistent state (which, for the purposes of LAC, - includes consistent states that don't know they're consistent because - their default reductions have been disabled). - - For parse.lac=full, the implementation of yy_lac_establish_ is as - follows. If no initial context is currently established for the - current lookahead, then check if that lookahead can eventually be - shifted if syntactic actions continue from the current context. */ - if (yy_lac_established_) - return true; - else - { -#if T6DEBUG - YYCDEBUG << "LAC: initial context established for " - << symbol_name (yytoken) << '\n'; -#endif - yy_lac_established_ = true; - return yy_lac_check_ (yytoken); - } - } - - // Discard any previous initial lookahead context. - void - parser::yy_lac_discard_ (const char* event) - { - /* Discard any previous initial lookahead context because of Event, - which may be a lookahead change or an invalidation of the currently - established initial context for the current lookahead. - - The most common example of a lookahead change is a shift. An example - of both cases is syntax error recovery. That is, a syntax error - occurs when the lookahead is syntactically erroneous for the - currently established initial context, so error recovery manipulates - the parser stacks to try to find a new initial context in which the - current lookahead is syntactically acceptable. If it fails to find - such a context, it discards the lookahead. */ - if (yy_lac_established_) - { - YYCDEBUG << "LAC: initial context discarded due to " - << event << '\n'; - yy_lac_established_ = false; - } - } - - - int - parser::yy_syntax_error_arguments_ (const context& yyctx, - symbol_kind_type yyarg[], int yyargn) const - { - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yyla) is - if this state is a consistent state with a default action. - Thus, detecting the absence of a lookahead is sufficient to - determine that there is no unexpected or expected token to - report. In that case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is - a consistent state with a default action. There might have - been a previous inconsistent state, consistent state with a - non-default action, or user semantic action that manipulated - yyla. (However, yyla is currently not documented for users.) - In the first two cases, it might appear that the current syntax - error should have been detected in the previous state when - yy_lac_check was invoked. However, at that time, there might - have been a different syntax error that discarded a different - initial context during error recovery, leaving behind the - current lookahead. - */ - - if (!yyctx.lookahead ().empty ()) - { - if (yyarg) - yyarg[0] = yyctx.token (); - int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); - return yyn + 1; - } - return 0; - } - - // Generate an error message. - std::string - parser::yysyntax_error_ (const context& yyctx) const - { - // Its maximum. - enum { YYARGS_MAX = 5 }; - // Arguments of yyformat. - symbol_kind_type yyarg[YYARGS_MAX]; - int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); - - char const* yyformat = YY_NULLPTR; - switch (yycount) - { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: // Avoid compiler warnings. - YYCASE_ (0, YY_("syntax error")); - YYCASE_ (1, YY_("syntax error, unexpected %s")); - YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -#undef YYCASE_ - } - - std::string yyres; - // Argument number. - std::ptrdiff_t yyi = 0; - for (char const* yyp = yyformat; *yyp; ++yyp) - if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) - { - yyres += symbol_name (yyarg[yyi++]); - ++yyp; - } - else - yyres += *yyp; - return yyres; - } - - - const short parser::yypact_ninf_ = -450; - - const short parser::yytable_ninf_ = -256; - - const short - parser::yypact_[] = - { - 33, -450, -450, -82, -82, -68, -28, -28, -28, -450, - -450, 18, 33, -450, -450, -450, -450, -450, -40, -86, - -450, -27, -23, -77, -11, 3, 27, -450, -450, -450, - -450, -28, -13, -450, -450, -450, 46, -28, -28, -28, - -35, -450, 26, -450, 24, 4, 5, 6, 51, -28, - 1421, -450, 51, 51, 51, 928, -450, -450, 26, -450, - -10, -450, -450, -450, -450, -450, -450, -450, 58, 60, - 62, 63, 65, 68, 71, 72, 82, 83, 85, 91, - 93, 95, 101, 104, 110, 111, 113, 1421, 19, -28, - 1421, 1421, 1541, 74, 48, -450, -450, -450, -450, 3449, - -450, -450, -450, -450, -450, -450, 21, 137, -450, -450, - -450, -450, -450, -450, -450, -450, 121, -450, -450, -450, - -450, -450, 123, 124, 125, 126, 128, 139, -450, -450, - 258, 295, -450, -450, 310, -450, -450, 312, 319, 399, - 519, -450, -450, -16, 106, -450, -450, -450, -450, -450, - -450, -450, -450, -450, -450, -450, 1602, 1421, 114, 145, - 1727, 148, 151, 152, 153, -89, 146, 154, 156, 812, - 163, 167, -28, -450, 164, 1757, 1757, -450, -450, 1231, - -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, - -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, - -450, -450, -450, -450, -450, 161, 168, 170, 176, 177, - 121, 123, 124, 125, 126, 128, 139, -450, -450, 992, - -450, -450, -450, -450, 172, 165, 173, 174, 182, 1421, - 1421, 1421, 1421, 1421, 1421, 1421, 1421, 1421, 1421, 192, - 1421, 1421, 1421, 1421, 1421, 1421, 1421, 1421, 1768, 1421, - -450, -450, -450, -450, 1421, -450, -450, -450, -450, 258, - 295, -450, 530, -16, -450, 1421, 1421, 1421, 1421, 1421, - 1421, 1421, 1421, 1421, 1421, 1421, 1421, 1421, 1421, 1421, - 1421, 1421, 1421, 1421, 1421, 1421, 1421, 1421, 1421, 1421, - 1421, 1502, -25, -450, -450, 172, 1421, -28, -450, -450, - 1665, 3366, -450, 1421, 238, 1421, 1261, -28, 1421, 147, - 194, 197, -450, -450, -450, -450, 3401, 1421, 1421, 183, - 530, 530, -450, -450, -450, -450, -450, -450, -450, 210, - 211, 212, 213, 171, -450, -450, 1421, 1421, 1421, 1421, - 1421, 1421, 1421, 1421, 1421, 1421, 1421, -28, 1421, 1421, - -28, 3217, 1934, 1968, 2002, 2036, 2070, 2104, 2138, 2172, - 2206, -450, 2240, 2274, 2308, 2342, 2376, 2410, 3256, 2444, - -450, 1421, 1417, 2478, 3331, 94, 94, 1100, 3480, 824, - 824, 510, 510, 510, 510, 3490, 3521, 1133, 55, 55, - -450, -450, -450, 2858, 2898, 2938, 2978, 3018, 3058, 3098, - 1340, 3138, -450, -450, -450, 3449, 8, -450, 219, -450, - -450, -450, 2512, 220, 2546, 214, -450, -450, -450, 678, - -8, 2580, -450, -450, -450, 14, 25, 1421, 1421, 1421, - 1421, 1421, 3449, 3449, 3449, 3449, 3449, 3449, 3449, 3449, - 3449, 3449, 3449, 219, 3178, 36, 221, 1421, -450, -450, - -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, - -450, -450, -450, 1421, -450, 3295, 217, 1421, -450, -450, - -450, -450, -450, -450, -450, -450, -450, 1421, 1421, 1727, - 1421, 1727, 1421, 1421, -28, 51, 216, 218, 3436, 2614, - 1812, 1856, 1900, 226, -450, 1421, 2648, 2682, 1421, 223, - 3449, 3449, 39, 275, 2716, -450, 3449, 224, 2750, 273, - -450, -450, -450, -450, 229, 231, 1421, 233, 1421, 234, - 1421, 245, 42, -450, -450, 2784, 1421, -450, 1727, 239, - 1261, 1727, 1421, -450, -450, 248, 255, -450, 256, -450, - 262, 1421, -450, -450, 43, -450, -450, 263, -450, 2818, - 259, 272, 274, 45, -450, 1727, 1727, -450, -450, -450, - -450, -450, -450 - }; - - const short - parser::yydefact_[] = - { - 3, 12, 13, 0, 0, 0, 0, 0, 0, 253, - 252, 0, 2, 7, 8, 9, 14, 15, 0, 256, - 255, 0, 0, 0, 0, 0, 0, 1, 4, 5, - 6, 196, 0, 10, 11, 258, 0, 196, 196, 196, - 0, 194, 195, 254, 0, 0, 0, 0, 0, 0, - 0, 16, 0, 0, 0, 0, 17, 192, 193, 250, - 0, 266, 265, 244, 245, 246, 247, 248, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 252, 257, 260, 262, 264, 197, - 91, 92, 93, 130, 131, 132, 133, 134, 182, 183, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 0, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 0, 168, 169, 170, 171, 172, - 173, 174, 175, 18, 19, 20, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 54, 0, 0, 0, 45, 50, 0, - 46, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 0, 0, 0, 234, 235, - 0, 0, 0, 0, 0, 0, 0, 236, 237, 0, - 238, 239, 240, 241, 242, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 243, 221, 181, 176, 0, 261, 263, 234, 235, 179, - 180, 178, 0, 177, 249, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 184, 185, 0, 199, 0, 52, 48, - 0, 0, 73, 0, 0, 0, 58, 0, 0, 0, - 0, 0, 84, 85, 86, 88, 0, 199, 199, 0, - 107, 109, 53, 49, 62, 63, 64, 59, 60, 0, - 0, 0, 0, 0, 108, 110, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 199, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 212, 0, 0, 0, 0, 0, 0, 0, 0, - 233, 0, 0, 0, 0, 123, 124, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 125, 126, - 127, 128, 129, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 232, 251, 231, 201, 0, 198, 222, 51, - 47, 68, 0, 0, 0, 0, 55, 56, 57, 0, - 0, 0, 83, 82, 87, 0, 0, 0, 0, 0, - 0, 0, 96, 102, 103, 104, 105, 106, 97, 98, - 99, 101, 100, 0, 0, 0, 0, 0, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 213, 214, 215, - 216, 217, 218, 0, 220, 0, 0, 0, 224, 225, - 226, 227, 228, 229, 230, 223, 186, 0, 199, 0, - 0, 0, 95, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 188, 199, 0, 0, 0, 0, - 111, 200, 0, 74, 0, 76, 94, 0, 0, 0, - 81, 89, 90, 61, 0, 0, 199, 0, 199, 0, - 199, 0, 0, 202, 219, 0, 199, 187, 0, 0, - 58, 0, 0, 65, 67, 0, 198, 70, 198, 72, - 198, 199, 189, 259, 0, 75, 77, 0, 79, 0, - 0, 0, 0, 0, 190, 0, 0, 66, 69, 71, - 191, 78, 80 - }; - - const short - parser::yypgoto_[] = - { - -450, -450, -450, 316, 330, 331, -450, -450, -73, 179, - -450, -450, -450, -43, -169, -450, -450, -450, -450, -450, - -450, -450, -450, -450, -450, -450, -450, -450, -450, -450, - -450, -450, -450, -450, -450, -450, -450, -450, 892, -450, - -302, -291, -290, -450, -450, -450, -450, -450, -450, -36, - -29, -133, -111, 120, 317, -275, -449, -450, -450, -450, - -450, -450, -450, 17, -450, -450, -450, -450, -450, 56, - 70, 99, 109, 162, 169, -450, -450, 203, 257, -450, - 276, 291, -450, -450, 357, 491, 527, 589, -450, -450, - -450, 0, 10, -450, -20, -450, -450, -450, 200, -450, - -450 - }; - - const short - parser::yydefgoto_[] = - { - 0, 11, 12, 13, 14, 15, 16, 17, 177, 178, - 300, 179, 180, 181, 415, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 405, 507, - 205, 206, 207, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 40, 41, 535, 407, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 404, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152 - }; - - const short - parser::yytable_[] = - { - 18, 293, 23, 36, 416, 56, 24, 25, 26, 153, - 154, 155, 18, 21, 22, 417, 418, 9, 27, 208, - 402, 406, 309, 294, 483, -242, 209, 32, 35, -242, - 31, 42, 98, 19, 20, 9, 48, 42, 42, 42, - 35, 49, 425, 426, 1, 2, 3, 4, 5, 58, - 6, 7, 8, 33, 296, 224, 257, 34, -242, 37, - 227, -242, -234, 258, 226, 225, -234, 536, 484, 538, - 228, 540, 210, 38, 445, 52, 53, 54, 9, 476, - 49, 49, 49, 299, 477, 486, 293, 304, 10, 251, - 477, 403, 263, 249, 250, -234, 487, 39, -234, -242, - -242, 477, 225, 43, 51, 19, 94, 494, 294, 210, - 527, 211, 477, 542, 554, 477, 560, 44, 477, 477, - 208, 477, 50, 55, 208, 212, -255, 209, 229, 293, - 230, 209, 231, 232, 295, 233, -234, -234, 234, 257, - 257, 235, 236, 208, 225, 310, 258, 258, 211, 10, - 209, 294, 237, 238, 213, 239, 224, 45, 46, 47, - 224, 240, 212, 241, 214, 242, 225, 281, 282, 283, - 225, 243, 319, 210, 244, 224, 224, 210, -235, 224, - 245, 246, -235, 247, 297, 225, 225, 293, 293, 225, - 264, 213, 210, 210, 302, 284, 210, 285, 286, 287, - 288, 214, 289, 502, 279, 280, 281, 282, 283, 294, - 294, -235, 211, 290, -235, 303, 211, 215, 305, 295, - 522, 306, 307, 308, 216, 312, 212, 410, 416, 225, - 212, 211, 211, 317, 313, 211, 314, 318, 249, 417, - 418, 324, 296, 347, 349, 212, 212, 348, 325, 212, - 326, 544, -235, -235, 215, 213, 327, 328, 217, 213, - 350, 216, 295, 361, 208, 214, 553, 413, 256, 214, - 257, 209, 225, 422, 213, 213, 423, 258, 213, 427, - 428, 429, 430, 431, 214, 214, 293, 403, 214, 478, - 480, 495, 499, 526, 482, 259, 511, 408, 512, -236, - 224, 521, 528, -236, 530, 532, 224, 420, 294, 533, - 225, 534, 218, 537, 539, 541, 225, 210, 215, 546, - 295, 295, 215, 210, 477, 216, 550, 551, 28, 216, - 225, 225, -236, 552, 555, -236, -237, 215, 215, 557, - -237, 215, 29, 30, 216, 216, 219, 443, 216, 260, - 446, 60, 558, -238, 559, 9, 211, -238, 323, 217, - -239, 547, 211, 217, -239, 311, 57, 0, 261, -237, - 212, 0, -237, -236, -236, 0, 212, 0, 217, 217, - 0, 0, 217, 262, 291, 0, -238, 292, 0, -238, - 0, 0, 0, -239, 0, 0, -239, 0, 0, 213, - 0, 0, 0, 0, 0, 213, 503, 0, 505, 214, - -237, -237, 220, 218, 0, 214, 0, 218, 0, 295, - 0, 0, 0, 0, 0, 19, 94, -238, -238, 225, - 0, 0, 218, 218, -239, -239, 218, 0, 0, 0, - -240, 0, 510, 208, -240, 208, 0, 219, 0, 220, - 209, 219, 209, 0, 0, 545, 0, 0, 548, 0, - 0, 0, 215, 0, 0, 0, 320, 321, 215, 216, - 219, 0, 0, -240, 0, 216, -240, 0, 0, 224, - 0, 224, 561, 562, 509, 0, 0, 0, 0, 225, - 0, 225, 208, 0, 257, 208, 210, 0, 210, 209, - 0, 258, 209, 217, 0, 0, 0, 0, 0, 217, - 0, 0, 0, 220, -240, -240, 0, 220, 0, 208, - 208, 0, 0, 0, 0, 0, 209, 209, 224, 0, - 224, 224, 220, 220, 0, 211, 220, 211, 225, 0, - 225, 225, 0, 0, 0, 210, 221, 210, 210, 212, - 0, 212, 0, 0, 0, 224, 224, 218, 0, 0, - -241, 0, 0, 218, -241, 225, 225, 0, 0, 0, - 0, 60, 210, 210, 0, 9, 0, 0, 213, 0, - 213, 0, 222, 221, 211, 0, 211, 211, 214, 0, - 214, 219, 0, -241, 266, 267, -241, 419, 212, 0, - 212, 212, 0, 0, 291, 0, 0, 333, 0, 0, - 0, 211, 211, 0, 0, 0, 0, 0, 0, 222, - 279, 280, 281, 282, 283, 212, 212, 213, 0, 213, - 213, 0, 0, 0, -241, -241, 0, 214, 0, 214, - 214, 215, 0, 215, 223, 19, 94, 221, 216, 0, - 216, 221, 0, 0, 213, 213, 0, 220, 0, 0, - 0, 0, 0, 220, 214, 214, 221, 221, 0, 0, - 221, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 223, 217, 222, 217, 0, 0, 222, 0, 0, - 215, 0, 215, 215, 0, 0, 0, 216, 0, 216, - 216, 0, 222, 222, 0, 0, 222, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 215, 215, 60, - 0, 0, 0, 9, 216, 216, 0, 0, 0, 0, - 0, 217, 0, 217, 217, 0, 218, 0, 218, 0, - 0, 0, 0, 0, 0, 223, 0, 0, 0, 223, - 0, 0, 291, 0, 0, 333, 0, 0, 217, 217, - 334, 335, 0, 0, 223, 223, 0, 0, 223, 0, - 219, 0, 219, 0, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 218, 0, 218, 218, 0, - 0, 221, 0, 19, 94, 0, 0, 221, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 218, 218, 0, 0, 0, 0, 0, 219, - 0, 419, 219, 0, 0, 0, 0, 222, 59, 0, - 0, 0, 0, 222, 0, 0, 220, 0, 220, 0, - 0, 0, 0, 0, 0, 0, 219, 219, 0, 0, - 0, 0, 0, 60, 61, 62, 63, 9, 64, 65, - 66, 67, 0, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 0, 0, 220, 88, 220, 220, 223, - 89, 0, 315, 0, 0, 223, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 90, 91, 266, 267, - 0, 0, 220, 220, 272, 273, 274, 275, 0, 0, - 0, 0, 0, 92, 0, 0, 93, 19, 94, 35, - 95, 96, 97, 98, 279, 280, 281, 282, 283, 156, - 0, 0, 99, 0, 0, 0, 0, 0, 0, 0, - 157, 0, 0, 158, 159, 0, 160, 161, 162, 163, - 0, 164, 165, 166, 167, 168, 169, 170, 171, 60, - 221, 0, 221, 9, 64, 65, 66, 67, 172, 248, - 0, 0, 252, 253, 0, 74, 0, 0, 0, 0, - 0, 80, 81, 82, 83, 84, 85, 0, 0, 0, - 55, 173, 174, 0, 0, 0, 222, 0, 222, 0, - 175, 176, 329, 330, 0, 331, 332, 0, 0, 221, - 0, 221, 221, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 60, 0, 0, 0, 9, 0, 0, - 0, 0, 0, 19, 94, 0, 221, 221, 0, 301, - 0, 0, 0, 0, 0, 222, 0, 222, 222, 0, - 0, 316, 0, 0, 0, 0, 291, 0, 223, 333, - 223, 0, 0, 0, 334, 335, 0, 0, 0, 0, - 0, 0, 222, 222, 0, 0, 0, 0, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 0, - 0, 0, 0, 0, 0, 0, 0, 19, 94, 0, - 0, 0, 0, 0, 0, 0, 0, 223, 0, 223, - 223, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 360, 0, 362, 363, 364, 365, 366, 367, 368, 369, - 0, 372, 0, 0, 223, 223, 373, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 374, 375, 376, - 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, - 397, 398, 399, 401, 266, 267, 0, 269, 270, 271, - 272, 273, 274, 275, 0, 412, 0, 414, 0, 0, - 421, 0, 0, 0, 0, 0, 0, 276, 277, 278, - 279, 280, 281, 282, 283, 0, 0, 266, 267, 0, - 0, 270, 271, 272, 273, 274, 275, 0, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 0, - 444, 277, 156, 279, 280, 281, 282, 283, 0, 0, - 0, 0, 0, 157, 0, 0, 158, 159, 0, 160, - 161, 162, 163, 465, 164, 165, 166, 167, 168, 169, - 170, 171, 60, 0, 0, 0, 9, 64, 65, 66, - 67, 172, 0, 0, 0, 0, 0, 0, 74, 0, - 0, 0, 372, 0, 80, 81, 82, 83, 84, 85, - 0, 0, 60, 55, 322, 174, 9, 64, 65, 66, - 67, 0, 0, 175, 176, 0, 0, 0, 74, 488, - 489, 490, 491, 492, 80, 81, 82, 83, 84, 85, - 0, 0, 0, 0, 0, 174, 0, 0, 0, 496, - 0, 0, 0, 175, 176, 0, 19, 94, 0, 0, - 0, 0, 0, 0, 0, 497, 59, 0, 0, 500, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 501, - 0, 0, 504, 0, 506, 508, 19, 94, 0, 0, - 0, 60, 61, 62, 63, 9, 64, 65, 66, 67, - 525, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 0, 0, 0, 400, 250, 0, 0, 89, 0, - 0, 0, 0, 0, 549, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 90, 91, 0, 59, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 92, 0, 0, 93, 19, 94, 35, 95, 96, - 97, 98, 60, 61, 62, 63, 9, 64, 65, 66, - 67, 0, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 466, 0, 0, 88, 0, 0, 265, 89, - 0, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 0, 0, 0, 0, 90, 91, 0, 59, 0, - 0, 0, 0, 0, 276, 277, 278, 279, 280, 281, - 282, 283, 92, 0, 0, 93, 19, 94, 35, 95, - 96, 97, 98, 60, 61, 62, 63, 9, 64, 65, - 66, 67, 0, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 0, 0, 0, 400, 0, 0, 0, - 89, 0, 60, 0, 0, 0, 9, 64, 65, 66, - 67, 0, 0, 0, 0, 0, 90, 91, 74, 0, - 0, 0, 0, 0, 80, 81, 82, 83, 84, 85, - 0, 254, 0, 92, 298, 174, 93, 19, 94, 35, - 95, 96, 97, 98, 157, 0, 0, 158, 159, 0, - 160, 161, 162, 163, 0, 164, 165, 166, 167, 168, - 169, 170, 171, 60, 0, 0, 0, 9, 64, 65, - 66, 67, 172, 0, 0, 0, 19, 94, 0, 74, - 0, 255, 256, 0, 0, 80, 81, 82, 83, 84, - 85, 0, 0, 0, 55, 0, 174, 409, 0, 0, - 0, 0, 0, 0, 175, 176, 0, 157, 0, 0, - 158, 159, 0, 160, 161, 162, 163, 0, 164, 165, - 166, 167, 168, 169, 170, 171, 60, 0, 0, 0, - 9, 64, 65, 66, 67, 172, 0, 19, 94, 0, - 0, 0, 74, 0, 0, 0, 0, 0, 80, 81, - 82, 83, 84, 85, 0, 0, 0, 55, 0, 174, - 0, 0, 0, 0, 0, 0, 0, 175, 176, 157, - 0, 0, 158, 159, 0, 160, 161, 162, 163, 0, - 164, 165, 166, 167, 168, 169, 170, 171, 60, 0, - 0, 0, 9, 64, 65, 66, 67, 172, 0, 0, - 19, 94, 0, 0, 74, 0, 0, 0, 0, 0, - 80, 81, 82, 83, 84, 85, 0, 0, 60, 55, - 0, 174, 9, 64, 65, 66, 67, 0, 0, 175, - 176, 0, 0, 0, 74, 0, 0, 0, 0, 0, - 80, 81, 82, 83, 84, 85, 0, 0, 0, 0, - 0, 174, 0, 0, 0, 0, 0, 0, 0, 370, - 0, 0, 19, 94, 371, 0, 0, 0, 0, 265, - 0, 0, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 19, 94, 0, 276, 277, 278, 279, 280, - 281, 282, 283, 515, 0, 0, 0, 0, 516, 0, - 0, 0, 0, 265, 0, 0, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 276, - 277, 278, 279, 280, 281, 282, 283, 517, 0, 0, - 0, 0, 518, 0, 0, 0, 0, 265, 0, 0, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 276, 277, 278, 279, 280, 281, 282, - 283, 519, 0, 0, 0, 0, 520, 0, 0, 0, - 0, 265, 0, 0, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 448, 0, 276, 277, 278, - 279, 280, 281, 282, 283, 265, 0, 0, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 449, - 0, 276, 277, 278, 279, 280, 281, 282, 283, 265, - 0, 0, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 450, 0, 276, 277, 278, 279, 280, - 281, 282, 283, 265, 0, 0, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 451, 0, 276, - 277, 278, 279, 280, 281, 282, 283, 265, 0, 0, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 452, 0, 276, 277, 278, 279, 280, 281, 282, - 283, 265, 0, 0, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 453, 0, 276, 277, 278, - 279, 280, 281, 282, 283, 265, 0, 0, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 454, - 0, 276, 277, 278, 279, 280, 281, 282, 283, 265, - 0, 0, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 455, 0, 276, 277, 278, 279, 280, - 281, 282, 283, 265, 0, 0, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 456, 0, 276, - 277, 278, 279, 280, 281, 282, 283, 265, 0, 0, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 457, 0, 276, 277, 278, 279, 280, 281, 282, - 283, 265, 0, 0, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 458, 0, 276, 277, 278, - 279, 280, 281, 282, 283, 265, 0, 0, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 459, - 0, 276, 277, 278, 279, 280, 281, 282, 283, 265, - 0, 0, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 460, 0, 276, 277, 278, 279, 280, - 281, 282, 283, 265, 0, 0, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 461, 0, 276, - 277, 278, 279, 280, 281, 282, 283, 265, 0, 0, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 462, 0, 276, 277, 278, 279, 280, 281, 282, - 283, 265, 0, 0, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 464, 0, 276, 277, 278, - 279, 280, 281, 282, 283, 265, 0, 0, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 370, - 0, 276, 277, 278, 279, 280, 281, 282, 283, 265, - 0, 0, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 479, 0, 276, 277, 278, 279, 280, - 281, 282, 283, 265, 0, 0, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 481, 0, 276, - 277, 278, 279, 280, 281, 282, 283, 265, 0, 0, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 485, 0, 276, 277, 278, 279, 280, 281, 282, - 283, 265, 0, 0, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 514, 0, 276, 277, 278, - 279, 280, 281, 282, 283, 265, 0, 0, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 523, - 0, 276, 277, 278, 279, 280, 281, 282, 283, 265, - 0, 0, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 524, 0, 276, 277, 278, 279, 280, - 281, 282, 283, 265, 0, 0, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 529, 0, 276, - 277, 278, 279, 280, 281, 282, 283, 265, 0, 0, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 531, 0, 276, 277, 278, 279, 280, 281, 282, - 283, 265, 0, 0, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 543, 0, 276, 277, 278, - 279, 280, 281, 282, 283, 265, 0, 0, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 556, - 0, 276, 277, 278, 279, 280, 281, 282, 283, 265, - 0, 0, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 276, 277, 278, 279, 280, - 281, 282, 283, 468, 0, 0, 0, 0, 0, 265, - 0, 0, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 276, 277, 278, 279, 280, - 281, 282, 283, 469, 0, 0, 0, 0, 0, 265, - 0, 0, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 276, 277, 278, 279, 280, - 281, 282, 283, 470, 0, 0, 0, 0, 0, 265, - 0, 0, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 276, 277, 278, 279, 280, - 281, 282, 283, 471, 0, 0, 0, 0, 0, 265, - 0, 0, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 276, 277, 278, 279, 280, - 281, 282, 283, 472, 0, 0, 0, 0, 0, 265, - 0, 0, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 276, 277, 278, 279, 280, - 281, 282, 283, 473, 0, 0, 0, 0, 0, 265, - 0, 0, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 276, 277, 278, 279, 280, - 281, 282, 283, 474, 0, 0, 0, 0, 0, 265, - 0, 0, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 276, 277, 278, 279, 280, - 281, 282, 283, 475, 0, 0, 0, 0, 0, 265, - 0, 0, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 276, 277, 278, 279, 280, - 281, 282, 283, 493, 0, 0, 0, 0, 0, 265, - 0, 0, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 276, 277, 278, 279, 280, - 281, 282, 283, 447, 0, 0, 0, 0, 265, 0, - 0, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 276, 277, 278, 279, 280, 281, - 282, 283, 463, 0, 0, 0, 0, 265, 0, 0, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 276, 277, 278, 279, 280, 281, 282, - 283, 498, 0, 0, 0, 0, 265, 0, 0, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 276, 277, 278, 279, 280, 281, 282, 283, - 467, 0, 265, 0, 0, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 276, 277, - 278, 279, 280, 281, 282, 283, 411, 265, 0, 0, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 276, 277, 278, 279, 280, 281, 282, - 283, 424, 265, 0, 0, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 276, 277, - 278, 279, 280, 281, 282, 283, 513, 265, 0, 0, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 265, 0, 0, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 0, 0, 0, 0, 0, 276, 277, 278, 279, - 280, 281, 282, 283, 266, 267, 0, 0, 270, 271, - 272, 273, 274, 275, 266, 267, 0, 0, 270, 271, - 272, 273, 274, 275, 0, 0, 0, 276, 277, 278, - 279, 280, 281, 282, 283, 0, 0, 0, 277, 278, - 279, 280, 281, 282, 283, 266, 267, 0, 0, 270, - 271, 272, 273, 274, 275, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 279, 280, 281, 282, 283 - }; - - const short - parser::yycheck_[] = - { - 0, 134, 70, 23, 306, 48, 6, 7, 8, 52, - 53, 54, 12, 3, 4, 306, 306, 45, 0, 55, - 45, 296, 111, 134, 32, 41, 55, 113, 117, 45, - 70, 31, 121, 115, 116, 45, 71, 37, 38, 39, - 117, 76, 317, 318, 11, 12, 13, 14, 15, 49, - 17, 18, 19, 80, 70, 55, 92, 80, 74, 70, - 60, 77, 41, 92, 74, 55, 45, 516, 76, 518, - 60, 520, 55, 70, 349, 71, 71, 71, 45, 71, - 76, 76, 76, 156, 76, 71, 219, 160, 116, 89, - 76, 116, 92, 74, 75, 74, 71, 70, 77, 115, - 116, 76, 92, 116, 80, 115, 116, 71, 219, 92, - 71, 55, 76, 71, 71, 76, 71, 71, 76, 76, - 156, 76, 96, 72, 160, 55, 78, 156, 70, 262, - 70, 160, 70, 70, 134, 70, 115, 116, 70, 175, - 176, 70, 70, 179, 134, 165, 175, 176, 92, 116, - 179, 262, 70, 70, 55, 70, 156, 37, 38, 39, - 160, 70, 92, 70, 55, 70, 156, 112, 113, 114, - 160, 70, 172, 156, 70, 175, 176, 160, 41, 179, - 70, 70, 45, 70, 78, 175, 176, 320, 321, 179, - 116, 92, 175, 176, 80, 74, 179, 74, 74, 74, - 74, 92, 74, 478, 110, 111, 112, 113, 114, 320, - 321, 74, 156, 74, 77, 70, 160, 55, 70, 219, - 495, 70, 70, 70, 55, 79, 156, 300, 530, 219, - 160, 175, 176, 70, 80, 179, 80, 70, 74, 530, - 530, 80, 70, 78, 70, 175, 176, 74, 80, 179, - 80, 526, 115, 116, 92, 156, 80, 80, 55, 160, - 78, 92, 262, 71, 300, 156, 541, 29, 121, 160, - 306, 300, 262, 79, 175, 176, 79, 306, 179, 96, - 70, 70, 70, 70, 175, 176, 419, 116, 179, 70, - 70, 70, 75, 70, 80, 92, 80, 297, 80, 41, - 300, 75, 27, 45, 80, 32, 306, 307, 419, 80, - 300, 80, 55, 80, 80, 70, 306, 300, 156, 80, - 320, 321, 160, 306, 76, 156, 71, 71, 12, 160, - 320, 321, 74, 71, 71, 77, 41, 175, 176, 80, - 45, 179, 12, 12, 175, 176, 55, 347, 179, 92, - 350, 41, 80, 41, 80, 45, 300, 45, 179, 156, - 41, 530, 306, 160, 45, 165, 49, -1, 92, 74, - 300, -1, 77, 115, 116, -1, 306, -1, 175, 176, - -1, -1, 179, 92, 74, -1, 74, 77, -1, 77, - -1, -1, -1, 74, -1, -1, 77, -1, -1, 300, - -1, -1, -1, -1, -1, 306, 479, -1, 481, 300, - 115, 116, 55, 156, -1, 306, -1, 160, -1, 419, - -1, -1, -1, -1, -1, 115, 116, 115, 116, 419, - -1, -1, 175, 176, 115, 116, 179, -1, -1, -1, - 41, -1, 485, 479, 45, 481, -1, 156, -1, 92, - 479, 160, 481, -1, -1, 528, -1, -1, 531, -1, - -1, -1, 300, -1, -1, -1, 175, 176, 306, 300, - 179, -1, -1, 74, -1, 306, 77, -1, -1, 479, - -1, 481, 555, 556, 484, -1, -1, -1, -1, 479, - -1, 481, 528, -1, 530, 531, 479, -1, 481, 528, - -1, 530, 531, 300, -1, -1, -1, -1, -1, 306, - -1, -1, -1, 156, 115, 116, -1, 160, -1, 555, - 556, -1, -1, -1, -1, -1, 555, 556, 528, -1, - 530, 531, 175, 176, -1, 479, 179, 481, 528, -1, - 530, 531, -1, -1, -1, 528, 55, 530, 531, 479, - -1, 481, -1, -1, -1, 555, 556, 300, -1, -1, - 41, -1, -1, 306, 45, 555, 556, -1, -1, -1, - -1, 41, 555, 556, -1, 45, -1, -1, 479, -1, - 481, -1, 55, 92, 528, -1, 530, 531, 479, -1, - 481, 300, -1, 74, 84, 85, 77, 306, 528, -1, - 530, 531, -1, -1, 74, -1, -1, 77, -1, -1, - -1, 555, 556, -1, -1, -1, -1, -1, -1, 92, - 110, 111, 112, 113, 114, 555, 556, 528, -1, 530, - 531, -1, -1, -1, 115, 116, -1, 528, -1, 530, - 531, 479, -1, 481, 55, 115, 116, 156, 479, -1, - 481, 160, -1, -1, 555, 556, -1, 300, -1, -1, - -1, -1, -1, 306, 555, 556, 175, 176, -1, -1, - 179, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 92, 479, 156, 481, -1, -1, 160, -1, -1, - 528, -1, 530, 531, -1, -1, -1, 528, -1, 530, - 531, -1, 175, 176, -1, -1, 179, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 555, 556, 41, - -1, -1, -1, 45, 555, 556, -1, -1, -1, -1, - -1, 528, -1, 530, 531, -1, 479, -1, 481, -1, - -1, -1, -1, -1, -1, 156, -1, -1, -1, 160, - -1, -1, 74, -1, -1, 77, -1, -1, 555, 556, - 82, 83, -1, -1, 175, 176, -1, -1, 179, -1, - 479, -1, 481, -1, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 528, -1, 530, 531, -1, - -1, 300, -1, 115, 116, -1, -1, 306, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 555, 556, -1, -1, -1, -1, -1, 528, - -1, 530, 531, -1, -1, -1, -1, 300, 16, -1, - -1, -1, -1, 306, -1, -1, 479, -1, 481, -1, - -1, -1, -1, -1, -1, -1, 555, 556, -1, -1, - -1, -1, -1, 41, 42, 43, 44, 45, 46, 47, - 48, 49, -1, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, -1, -1, 528, 74, 530, 531, 300, - 78, -1, 80, -1, -1, 306, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 94, 95, 84, 85, - -1, -1, 555, 556, 90, 91, 92, 93, -1, -1, - -1, -1, -1, 111, -1, -1, 114, 115, 116, 117, - 118, 119, 120, 121, 110, 111, 112, 113, 114, 11, - -1, -1, 50, -1, -1, -1, -1, -1, -1, -1, - 22, -1, -1, 25, 26, -1, 28, 29, 30, 31, - -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 479, -1, 481, 45, 46, 47, 48, 49, 50, 87, - -1, -1, 90, 91, -1, 57, -1, -1, -1, -1, - -1, 63, 64, 65, 66, 67, 68, -1, -1, -1, - 72, 73, 74, -1, -1, -1, 479, -1, 481, -1, - 82, 83, 20, 21, -1, 23, 24, -1, -1, 528, - -1, 530, 531, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 41, -1, -1, -1, 45, -1, -1, - -1, -1, -1, 115, 116, -1, 555, 556, -1, 157, - -1, -1, -1, -1, -1, 528, -1, 530, 531, -1, - -1, 169, -1, -1, -1, -1, 74, -1, 479, 77, - 481, -1, -1, -1, 82, 83, -1, -1, -1, -1, - -1, -1, 555, 556, -1, -1, -1, -1, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, -1, - -1, -1, -1, -1, -1, -1, -1, 115, 116, -1, - -1, -1, -1, -1, -1, -1, -1, 528, -1, 530, - 531, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, -1, 240, 241, 242, 243, 244, 245, 246, 247, - -1, 249, -1, -1, 555, 556, 254, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 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, 84, 85, -1, 87, 88, 89, - 90, 91, 92, 93, -1, 303, -1, 305, -1, -1, - 308, -1, -1, -1, -1, -1, -1, 107, 108, 109, - 110, 111, 112, 113, 114, -1, -1, 84, 85, -1, - -1, 88, 89, 90, 91, 92, 93, -1, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, -1, - 348, 108, 11, 110, 111, 112, 113, 114, -1, -1, - -1, -1, -1, 22, -1, -1, 25, 26, -1, 28, - 29, 30, 31, 371, 33, 34, 35, 36, 37, 38, - 39, 40, 41, -1, -1, -1, 45, 46, 47, 48, - 49, 50, -1, -1, -1, -1, -1, -1, 57, -1, - -1, -1, 400, -1, 63, 64, 65, 66, 67, 68, - -1, -1, 41, 72, 73, 74, 45, 46, 47, 48, - 49, -1, -1, 82, 83, -1, -1, -1, 57, 427, - 428, 429, 430, 431, 63, 64, 65, 66, 67, 68, - -1, -1, -1, -1, -1, 74, -1, -1, -1, 447, - -1, -1, -1, 82, 83, -1, 115, 116, -1, -1, - -1, -1, -1, -1, -1, 463, 16, -1, -1, 467, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 477, - -1, -1, 480, -1, 482, 483, 115, 116, -1, -1, - -1, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 498, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, -1, -1, -1, 74, 75, -1, -1, 78, -1, - -1, -1, -1, -1, 532, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 94, 95, -1, 16, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 111, -1, -1, 114, 115, 116, 117, 118, 119, - 120, 121, 41, 42, 43, 44, 45, 46, 47, 48, - 49, -1, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 75, -1, -1, 74, -1, -1, 81, 78, - -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, -1, -1, -1, -1, 94, 95, -1, 16, -1, - -1, -1, -1, -1, 107, 108, 109, 110, 111, 112, - 113, 114, 111, -1, -1, 114, 115, 116, 117, 118, - 119, 120, 121, 41, 42, 43, 44, 45, 46, 47, - 48, 49, -1, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, -1, -1, -1, 74, -1, -1, -1, - 78, -1, 41, -1, -1, -1, 45, 46, 47, 48, - 49, -1, -1, -1, -1, -1, 94, 95, 57, -1, - -1, -1, -1, -1, 63, 64, 65, 66, 67, 68, - -1, 70, -1, 111, 12, 74, 114, 115, 116, 117, - 118, 119, 120, 121, 22, -1, -1, 25, 26, -1, - 28, 29, 30, 31, -1, 33, 34, 35, 36, 37, - 38, 39, 40, 41, -1, -1, -1, 45, 46, 47, - 48, 49, 50, -1, -1, -1, 115, 116, -1, 57, - -1, 120, 121, -1, -1, 63, 64, 65, 66, 67, - 68, -1, -1, -1, 72, -1, 74, 12, -1, -1, - -1, -1, -1, -1, 82, 83, -1, 22, -1, -1, - 25, 26, -1, 28, 29, 30, 31, -1, 33, 34, - 35, 36, 37, 38, 39, 40, 41, -1, -1, -1, - 45, 46, 47, 48, 49, 50, -1, 115, 116, -1, - -1, -1, 57, -1, -1, -1, -1, -1, 63, 64, - 65, 66, 67, 68, -1, -1, -1, 72, -1, 74, - -1, -1, -1, -1, -1, -1, -1, 82, 83, 22, - -1, -1, 25, 26, -1, 28, 29, 30, 31, -1, - 33, 34, 35, 36, 37, 38, 39, 40, 41, -1, - -1, -1, 45, 46, 47, 48, 49, 50, -1, -1, - 115, 116, -1, -1, 57, -1, -1, -1, -1, -1, - 63, 64, 65, 66, 67, 68, -1, -1, 41, 72, - -1, 74, 45, 46, 47, 48, 49, -1, -1, 82, - 83, -1, -1, -1, 57, -1, -1, -1, -1, -1, - 63, 64, 65, 66, 67, 68, -1, -1, -1, -1, - -1, 74, -1, -1, -1, -1, -1, -1, -1, 71, - -1, -1, 115, 116, 76, -1, -1, -1, -1, 81, - -1, -1, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 115, 116, -1, 107, 108, 109, 110, 111, - 112, 113, 114, 71, -1, -1, -1, -1, 76, -1, - -1, -1, -1, 81, -1, -1, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 107, - 108, 109, 110, 111, 112, 113, 114, 71, -1, -1, - -1, -1, 76, -1, -1, -1, -1, 81, -1, -1, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 107, 108, 109, 110, 111, 112, 113, - 114, 71, -1, -1, -1, -1, 76, -1, -1, -1, - -1, 81, -1, -1, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 71, -1, 107, 108, 109, - 110, 111, 112, 113, 114, 81, -1, -1, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 71, - -1, 107, 108, 109, 110, 111, 112, 113, 114, 81, - -1, -1, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 71, -1, 107, 108, 109, 110, 111, - 112, 113, 114, 81, -1, -1, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 71, -1, 107, - 108, 109, 110, 111, 112, 113, 114, 81, -1, -1, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 71, -1, 107, 108, 109, 110, 111, 112, 113, - 114, 81, -1, -1, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 71, -1, 107, 108, 109, - 110, 111, 112, 113, 114, 81, -1, -1, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 71, - -1, 107, 108, 109, 110, 111, 112, 113, 114, 81, - -1, -1, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 71, -1, 107, 108, 109, 110, 111, - 112, 113, 114, 81, -1, -1, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 71, -1, 107, - 108, 109, 110, 111, 112, 113, 114, 81, -1, -1, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 71, -1, 107, 108, 109, 110, 111, 112, 113, - 114, 81, -1, -1, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 71, -1, 107, 108, 109, - 110, 111, 112, 113, 114, 81, -1, -1, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 71, - -1, 107, 108, 109, 110, 111, 112, 113, 114, 81, - -1, -1, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 71, -1, 107, 108, 109, 110, 111, - 112, 113, 114, 81, -1, -1, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 71, -1, 107, - 108, 109, 110, 111, 112, 113, 114, 81, -1, -1, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 71, -1, 107, 108, 109, 110, 111, 112, 113, - 114, 81, -1, -1, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 71, -1, 107, 108, 109, - 110, 111, 112, 113, 114, 81, -1, -1, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 71, - -1, 107, 108, 109, 110, 111, 112, 113, 114, 81, - -1, -1, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 71, -1, 107, 108, 109, 110, 111, - 112, 113, 114, 81, -1, -1, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 71, -1, 107, - 108, 109, 110, 111, 112, 113, 114, 81, -1, -1, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 71, -1, 107, 108, 109, 110, 111, 112, 113, - 114, 81, -1, -1, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 71, -1, 107, 108, 109, - 110, 111, 112, 113, 114, 81, -1, -1, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 71, - -1, 107, 108, 109, 110, 111, 112, 113, 114, 81, - -1, -1, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 71, -1, 107, 108, 109, 110, 111, - 112, 113, 114, 81, -1, -1, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 71, -1, 107, - 108, 109, 110, 111, 112, 113, 114, 81, -1, -1, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 71, -1, 107, 108, 109, 110, 111, 112, 113, - 114, 81, -1, -1, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 71, -1, 107, 108, 109, - 110, 111, 112, 113, 114, 81, -1, -1, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 71, - -1, 107, 108, 109, 110, 111, 112, 113, 114, 81, - -1, -1, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 107, 108, 109, 110, 111, - 112, 113, 114, 75, -1, -1, -1, -1, -1, 81, - -1, -1, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 107, 108, 109, 110, 111, - 112, 113, 114, 75, -1, -1, -1, -1, -1, 81, - -1, -1, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 107, 108, 109, 110, 111, - 112, 113, 114, 75, -1, -1, -1, -1, -1, 81, - -1, -1, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 107, 108, 109, 110, 111, - 112, 113, 114, 75, -1, -1, -1, -1, -1, 81, - -1, -1, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 107, 108, 109, 110, 111, - 112, 113, 114, 75, -1, -1, -1, -1, -1, 81, - -1, -1, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 107, 108, 109, 110, 111, - 112, 113, 114, 75, -1, -1, -1, -1, -1, 81, - -1, -1, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 107, 108, 109, 110, 111, - 112, 113, 114, 75, -1, -1, -1, -1, -1, 81, - -1, -1, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 107, 108, 109, 110, 111, - 112, 113, 114, 75, -1, -1, -1, -1, -1, 81, - -1, -1, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 107, 108, 109, 110, 111, - 112, 113, 114, 75, -1, -1, -1, -1, -1, 81, - -1, -1, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 107, 108, 109, 110, 111, - 112, 113, 114, 76, -1, -1, -1, -1, 81, -1, - -1, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 107, 108, 109, 110, 111, 112, - 113, 114, 76, -1, -1, -1, -1, 81, -1, -1, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 107, 108, 109, 110, 111, 112, 113, - 114, 76, -1, -1, -1, -1, 81, -1, -1, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 107, 108, 109, 110, 111, 112, 113, 114, - 79, -1, 81, -1, -1, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 107, 108, - 109, 110, 111, 112, 113, 114, 80, 81, -1, -1, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 107, 108, 109, 110, 111, 112, 113, - 114, 80, 81, -1, -1, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 107, 108, - 109, 110, 111, 112, 113, 114, 80, 81, -1, -1, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 81, -1, -1, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 107, 108, 109, 110, 111, 112, 113, - 114, -1, -1, -1, -1, -1, 107, 108, 109, 110, - 111, 112, 113, 114, 84, 85, -1, -1, 88, 89, - 90, 91, 92, 93, 84, 85, -1, -1, 88, 89, - 90, 91, 92, 93, -1, -1, -1, 107, 108, 109, - 110, 111, 112, 113, 114, -1, -1, -1, 108, 109, - 110, 111, 112, 113, 114, 84, 85, -1, -1, 88, - 89, 90, 91, 92, 93, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 110, 111, 112, 113, 114 - }; - - const unsigned char - parser::yystos_[] = - { - 0, 11, 12, 13, 14, 15, 17, 18, 19, 45, - 116, 132, 133, 134, 135, 136, 137, 138, 222, 115, - 116, 223, 223, 70, 222, 222, 222, 0, 134, 135, - 136, 70, 113, 80, 80, 117, 225, 70, 70, 70, - 184, 185, 222, 116, 71, 184, 184, 184, 71, 76, - 96, 80, 71, 71, 71, 72, 144, 185, 222, 16, - 41, 42, 43, 44, 46, 47, 48, 49, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 74, 78, - 94, 95, 111, 114, 116, 118, 119, 120, 121, 169, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 144, 144, 144, 11, 22, 25, 26, - 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, - 39, 40, 50, 73, 74, 82, 83, 139, 140, 142, - 143, 144, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 171, 172, 173, 180, 181, - 194, 200, 201, 202, 203, 204, 205, 208, 209, 212, - 215, 216, 217, 218, 222, 223, 74, 222, 223, 70, - 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, - 70, 70, 70, 70, 70, 70, 70, 70, 169, 74, - 75, 222, 169, 169, 70, 120, 121, 180, 181, 208, - 209, 211, 212, 222, 116, 81, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 107, 108, 109, 110, - 111, 112, 113, 114, 74, 74, 74, 74, 74, 74, - 74, 74, 77, 182, 183, 222, 70, 78, 12, 139, - 141, 169, 80, 70, 139, 70, 70, 70, 70, 111, - 225, 229, 79, 80, 80, 80, 169, 70, 70, 222, - 212, 212, 73, 140, 80, 80, 80, 80, 80, 20, - 21, 23, 24, 77, 82, 83, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 78, 74, 70, - 78, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 71, 169, 169, 169, 169, 169, 169, 169, 169, - 71, 76, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 74, 169, 45, 116, 221, 169, 186, 187, 222, 12, - 139, 80, 169, 29, 169, 145, 171, 172, 173, 212, - 222, 169, 79, 79, 80, 186, 186, 96, 70, 70, - 70, 70, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 222, 169, 186, 222, 76, 71, 71, - 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 71, 71, 76, 71, 169, 75, 79, 75, 75, - 75, 75, 75, 75, 75, 75, 71, 76, 70, 71, - 70, 71, 80, 32, 76, 71, 71, 71, 169, 169, - 169, 169, 169, 75, 71, 70, 169, 169, 76, 75, - 169, 169, 186, 139, 169, 139, 169, 170, 169, 222, - 144, 80, 80, 80, 71, 71, 76, 71, 76, 71, - 76, 75, 186, 71, 71, 169, 70, 71, 27, 71, - 80, 71, 32, 80, 80, 186, 187, 80, 187, 80, - 187, 70, 71, 71, 186, 139, 80, 145, 139, 169, - 71, 71, 71, 186, 71, 71, 71, 80, 80, 80, - 71, 139, 139 - }; - - const unsigned char - parser::yyr1_[] = - { - 0, 131, 132, 132, 133, 133, 133, 133, 133, 133, - 134, 135, 136, 136, 136, 136, 137, 138, 138, 138, - 138, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 140, 140, 141, 141, 142, - 142, 143, 143, 144, 144, 145, 145, 145, 145, 146, - 146, 147, 148, 148, 148, 149, 150, 150, 151, 152, - 152, 153, 153, 154, 155, 156, 157, 158, 159, 160, - 160, 161, 162, 162, 163, 164, 165, 166, 166, 167, - 168, 169, 169, 169, 170, 170, 171, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 171, 172, 172, 173, - 173, 174, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 177, 178, 178, 178, - 178, 179, 180, 180, 181, 181, 182, 182, 182, 182, - 183, 183, 184, 184, 184, 184, 184, 185, 186, 186, - 187, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 207, 208, 208, 208, 208, 208, 208, 208, - 208, 209, 210, 211, 212, 212, 212, 212, 212, 212, - 212, 212, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 222, 223, 223, 223, 224, 225, 226, - 227, 228, 228, 229, 229, 230, 231 - }; - - const signed char - parser::yyr2_[] = - { - 0, 2, 1, 0, 2, 2, 2, 1, 1, 1, - 3, 3, 1, 1, 1, 1, 5, 5, 6, 6, - 6, 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, 2, 1, 2, - 1, 3, 2, 3, 2, 1, 1, 1, 0, 2, - 2, 5, 2, 2, 2, 6, 8, 6, 3, 8, - 6, 8, 6, 2, 5, 7, 5, 7, 9, 7, - 9, 5, 3, 3, 2, 2, 2, 3, 2, 5, - 5, 1, 1, 1, 1, 0, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, - 2, 5, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 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, 2, 2, 2, 2, - 2, 2, 1, 1, 2, 2, 4, 6, 5, 7, - 8, 9, 3, 3, 1, 1, 0, 3, 1, 0, - 3, 1, 6, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 3, 4, 4, 4, 4, 4, 4, 6, - 4, 2, 3, 4, 4, 4, 4, 4, 4, 4, - 4, 3, 3, 3, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, - 1, 1, 1, 1, 3, 1, 1, 1, 1, 7, - 1, 2, 1, 2, 1, 1, 1 - }; - - - - -#if T6DEBUG - const short - parser::yyrline_[] = - { - 0, 295, 295, 296, 300, 302, 304, 306, 308, 310, - 315, 319, 324, 325, 326, 327, 331, 336, 338, 340, - 342, 347, 348, 349, 350, 351, 352, 353, 354, 355, - 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, - 366, 367, 368, 369, 370, 374, 375, 379, 381, 386, - 388, 393, 394, 398, 399, 403, 405, 407, 410, 414, - 416, 421, 426, 428, 430, 435, 440, 442, 447, 452, - 454, 459, 461, 466, 471, 476, 481, 486, 491, 496, - 498, 503, 508, 510, 515, 520, 525, 530, 532, 537, - 542, 547, 548, 549, 553, 554, 558, 560, 562, 564, - 566, 568, 570, 572, 574, 576, 578, 583, 585, 590, - 592, 597, 602, 604, 606, 608, 610, 612, 614, 616, - 618, 620, 622, 624, 626, 628, 630, 632, 634, 636, - 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, - 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, - 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, - 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 690, 695, 697, 699, - 701, 706, 711, 712, 715, 716, 720, 722, 724, 726, - 731, 733, 738, 740, 742, 744, 747, 751, 756, 759, - 763, 765, 770, 775, 780, 785, 790, 795, 800, 805, - 810, 815, 820, 825, 830, 835, 840, 845, 850, 855, - 860, 865, 867, 872, 874, 876, 878, 880, 882, 884, - 886, 891, 896, 901, 906, 907, 908, 909, 910, 911, - 912, 913, 914, 918, 923, 928, 933, 938, 943, 948, - 953, 958, 963, 965, 970, 972, 974, 979, 984, 989, - 994, 999, 1001, 1006, 1008, 1013, 1018 - }; - - void - parser::yy_stack_print_ () const - { - *yycdebug_ << "Stack now"; - for (stack_type::const_iterator - i = yystack_.begin (), - i_end = yystack_.end (); - i != i_end; ++i) - *yycdebug_ << ' ' << int (i->state); - *yycdebug_ << '\n'; - } - - void - parser::yy_reduce_print_ (int yyrule) const - { - int yylno = yyrline_[yyrule]; - int yynrhs = yyr2_[yyrule]; - // Print the symbols being reduced, and their result. - *yycdebug_ << "Reducing stack by rule " << yyrule - 1 - << " (line " << yylno << "):\n"; - // The symbols being reduced. - for (int yyi = 0; yyi < yynrhs; yyi++) - YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", - yystack_[(yynrhs) - (yyi + 1)]); - } -#endif // T6DEBUG - - -#line 13 "parser.ypp" -} } } // xsk::arc::t6 -#line 5515 "parser.cpp" - -#line 1022 "parser.ypp" - - -void xsk::arc::t6::parser::error(const xsk::arc::location& loc, const std::string& msg) -{ - throw xsk::arc::comp_error(loc, msg); -} diff --git a/src/t6/resolver.cpp b/src/t6/resolver.cpp deleted file mode 100644 index 01b6d84c..00000000 --- a/src/t6/resolver.cpp +++ /dev/null @@ -1,3658 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#include "xsk/stdinc.hpp" -#include "xsk/t6/t6.hpp" - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4244) -#endif - -namespace xsk::arc::t6 -{ - -std::unordered_map opcode_map; -std::unordered_map opcode_map_rev; -std::unordered_map dvar_map; -std::unordered_map> files; -std::function(const std::string&)> read_callback = nullptr; - -void resolver::init(read_cb_type callback) -{ - read_callback = callback; -} - -void resolver::cleanup() -{ - files.clear(); -} - -auto resolver::opcode_id(const std::string& name) -> std::uint8_t -{ - const auto itr = opcode_map_rev.find(name); - - if (itr != opcode_map_rev.end()) - { - return itr->second; - } - - throw error(utils::string::va("couldn't resolve opcode id for name '%s'!", name.data())); -} - -auto resolver::opcode_name(std::uint8_t id) -> std::string -{ - const auto itr = opcode_map.find(id); - - if (itr != opcode_map.end()) - { - return std::string(itr->second); - } - - throw error(utils::string::va("couldn't resolve opcode name for id '0x%hhX'!", id)); -} - -auto resolver::dvar_name(std::uint32_t id) -> std::string -{ - const auto itr = dvar_map.find(id); - - if (itr != dvar_map.end()) - { - return std::string(itr->second); - } - - return utils::string::va("_hash_%X", id); -} - -auto resolver::make_token(std::string_view str) -> std::string -{ - if (str.starts_with("_id_") || str.starts_with("_func_") || str.starts_with("_meth_")) - { - return std::string(str); - } - - auto data = std::string(str.begin(), str.end()); - - for (std::size_t i = 0; i < data.size(); i++) - { - data[i] = std::tolower(str[i]); - if (data[i] == '\\') data[i] = '/'; - } - - return data; -} - -auto resolver::file_data(const std::string& name) -> std::tuple -{ - const auto itr = files.find(name); - - if (itr != files.end()) - { - return { &itr->first ,reinterpret_cast(itr->second.data()), itr->second.size() }; - } - - auto data = read_callback(name); - - const auto res = files.insert({ name, std::move(data) }); - - if (res.second) - { - return { &res.first->first, reinterpret_cast(res.first->second.data()), res.first->second.size() }; - } - - throw error("couldn't open gsc file '" + name + "'"); -} - -std::set paths -{ - "aitype"sv, - "aitype/clientscripts"sv, - "animscripts"sv, - "animscripts/ai_subclass"sv, - "animscripts/aitype"sv, - "animscripts/bigdog"sv, - "animscripts/traverse"sv, - "animscripts/turret"sv, - "character"sv, - "character/clientscripts"sv, - "clientscripts"sv, - "clientscripts/mp"sv, - "clientscripts/mp/createfx"sv, - "clientscripts/mp/gametypes"sv, - "clientscripts/mp/zombies"sv, - "codescripts"sv, - "common_scripts"sv, - "maps"sv, - "maps/ai_subclass"sv, - "maps/createart"sv, - "maps/createfx"sv, - "maps/gametypes"sv, - "maps/mp"sv, - "maps/mp/animscripts"sv, - "maps/mp/animscripts/traverse"sv, - "maps/mp/bots"sv, - "maps/mp/createart"sv, - "maps/mp/createfx"sv, - "maps/mp/gametypes"sv, - "maps/mp/gametypes_zm"sv, - "maps/mp/killstreaks"sv, - "maps/mp/teams"sv, - "maps/mp/zombies"sv, - "maps/voice"sv, - "mpbody"sv, - "xmodelalias"sv, -}; - -auto resolver::fs_to_game_path(const std::filesystem::path& file) -> std::filesystem::path -{ - auto result = std::filesystem::path("", std::filesystem::path::format::generic_format); - auto root = false; - - for (auto& entry : file) - { - if (!root && paths.contains(entry.string())) - { - result = entry; - root = true; - } - else if (paths.contains(result.string())) - { - result += "/"s + entry.string(); - } - } - - return result.empty() ? file : result; -} - -const std::array, 125> opcode_list -{{ - { 0x00, "OP_End" }, - { 0x01, "OP_Return" }, - { 0x02, "OP_GetUndefined" }, - { 0x03, "OP_GetZero" }, - { 0x04, "OP_GetByte" }, - { 0x05, "OP_GetNegByte" }, - { 0x06, "OP_GetUnsignedShort" }, - { 0x07, "OP_GetNegUnsignedShort" }, - { 0x08, "OP_GetInteger" }, - { 0x09, "OP_GetFloat" }, - { 0x0A, "OP_GetString" }, - { 0x0B, "OP_GetIString" }, - { 0x0C, "OP_GetVector" }, - { 0x0D, "OP_GetLevelObject" }, - { 0x0E, "OP_GetAnimObject" }, - { 0x0F, "OP_GetSelf" }, - { 0x10, "OP_GetLevel" }, - { 0x11, "OP_GetGame" }, - { 0x12, "OP_GetAnim" }, - { 0x13, "OP_GetAnimation" }, - { 0x14, "OP_GetGameRef" }, - { 0x15, "OP_GetFunction" }, - { 0x16, "OP_CreateLocalVariable" }, - { 0x17, "OP_SafeCreateLocalVariables" }, - { 0x18, "OP_RemoveLocalVariables" }, - { 0x19, "OP_EvalLocalVariableCached" }, - { 0x1A, "OP_EvalArray" }, - { 0x1B, "OP_EvalLocalArrayRefCached" }, - { 0x1C, "OP_EvalArrayRef" }, - { 0x1D, "OP_ClearArray" }, - { 0x1E, "OP_EmptyArray" }, - { 0x1F, "OP_GetSelfObject" }, - { 0x20, "OP_EvalFieldVariable" }, - { 0x21, "OP_EvalFieldVariableRef" }, - { 0x22, "OP_ClearFieldVariable" }, - { 0x23, "OP_SafeSetVariableFieldCached" }, - { 0x24, "OP_SafeSetWaittillVariableFieldCached" }, - { 0x25, "OP_ClearParams" }, - { 0x26, "OP_CheckClearParams" }, - { 0x27, "OP_EvalLocalVariableRefCached" }, - { 0x28, "OP_SetVariableField" }, - { 0x29, "OP_CallBuiltin" }, - { 0x2A, "OP_CallBuiltinMethod" }, - { 0x2B, "OP_Wait" }, - { 0x2C, "OP_WaitTillFrameEnd" }, - { 0x2D, "OP_PreScriptCall" }, - { 0x2E, "OP_ScriptFunctionCall" }, - { 0x2F, "OP_ScriptFunctionCallPointer" }, - { 0x30, "OP_ScriptMethodCall" }, - { 0x31, "OP_ScriptMethodCallPointer" }, - { 0x32, "OP_ScriptThreadCall" }, - { 0x33, "OP_ScriptThreadCallPointer" }, - { 0x34, "OP_ScriptMethodThreadCall" }, - { 0x35, "OP_ScriptMethodThreadCallPointer" }, - { 0x36, "OP_DecTop" }, - { 0x37, "OP_CastFieldObject" }, - { 0x38, "OP_CastBool" }, - { 0x39, "OP_BoolNot" }, - { 0x3A, "OP_BoolComplement" }, - { 0x3B, "OP_JumpOnFalse" }, - { 0x3C, "OP_JumpOnTrue" }, - { 0x3D, "OP_JumpOnFalseExpr" }, - { 0x3E, "OP_JumpOnTrueExpr" }, - { 0x3F, "OP_Jump" }, - { 0x40, "OP_JumpBack" }, - { 0x41, "OP_Inc" }, - { 0x42, "OP_Dec" }, - { 0x43, "OP_Bit_Or" }, - { 0x44, "OP_Bit_Xor" }, - { 0x45, "OP_Bit_And" }, - { 0x46, "OP_Equal" }, - { 0x47, "OP_NotEqual" }, - { 0x48, "OP_LessThan" }, - { 0x49, "OP_GreaterThan" }, - { 0x4A, "OP_LessThanOrEqualTo" }, - { 0x4B, "OP_GreaterThanOrEqualTo" }, - { 0x4C, "OP_ShiftLeft" }, - { 0x4D, "OP_ShiftRight" }, - { 0x4E, "OP_Plus" }, - { 0x4F, "OP_Minus" }, - { 0x50, "OP_Multiply" }, - { 0x51, "OP_Divide" }, - { 0x52, "OP_Modulus" }, - { 0x53, "OP_SizeOf" }, - { 0x54, "OP_WaitTillMatch" }, - { 0x55, "OP_WaitTill" }, - { 0x56, "OP_Notify" }, - { 0x57, "OP_EndOn" }, - { 0x58, "OP_VoidCodePos" }, - { 0x59, "OP_Switch" }, - { 0x5A, "OP_EndSwitch" }, - { 0x5B, "OP_Vector" }, - { 0x5C, "OP_GetHash" }, - { 0x5D, "OP_RealWait" }, - { 0x5E, "OP_VectorConstant" }, - { 0x5F, "OP_IsDefined" }, - { 0x60, "OP_VectorScale" }, - { 0x61, "OP_AnglesToUp" }, - { 0x62, "OP_AnglesToRight" }, - { 0x63, "OP_AnglesToForward" }, - { 0x64, "OP_AngleClamp180" }, - { 0x65, "OP_VectorToAngles" }, - { 0x66, "OP_Abs" }, - { 0x67, "OP_GetTime" }, - { 0x68, "OP_GetDvar" }, - { 0x69, "OP_GetDvarInt" }, - { 0x6A, "OP_GetDvarFloat" }, - { 0x6B, "OP_GetDvarVector" }, - { 0x6C, "OP_GetDvarColorRed" }, - { 0x6D, "OP_GetDvarColorGreen" }, - { 0x6E, "OP_GetDvarColorBlue" }, - { 0x6F, "OP_GetDvarColorAlpha" }, - { 0x70, "OP_FirstArrayKey" }, - { 0x71, "OP_NextArrayKey" }, - { 0x72, "OP_ProfileStart" }, - { 0x73, "OP_ProfileStop" }, - { 0x74, "OP_SafeDecTop" }, - { 0x75, "OP_Nop" }, - { 0x76, "OP_Abort" }, - { 0x77, "OP_Object" }, - { 0x78, "OP_ThreadObject" }, - { 0x79, "OP_EvalLocalVariable" }, - { 0x7A, "OP_EvalLocalVariableRef" }, - { 0x7B, "OP_DevblockBegin" }, - { 0x7C, "OP_DevblockEnd" }, -}}; - -const std::array, 3326> dvar_list -{{ - { 0x146F2C73, "ClickToContinue" }, - { 0x209FFF3B, "FriendXuidToJoinOnBoot" }, - { 0x586EB87C, "TestIntervalJitter" }, - { 0xFAD9A35D, "WADTimestampUpdateInterval" }, - { 0x58C836DC, "YouTube_ErrorRecordEvent" }, - { 0x66E9F57E, "YouTube_apiUrl" }, - { 0x3798B20F, "YouTube_category" }, - { 0x096AD5EC, "YouTube_highRefreshRate" }, - { 0x8349682B, "YouTube_listing" }, - { 0xCC83BACC, "YouTube_liveLifeCycleRefreshRate" }, - { 0xC353EAA0, "YouTube_liveStreamLeague" }, - { 0xBF5D22FE, "YouTube_lowRefreshRate" }, - { 0x2496CD92, "YouTube_maxViewersForHighRefresh" }, - { 0xEB88D950, "YouTube_minViewersForHighRefresh" }, - { 0x1F01CF57, "YouTube_minViewersToStartStream" }, - { 0xD82B2509, "YouTube_minViewersToStream" }, - { 0xFD8399D8, "YouTube_miscRefreshRate" }, - { 0x53165CA0, "YouTube_slateImageUrl" }, - { 0x05935EAF, "YouTube_slateText" }, - { 0xB0BC3DB8, "YouTube_stateChange" }, - { 0xF0A26483, "YouTube_stopStreamForPublicGame" }, - { 0x7D078A30, "YouTube_timeToRecoverFromLowStreamViewers" }, - { 0xF0464319, "YouTube_verifyUrl" }, - { 0x72C9C8B2, "actionSlotsHide" }, - { 0x02266E96, "activeFriendsMaxBackoffLevel" }, - { 0xF884F64B, "activeFriendsNumDayBuckets" }, - { 0x370CA343, "activeFriendsNumPlayBuckets" }, - { 0xCECE492A, "activeFriendsRefreshDelay" }, - { 0x78A5AE00, "activeFriendsSecondsPerBucket" }, - { 0x1412EE9C, "adsZeroSpread" }, - { 0x94FB1C9F, "ai_ShowCanshootChecks" }, - { 0x3027A78D, "ai_angularYawAccelRate" }, - { 0x54D41565, "ai_angularYawDecelFactor" }, - { 0x3EA7D554, "ai_angularYawEnabled" }, - { 0x4EED8183, "ai_corpseCount" }, - { 0x1DF154F7, "ai_debugAnimDeltas" }, - { 0xFFC390BD, "ai_debugClaimedNodes" }, - { 0xEB5DBD81, "ai_debugCoverEntityNum" }, - { 0xC8569254, "ai_debugEntIndex" }, - { 0x255CD703, "ai_debugFindPath" }, - { 0xBB40F71E, "ai_debugFindPathDirect" }, - { 0xA663BECC, "ai_debugFindPathLock" }, - { 0x739F6163, "ai_debugFindPathWidth" }, - { 0x7E794ED3, "ai_debugMayMove" }, - { 0xE9FDD26E, "ai_debugMeleeAttackSpots" }, - { 0xE5058323, "ai_debugThreatSelection" }, - { 0xDD8D070B, "ai_disableSpawn" }, - { 0x4566DB30, "ai_eventDistBadPlace" }, - { 0x2539E74C, "ai_eventDistBullet" }, - { 0xD61A7FAD, "ai_eventDistBulletRunning" }, - { 0x2FC7A90A, "ai_eventDistDeath" }, - { 0x1C482E85, "ai_eventDistExplosion" }, - { 0x4612C9F8, "ai_eventDistFootstep" }, - { 0x46140CE6, "ai_eventDistFootstepLite" }, - { 0xBFBE25E8, "ai_eventDistGrenadePing" }, - { 0x4D8214CC, "ai_eventDistGunShot" }, - { 0xB7F1EA4C, "ai_eventDistNewEnemy" }, - { 0x474AA0EC, "ai_eventDistPain" }, - { 0x82395A7D, "ai_eventDistProjImpact" }, - { 0x66DD092D, "ai_eventDistProjPing" }, - { 0x30C4FDF3, "ai_eventDistReact" }, - { 0x081CB369, "ai_eventDistSilencedShot" }, - { 0x40FEB037, "ai_foliageSeeThroughDist" }, - { 0x8975D816, "ai_friendlySuppression" }, - { 0x826896EA, "ai_friendlySuppressionDist" }, - { 0xA5E2522C, "ai_maxAttackerCount" }, - { 0x423A0415, "ai_meleeDamage" }, - { 0x4BD4F0CF, "ai_meleeHeight" }, - { 0xBD2DA9C3, "ai_meleeRange" }, - { 0xBD8C5E76, "ai_meleeWidth" }, - { 0x76283E5B, "ai_moveOrientMode" }, - { 0x4EEA15EE, "ai_noDodge" }, - { 0xD861EEC8, "ai_pathChokePointCost" }, - { 0x50EF676D, "ai_pathMomentum" }, - { 0x38109CEE, "ai_pathNegotiationOverlapCost" }, - { 0x5432652D, "ai_pathRandomPercent" }, - { 0x0A0070DF, "ai_playerFarAccuracy" }, - { 0x89250B01, "ai_playerFarRange" }, - { 0x5C6B36AC, "ai_playerNearAccuracy" }, - { 0xE73FDBEE, "ai_playerNearRange" }, - { 0xCD2B294E, "ai_showBadPlaces" }, - { 0xE3D6FA12, "ai_showDodge" }, - { 0x5C855B14, "ai_showFailedPaths" }, - { 0xA0898D67, "ai_showNearestNode" }, - { 0xA4402525, "ai_showNodeDrawType" }, - { 0xE48BEEE8, "ai_showNodes" }, - { 0x1571C6BC, "ai_showNodesDist" }, - { 0xD637FF76, "ai_showPathFindNodes" }, - { 0xE4A8B70F, "ai_showPaths" }, - { 0xD22E4E66, "ai_showPotentialThreatDir" }, - { 0x9224E11B, "ai_showVisData" }, - { 0xEDCE9A6F, "ai_showVisDataDist" }, - { 0x88B7B7A7, "ai_showVolume" }, - { 0x11931F7B, "ai_slowdownMaxYawDiff" }, - { 0x221321FB, "ai_slowdownMinRate" }, - { 0x7AE456B9, "ai_slowdownMinYawDiff" }, - { 0x6BFBDEDB, "ai_slowdownRateBlendFactor" }, - { 0x666C859E, "ai_threatUpdateInterval" }, - { 0xF7D93FD4, "ai_trim_path_zigzags" }, - { 0xA432F3E3, "ai_turnRate" }, - { 0x73027829, "ai_useBetterLookahead" }, - { 0xB42168D2, "ai_useFacingTranslation" }, - { 0x24833BA3, "ai_useLeanRunAnimations" }, - { 0x81DDB107, "airburstAdjustDistance" }, - { 0x395EFFA8, "allClientDvarsEnabled" }, - { 0x2C56E9E2, "allEmblemsPurchased" }, - { 0x1989CDF8, "allEmblemsUnlocked" }, - { 0x78730CDF, "allItemsPurchased" }, - { 0xB6FF0555, "allItemsUnlocked" }, - { 0xB4A24A06, "all_players_are_connected" }, - { 0x6F80BC60, "allowAllNAT" }, - { 0x27B9838C, "allowHost_matchesHostedRatio" }, - { 0x2295C417, "allowHost_matchesHostedStreak" }, - { 0xB308B084, "allowHost_matchesPlayedRatio" }, - { 0x17CA900F, "allowHost_matchesPlayedStreak" }, - { 0xA0694A69, "ammoCounterHide" }, - { 0x8FE7B89C, "band_12players" }, - { 0x1972B5E2, "band_18players" }, - { 0x4D1A884B, "band_2players" }, - { 0x259E320D, "band_4players" }, - { 0xFE21DBCF, "band_6players" }, - { 0xD6A58591, "band_8players" }, - { 0x332C97B0, "band_dedicated" }, - { 0xDBF20043, "band_demosystem" }, - { 0x5CABA193, "bandwidth_retry_interval" }, - { 0x5FA8E90F, "barebones_class_mode" }, - { 0x892CBC63, "bcmp_ally_kill_probability" }, - { 0x53964768, "bcmp_breathing_delay" }, - { 0x4BFE2A7A, "bcmp_breathing_probability" }, - { 0xBD9F1B3D, "bcmp_enemy_contact_delay" }, - { 0x59E10794, "bcmp_enemy_contact_level_delay" }, - { 0x5FF173AF, "bcmp_incoming_grenade_probability" }, - { 0xC151033C, "bcmp_kill_inform_probability" }, - { 0xB7B1EDCF, "bcmp_killstreak_incoming_probability" }, - { 0x6E5D54C1, "bcmp_last_stand_delay" }, - { 0x7EDC44DC, "bcmp_pain_delay" }, - { 0xF328DB66, "bcmp_pain_small_probability" }, - { 0x57E10FF3, "bcmp_perk_call_probability" }, - { 0x1D6F5AA2, "bcmp_sniper_kill_probability" }, - { 0x1E154CA4, "bcmp_toss_grenade_probability" }, - { 0x471D69D4, "bcmp_toss_trophy_probability" }, - { 0x9315A47E, "bcmp_weapon_delay" }, - { 0xD8DD31D5, "bcmp_weapon_fire_probability" }, - { 0x50C7E57C, "bcmp_weapon_fire_threat_probability" }, - { 0x3BC46746, "bcmp_weapon_reload_probability" }, - { 0xF3F63045, "bg_ads" }, - { 0x7FC5A238, "bg_aimSpreadMoveSpeedThreshold" }, - { 0xF3F631F2, "bg_aqs" }, - { 0x675FE823, "bg_aqsStyle" }, - { 0xFD4EE5C1, "bg_blendTimeOverride" }, - { 0x15C2C686, "bg_bobMax" }, - { 0x7974AB07, "bg_chargeShotAutoDischargeDelay" }, - { 0xD8F3EEC3, "bg_chargeShotAutoFireDelay" }, - { 0x7E8E1783, "bg_chargeShotCenterSpeedReductionPerBullet" }, - { 0xF58CF0ED, "bg_chargeShotDamageIncreasePerBullet" }, - { 0xA05E31F7, "bg_chargeShotDischargeWhenQueueReachesMax" }, - { 0xA1B45A53, "bg_chargeShotFireWhenQueueReachesMax" }, - { 0x9DAF83A7, "bg_chargeShotMaxBulletQueueOnEMP" }, - { 0xF7A39B72, "bg_chargeShotMaxBulletsInQueue" }, - { 0x3F0A87B8, "bg_chargeShotMaxViewKick" }, - { 0xDC82772B, "bg_chargeShotMinCenterSpeed" }, - { 0x93CFDD45, "bg_chargeShotPenetrationMultiplier" }, - { 0xE624A709, "bg_chargeShotQueueTime" }, - { 0xE898933C, "bg_chargeShotUseOneAmmoForMultipleBullets" }, - { 0x7862794B, "bg_chargeShotViewKickIncreasePerBullet" }, - { 0x5B58D602, "bg_disableWeaponPlantingInWater" }, - { 0x5C55D810, "bg_dog_swim_enabled" }, - { 0xB88FB6ED, "bg_dog_swim_water_max" }, - { 0xB88FB7EB, "bg_dog_swim_water_min" }, - { 0x5C1C978A, "bg_fallDamageMaxHeight" }, - { 0xBC64DF08, "bg_fallDamageMinHeight" }, - { 0x7BDE587B, "bg_foliagesnd_fastinterval" }, - { 0x3E20C29F, "bg_foliagesnd_maxspeed" }, - { 0x8E9F125D, "bg_foliagesnd_minspeed" }, - { 0xEF8F5E50, "bg_foliagesnd_resetinterval" }, - { 0x0080EEB2, "bg_foliagesnd_slowinterval" }, - { 0x78F5DAC0, "bg_forceAnimOverrideTimerCheck" }, - { 0xA94483C2, "bg_forceDurationOverride" }, - { 0x452AD916, "bg_forceExplosiveBullets" }, - { 0x55F139D3, "bg_gravity" }, - { 0x7FC11116, "bg_gunXOffset" }, - { 0xAA00CA5D, "bg_ladder_yawcap" }, - { 0x98DE6157, "bg_legYawCrouchTolerance" }, - { 0xB8379857, "bg_legYawProneTolerance" }, - { 0x84A9ABB3, "bg_legYawTolerance" }, - { 0x116B50A5, "bg_lowGravity" }, - { 0x33CD2F17, "bg_maxGrenadeIndicatorSpeed" }, - { 0x6D8D6A6C, "bg_moonGravity" }, - { 0x3265DAA2, "bg_movingPlatformPitchScale" }, - { 0xE2D868DB, "bg_plantInWaterDepth" }, - { 0x9702B8B1, "bg_playerAnimStanceAllowMovementInteruptTime" }, - { 0xEC7975EA, "bg_proneSwingSpeed" }, - { 0xE99BF295, "bg_prone_yawcap" }, - { 0x6A39E0E9, "bg_serverDelayDamageKickForPing" }, - { 0x10ECE375, "bg_shieldHitEncodeHeightVM" }, - { 0xF63B4FDA, "bg_shieldHitEncodeHeightWorld" }, - { 0xE1837A7C, "bg_shieldHitEncodeWidthVM" }, - { 0x59E25D81, "bg_shieldHitEncodeWidthWorld" }, - { 0x612125C4, "bg_shock_animation" }, - { 0x5E17047A, "bg_shock_lookControl" }, - { 0xB72766B8, "bg_shock_lookControl_fadeTime" }, - { 0xD94C8E28, "bg_shock_lookControl_maxpitchspeed" }, - { 0x910B02E1, "bg_shock_lookControl_maxyawspeed" }, - { 0x7965C475, "bg_shock_lookControl_mousesensitivityscale" }, - { 0xD61FAB6F, "bg_shock_movement" }, - { 0x3C60E89D, "bg_shock_screenBlurBlendFadeTime" }, - { 0x0369B90D, "bg_shock_screenBlurBlendTime" }, - { 0x103D9ECF, "bg_shock_screenFlashShotFadeTime" }, - { 0x73C0C0B2, "bg_shock_screenFlashWhiteFadeTime" }, - { 0xBC181046, "bg_shock_screenType" }, - { 0x5374900D, "bg_shock_sound" }, - { 0x24987314, "bg_shock_soundDryLevel" }, - { 0x5DF36D24, "bg_shock_soundEnd" }, - { 0xAB2C30FC, "bg_shock_soundEndAbort" }, - { 0x84E12363, "bg_shock_soundFadeInTime" }, - { 0xFF3D1144, "bg_shock_soundFadeOutTime" }, - { 0x1C64EE67, "bg_shock_soundLoop" }, - { 0x0992290D, "bg_shock_soundLoopEndDelay" }, - { 0x0D392F06, "bg_shock_soundLoopFadeTime" }, - { 0x88782216, "bg_shock_soundLoopSilent" }, - { 0x678E4FF3, "bg_shock_soundModEndDelay" }, - { 0x120A2B2C, "bg_shock_soundRoomType" }, - { 0x90DEFF3D, "bg_shock_soundSnapshot" }, - { 0xB91C5ED5, "bg_shock_soundWetLevel" }, - { 0x1298F2A0, "bg_shock_viewKickFadeTime" }, - { 0x8CB9B6A4, "bg_shock_viewKickPeriod" }, - { 0x9113F969, "bg_shock_viewKickRadius" }, - { 0x3B36D2AD, "bg_shock_visionset_inTime" }, - { 0x44B4FF28, "bg_shock_visionset_name" }, - { 0x8048A9CE, "bg_shock_visionset_outTime" }, - { 0xA5536AEE, "bg_slopeFrames" }, - { 0xE8707266, "bg_swingSpeed" }, - { 0x72156156, "bg_teleportAlignTime" }, - { 0x6C5FF9FA, "bg_useClientDamageKick" }, - { 0x08C21A72, "bg_vehicle_gravity" }, - { 0x09E56F28, "bg_vehicle_ground_max_normal" }, - { 0x7336A666, "bg_vehicle_ground_min_normal" }, - { 0x4C14E7B6, "bg_vehicle_max_body_pitch" }, - { 0x024F66D7, "bg_vehicle_max_body_roll" }, - { 0x018B6C29, "bg_vehicle_max_pitch" }, - { 0xC1FDA8EA, "bg_vehicle_max_roll" }, - { 0xC005D550, "bg_vehicle_overclip" }, - { 0xA279FF78, "bg_vehicle_pitch_track" }, - { 0x54B94999, "bg_vehicle_roll_track" }, - { 0xE69201E8, "bg_vehicle_slide_min_normal" }, - { 0x640C513C, "bg_vehicle_sphere_bounds_offset_z" }, - { 0xD6FD39C3, "bg_vehicle_stepsize" }, - { 0xDAD788C6, "bg_vehicle_tangential_clip_max_scale" }, - { 0x0883FC47, "bg_vehicle_tangential_clip_vel_scale" }, - { 0x47BB8FA1, "bg_vehicle_trace_offset" }, - { 0x0F2EDBE8, "bg_viewBobAmplitudeDtp" }, - { 0x6110FF10, "bg_viewBobAmplitudeDucked" }, - { 0x12EF0F08, "bg_viewBobAmplitudeDuckedAds" }, - { 0x972D8D84, "bg_viewBobAmplitudeProne" }, - { 0xF511F0D9, "bg_viewBobAmplitudeRoll" }, - { 0xC79B899E, "bg_viewBobAmplitudeSprinting" }, - { 0x6FB9CF38, "bg_viewBobAmplitudeStanding" }, - { 0xF2BBCE30, "bg_viewBobAmplitudeStandingAds" }, - { 0x6944A16B, "bg_viewBobAmplitudeSwimming" }, - { 0xE60D3190, "bg_viewKickMax" }, - { 0xE60D328E, "bg_viewKickMin" }, - { 0x6DC08F0B, "bg_viewKickRandom" }, - { 0x9E8D2DD2, "bg_viewKickScale" }, - { 0x1899DD7B, "bg_vsmode_hud" }, - { 0x33E4EE41, "bg_weaponBobAmplitudeBaseLaser" }, - { 0xAF62EC17, "bg_weaponBobAmplitudeDtp" }, - { 0x8DA4D4DF, "bg_weaponBobAmplitudeDucked" }, - { 0x14A66573, "bg_weaponBobAmplitudeProne" }, - { 0xAD746CAC, "bg_weaponBobAmplitudeRiding" }, - { 0x9BC806E8, "bg_weaponBobAmplitudeRoll" }, - { 0x5CC215BF, "bg_weaponBobAmplitudeRollLaser" }, - { 0x848CC10D, "bg_weaponBobAmplitudeSprinting" }, - { 0x109A54C7, "bg_weaponBobAmplitudeStanding" }, - { 0x0A2526FA, "bg_weaponBobAmplitudeSwimming" }, - { 0x93F6FEC7, "bg_weaponBobFrequencySwimming" }, - { 0x44C11D47, "bg_weaponBobHeavyWeaponScalar" }, - { 0xB37A711E, "bg_weaponBobLag" }, - { 0xB37A7570, "bg_weaponBobMax" }, - { 0x5038F351, "bg_weaponOffscreenReloadScale" }, - { 0xBB02FAE4, "blackboxHighVolumeProbability" }, - { 0x7FB1F9A2, "blurpain" }, - { 0x1F9C84D1, "bot_AllowGrenades" }, - { 0xE9443BF3, "bot_AllowMovement" }, - { 0xD55E5EAA, "bot_CloseDistance" }, - { 0x91E6A838, "bot_CrouchDistance" }, - { 0xC0935AD0, "bot_Debug" }, - { 0xF20E8150, "bot_DebugPaths" }, - { 0x3DB0D1F8, "bot_DebugThreat" }, - { 0xDD1B2972, "bot_ForceStand" }, - { 0x86E07034, "bot_Fov" }, - { 0x02976E74, "bot_GoalRadius" }, - { 0x0D3EB879, "bot_IgnoreHumans" }, - { 0x87D87056, "bot_MaxAdsTime" }, - { 0xCAF86AA2, "bot_MaxCrouchTime" }, - { 0xBFC69DC4, "bot_MaxDeathTime" }, - { 0x9DB433A4, "bot_MaxFireTime" }, - { 0x987CC4B4, "bot_MaxGrenadeTime" }, - { 0x758E0CF6, "bot_MaxPitchTime" }, - { 0x0C0502D3, "bot_MaxReactionTime" }, - { 0xBC9C4EA3, "bot_MaxStrafeTime" }, - { 0x324C8425, "bot_MeleeDist" }, - { 0xF129A794, "bot_MinAdsTime" }, - { 0x1CF44120, "bot_MinCrouchTime" }, - { 0xC2429C82, "bot_MinDeathTime" }, - { 0x312C52A2, "bot_MinFireTime" }, - { 0x29F36AF2, "bot_MinGrenadeTime" }, - { 0x780A0BB4, "bot_MinPitchTime" }, - { 0xCC5070D1, "bot_MinReactionTime" }, - { 0x0E982521, "bot_MinStrafeTime" }, - { 0xA42722F9, "bot_PitchDown" }, - { 0x2A1B30B2, "bot_PitchSpeed" }, - { 0xD2F0756A, "bot_PitchSpeedAds" }, - { 0xD920B866, "bot_PitchUp" }, - { 0x98E33992, "bot_PressAttackBtn" }, - { 0x351B21A2, "bot_PressMeleeBtn" }, - { 0x9BF750D4, "bot_SprintDistance" }, - { 0x4E204610, "bot_StrafeChance" }, - { 0x04953EC5, "bot_TargetLeadBias" }, - { 0x4CAF78A2, "bot_UseFriendNames" }, - { 0xEBDB7AEB, "bot_YawSpeed" }, - { 0x6563C103, "bot_YawSpeedAds" }, - { 0xF627F35C, "bot_difficulty" }, - { 0x94FFF5AF, "bot_enemies" }, - { 0xEB92E914, "bot_friends" }, - { 0x2EE36340, "bullet_penetrationEnabled" }, - { 0x6EC6096B, "bullet_penetrationMinFxDist" }, - { 0xF4D2861A, "bullet_ricochetBaseChance" }, - { 0x1797571A, "bulletrange" }, - { 0x82990C67, "cameraShakeRemoteHelo_Angles" }, - { 0xE54A01AE, "cameraShakeRemoteHelo_Freqs" }, - { 0x43B27C6B, "cameraShakeRemoteHelo_SpeedRange" }, - { 0x5B333635, "cameraShakeRemoteMissile_Angles" }, - { 0x7F3F29BC, "cameraShakeRemoteMissile_Freqs" }, - { 0xCDC8DD39, "cameraShakeRemoteMissile_SpeedRange" }, - { 0x8C45D37F, "cg_BallisticArc_BeginWidth" }, - { 0x2F190277, "cg_BallisticArc_DrawDelay" }, - { 0x923CD0B1, "cg_BallisticArc_EndWidth" }, - { 0x77F3E14B, "cg_BallisticArc_ForceHitIndicator" }, - { 0x7E8374EF, "cg_BallisticArc_MaxBounces" }, - { 0xE7D4AC2D, "cg_BallisticArc_MinBounces" }, - { 0x9EC641A1, "cg_BallisticArc_Offset" }, - { 0x8E0E827F, "cg_EnableAdaptiveSkinLodScale" }, - { 0x5BA78D50, "cg_InfraredFadeoutTime" }, - { 0x173D0052, "cg_ScoresPing_BgColor" }, - { 0x90DE9BE9, "cg_ScoresPing_HighColor" }, - { 0xB677A9EF, "cg_ScoresPing_Interval" }, - { 0xCF10E05B, "cg_ScoresPing_LowColor" }, - { 0x8D3A51BF, "cg_ScoresPing_MedColor" }, - { 0x5D8D22A2, "cg_VelocityArrow_MaxSegmentLength" }, - { 0x27465060, "cg_VelocityArrow_MinSegmentLength" }, - { 0x9094E76E, "cg_VelocityArrow_RateOfChange" }, - { 0xD1D2B02E, "cg_adsZScaleMax" }, - { 0x8D986C19, "cg_airburstCameraRestriction" }, - { 0x6F62E69C, "cg_airburstLaseFlashTime" }, - { 0x8516A00E, "cg_airburstLaseTime" }, - { 0xF1E59D95, "cg_airburstStrafeRestriction" }, - { 0x695315B6, "cg_allPlayerNamesVisible" }, - { 0x77731F9A, "cg_allow_mature" }, - { 0xB55AD017, "cg_altDofTrace" }, - { 0x506A31EC, "cg_alt_mode_killstreak_fix_tu6" }, - { 0x3AA00C48, "cg_artilleryKillCamBackDist" }, - { 0x2D5743CE, "cg_artilleryKillCamFov" }, - { 0x6C33C217, "cg_artilleryKillCamGroundBackDist" }, - { 0xB46AB82B, "cg_artilleryKillCamGroundUpDist" }, - { 0x0A2CC21C, "cg_artilleryKillCamUpDist" }, - { 0x1D6257BF, "cg_artilleryKillCamWallOutDist" }, - { 0xB9B6706C, "cg_artilleryKillCamWallSideDist" }, - { 0x18F1B650, "cg_cameraSpikeEnemyColor" }, - { 0xC1BA9B84, "cg_cameraSpikeHighlightBrightness" }, - { 0xFC2F4423, "cg_cameraVehicleExitTweenTime" }, - { 0x2D612F42, "cg_cameraWaterClip" }, - { 0xC9418B10, "cg_canSeeFriendlyFrustumExpand" }, - { 0x90DB18BF, "cg_canSeeFriendlyFrustumMinDistance" }, - { 0xDE436578, "cg_canSeeFriendlyFrustumUpdateInterval" }, - { 0x2CD2E67E, "cg_centertime" }, - { 0x90FE9427, "cg_chatHeight" }, - { 0xA4FF89CE, "cg_cinematicFullscreen" }, - { 0x1AADEF4F, "cg_colorHue" }, - { 0x3E193017, "cg_colorSaturation" }, - { 0x7EA42B15, "cg_colorScale" }, - { 0x70722B23, "cg_colorTemp" }, - { 0xFCA4C2E1, "cg_constantSizeHeadIcons" }, - { 0xD10FAC11, "cg_corpseHighlightFadeTime" }, - { 0x729B5E82, "cg_crosshairAlpha" }, - { 0x648FC4E6, "cg_crosshairAlphaMin" }, - { 0x8C0706C1, "cg_crosshairDynamic" }, - { 0x5210F199, "cg_crosshairEnemyColor" }, - { 0x9557A5ED, "cg_cullBulletAngle" }, - { 0xDC52C459, "cg_cullBullets" }, - { 0xEE75F792, "cg_cursorHints" }, - { 0xED717C95, "cg_debug_overlay_viewport" }, - { 0x3EBC63CA, "cg_debugevents" }, - { 0x0BAE9D2A, "cg_debugposition" }, - { 0xD2836A90, "cg_destructibleKillCamCloseXYDist" }, - { 0x44895A39, "cg_destructibleKillCamCloseZDist" }, - { 0xE14FD483, "cg_destructibleKillCamFarBlur" }, - { 0xF69501D7, "cg_destructibleKillCamFarBlurDist" }, - { 0xCA4A6811, "cg_destructibleKillCamFarBlurStart" }, - { 0xD2BF3740, "cg_destructibleKillCamFov" }, - { 0x7AB63310, "cg_destructibleKillCamNearBlur" }, - { 0x22F7D547, "cg_destructibleKillCamNearBlurEnd" }, - { 0xC142E6BE, "cg_destructibleKillCamNearBlurStart" }, - { 0x91CDB080, "cg_destructibleKillCamRegularHeight" }, - { 0xBF2E45D9, "cg_destructibleKillCamZIncrease" }, - { 0x2C2658D1, "cg_development" }, - { 0xD8E34B43, "cg_disableplayernames" }, - { 0xE12B7443, "cg_dogKillCamDistFromEyes" }, - { 0x3E36FC4E, "cg_dogKillCamForwardDist" }, - { 0x92B1C8B0, "cg_dogKillCamFov" }, - { 0x1A748CFE, "cg_dogKillCamSideDist" }, - { 0xF224B3BE, "cg_dogKillCamUpDist" }, - { 0xBC9F1287, "cg_dogKillMinDistFromTarget" }, - { 0x8F1F6A52, "cg_draw2D" }, - { 0xFB1C97D7, "cg_drawBigFPS" }, - { 0xAC843485, "cg_drawBreathHint" }, - { 0x1202EB8A, "cg_drawCrosshair" }, - { 0x1973471E, "cg_drawCrosshairNames" }, - { 0xA21CF808, "cg_drawCrosshairNamesPosX" }, - { 0xA21CF809, "cg_drawCrosshairNamesPosY" }, - { 0x730D93C5, "cg_drawFPS" }, - { 0xA3CAAEA7, "cg_drawFPSOnly" }, - { 0xFB2AD76D, "cg_drawFriendlyNames" }, - { 0x730D98A6, "cg_drawGun" }, - { 0x08CFF952, "cg_drawHealth" }, - { 0x85EE4D2C, "cg_drawHoldBreathHint" }, - { 0x11E61C0B, "cg_drawMaterial" }, - { 0x6A81DB2F, "cg_drawMaterialImageName" }, - { 0xCCECAC1E, "cg_drawMaterialImageNum" }, - { 0x6A2EE182, "cg_drawModelAxis" }, - { 0xA139EA8C, "cg_drawShellshock" }, - { 0xD4C77968, "cg_drawTalk" }, - { 0x4D762D60, "cg_drawThroughWalls" }, - { 0x59B5BFE2, "cg_drawVersion" }, - { 0x086F513C, "cg_drawlagometer" }, - { 0x1B3BEFBE, "cg_drawpaused" }, - { 0x6977E268, "cg_droneKillCamBackDist" }, - { 0x5ED8903C, "cg_droneKillCamUpDist" }, - { 0xBC9224FC, "cg_dumpAnims" }, - { 0xF4B3B1A8, "cg_enableHelicopterNoCullLodOut" }, - { 0xEBC49634, "cg_enemyNameFadeIn" }, - { 0x64577795, "cg_enemyNameFadeOut" }, - { 0x9A04D72F, "cg_explosiveKillCamBackDist" }, - { 0xB054DE3E, "cg_explosiveKillCamGroundBackDist" }, - { 0x7D789E92, "cg_explosiveKillCamGroundUpDist" }, - { 0x0F650A41, "cg_explosiveKillCamStopDecelDist" }, - { 0x1D4EDE84, "cg_explosiveKillCamStopDist" }, - { 0x8843A743, "cg_explosiveKillCamUpDist" }, - { 0x61898D46, "cg_explosiveKillCamWallOutDist" }, - { 0x82C456D3, "cg_explosiveKillCamWallSideDist" }, - { 0xD5BFE442, "cg_fakefireWizbyChance" }, - { 0x8F29FD50, "cg_firstPersonTracerChance" }, - { 0xB7537F55, "cg_fixupSmodelCullDists" }, - { 0x3EE1EDD2, "cg_flareVisionSetFadeDuration" }, - { 0xCBB3A5C6, "cg_footprints" }, - { 0xCBEAD68D, "cg_footprintsDebug" }, - { 0xCF3F0AB2, "cg_footprintsDistortWater" }, - { 0xC0921875, "cg_footsteps" }, - { 0xD7810AE8, "cg_forceInfrared" }, - { 0xF64B6F99, "cg_fov" }, - { 0x06CBA50E, "cg_fovExtraCam" }, - { 0x939ED29D, "cg_fovMin" }, - { 0xF7070DA1, "cg_fovScale" }, - { 0x55DDAF3D, "cg_fov_default" }, - { 0x41DEFE0E, "cg_fov_default_thirdperson" }, - { 0x1CCE9773, "cg_friendlyNameFadeIn" }, - { 0xB6A1A0B4, "cg_friendlyNameFadeOut" }, - { 0xD1AAECA1, "cg_fuelHudVersion" }, - { 0x46B140B3, "cg_gun_move_f" }, - { 0x6E387342, "cg_gun_move_minspeed" }, - { 0x46B140BF, "cg_gun_move_r" }, - { 0xB893A859, "cg_gun_move_rate" }, - { 0x46B140C2, "cg_gun_move_u" }, - { 0x40531EC4, "cg_gun_ofs_f" }, - { 0x40531ED0, "cg_gun_ofs_r" }, - { 0x40531ED3, "cg_gun_ofs_u" }, - { 0x36DABCC0, "cg_gun_rot_minspeed" }, - { 0x408E5BFB, "cg_gun_rot_p" }, - { 0x408E5BFD, "cg_gun_rot_r" }, - { 0x5040E2D7, "cg_gun_rot_rate" }, - { 0x408E5C04, "cg_gun_rot_y" }, - { 0xB6FB074F, "cg_gun_x" }, - { 0xB6FB0750, "cg_gun_y" }, - { 0xB6FB0751, "cg_gun_z" }, - { 0xBB9BC3F5, "cg_headIconMinScreenRadius" }, - { 0x611BB4FB, "cg_heliKillCamFarBlur" }, - { 0x41CC5E4F, "cg_heliKillCamFarBlurDist" }, - { 0x7C6D5389, "cg_heliKillCamFarBlurStart" }, - { 0x097D9BB8, "cg_heliKillCamFov" }, - { 0xF3FE2288, "cg_heliKillCamNearBlur" }, - { 0x6E2F31BF, "cg_heliKillCamNearBlurEnd" }, - { 0xB7C34136, "cg_heliKillCamNearBlurStart" }, - { 0x01D0AA87, "cg_hudGrenadeIconHeight" }, - { 0x1E9D4EEF, "cg_hudGrenadeIconMaxRangeFlash" }, - { 0xB35A3321, "cg_hudGrenadeIconMaxRangeFrag" }, - { 0x12356CF5, "cg_hudGrenadeIconOffset" }, - { 0xF19BC12E, "cg_hudGrenadeIconWidth" }, - { 0x50E3DE7F, "cg_hudGrenadePointerHeight" }, - { 0x601DF698, "cg_hudGrenadePointerPivot" }, - { 0x609C5626, "cg_hudGrenadePointerWidth" }, - { 0x4011BFCB, "cg_hudMapBorderWidth" }, - { 0x1A3135A3, "cg_hudMapFriendlyHeight" }, - { 0xB44958CA, "cg_hudMapFriendlyWidth" }, - { 0x85C11A33, "cg_hudMapPlayerHeight" }, - { 0x2426EB5A, "cg_hudMapPlayerWidth" }, - { 0xB6A5BA0B, "cg_hudMapRadarLineThickness" }, - { 0xA56A982E, "cg_infraredBlur" }, - { 0x0C78683D, "cg_infraredBlurTime" }, - { 0xCD23697E, "cg_infraredFriendlies" }, - { 0x6ABEE0DA, "cg_infraredUseDefaultMaterial" }, - { 0x9866E9F2, "cg_killcamdebug" }, - { 0x60FE90F5, "cg_laserSightMaxDistance" }, - { 0xF855AB32, "cg_lastSpectatorSelectedThirdPerson" }, - { 0xE5145D3B, "cg_maxPlayerHighlightTargetSize" }, - { 0x9D951536, "cg_microwaveTurretKillCamBackOffset" }, - { 0xD79E7969, "cg_microwaveTurretKillCamFov" }, - { 0x12F8AC21, "cg_microwaveTurretKillCamHeightIncrease" }, - { 0xC8A20BDE, "cg_minCullBulletDist" }, - { 0x8BFA674E, "cg_missile_FOV" }, - { 0xE0B09C34, "cg_opticAttachmentViewmodelSwitch" }, - { 0x683363A0, "cg_overheadIconSize" }, - { 0xFDF2B51D, "cg_overheadNamesFarDist" }, - { 0xBD5530D1, "cg_overheadNamesFarScale" }, - { 0x2D962929, "cg_overheadNamesGlow" }, - { 0x1936F16A, "cg_overheadNamesMaxDist" }, - { 0x2B93AF0A, "cg_overheadNamesNearDist" }, - { 0x2D9CB24B, "cg_overheadNamesSize" }, - { 0x710EA954, "cg_overheadNamesTagUpdateInterval" }, - { 0x1A03F3E3, "cg_overheadRankSize" }, - { 0xF15851A5, "cg_playerFrustumHalfHeight" }, - { 0x135CF852, "cg_playerHighlightBlinkTime" }, - { 0x1812238C, "cg_playerHighlightBrightness" }, - { 0x958AE7B0, "cg_playerHighlightEnemyColor" }, - { 0xA16FFF27, "cg_playerHighlightMinFade" }, - { 0xEBE0A895, "cg_playerHighlightTargetSize" }, - { 0x936B18F7, "cg_proneFeetCollisionHull" }, - { 0x98BCDEEE, "cg_rangeFinderActiveColor" }, - { 0xBB4BCAC8, "cg_rangeFinderActiveHeight" }, - { 0x9A235D4F, "cg_rangeFinderActiveWidth" }, - { 0xC6DAC0F7, "cg_rangeFinderDefaultColor" }, - { 0x615D4A4C, "cg_rangeFinderDiamondIndicator" }, - { 0x471858EA, "cg_rangeFinderDiamondSize" }, - { 0x38585241, "cg_rangeFinderMinEnemySpottingDist" }, - { 0xEEBB3EA2, "cg_rangeFinderPlayerTargetSize" }, - { 0x07D92EB6, "cg_retrieveHintTime" }, - { 0xD5B36D40, "cg_retrieveHintTimeStuck" }, - { 0x65234398, "cg_rocketKillCamBackDist" }, - { 0xD4D9E56C, "cg_rocketKillCamUpDist" }, - { 0x741276B7, "cg_scoreboardMyColor" }, - { 0xAFE38B44, "cg_scriptedKillCamCloseXYDist" }, - { 0x894E346D, "cg_scriptedKillCamCloseZDist" }, - { 0x9673BB37, "cg_scriptedKillCamFarBlur" }, - { 0xD3F5228B, "cg_scriptedKillCamFarBlurDist" }, - { 0x53AE9F45, "cg_scriptedKillCamFarBlurStart" }, - { 0x78B3E3F4, "cg_scriptedKillCamFov" }, - { 0xD456F044, "cg_scriptedKillCamNearBlur" }, - { 0x0057F5FB, "cg_scriptedKillCamNearBlurEnd" }, - { 0x772E0472, "cg_scriptedKillCamNearBlurStart" }, - { 0x3A613689, "cg_showZombieControls" }, - { 0x26F0CAEF, "cg_sonarAttachmentBlur" }, - { 0x4593B4A0, "cg_sonarAttachmentCounterColorMultiplier" }, - { 0x05C8EE71, "cg_sonarAttachmentCounterMaxSpeed" }, - { 0xB3631E04, "cg_sonarAttachmentDistanceFactor" }, - { 0x591C124C, "cg_sonarAttachmentEmpFade" }, - { 0x82D0128F, "cg_sonarAttachmentFadeFriendlies" }, - { 0x7448D1D9, "cg_sonarAttachmentHideFriendlies" }, - { 0xA57FE014, "cg_sonarAttachmentMaxDist" }, - { 0x568EEBB1, "cg_sonarAttachmentMaxSpeed" }, - { 0x7A7421A8, "cg_sonarAttachmentPulseInterval" }, - { 0x5E8CBC12, "cg_sonarAttachmentPulseTime" }, - { 0x46E0B17A, "cg_sonarAttachmentSpeedDelay" }, - { 0x9146A1F9, "cg_sonarAttachmentSpeedTimeRatio" }, - { 0x11FB2E52, "cg_sonarAttachmentZmTurnedFadeTime" }, - { 0x899A0E04, "cg_sonarAttachmentZmTurnedGraceTime" }, - { 0x9B5CC287, "cg_sonarAttachmentZmTurnedMinFade" }, - { 0x87092272, "cg_streamLowDetailCamos" }, - { 0xF32641EB, "cg_subtitleWidthStandard" }, - { 0x97AAD223, "cg_subtitleWidthWidescreen" }, - { 0x3CD6A140, "cg_thirdPerson" }, - { 0xDD86C847, "cg_thirdPersonAngle" }, - { 0x6DAB1334, "cg_thirdPersonFocusDist" }, - { 0x1E02EC05, "cg_thirdPersonMode" }, - { 0xDEB3650D, "cg_thirdPersonRange" }, - { 0xA67367E6, "cg_timedDamageDuration" }, - { 0x543B603C, "cg_treadmarks" }, - { 0x0A283289, "cg_turretBipodOffset" }, - { 0xE9B7D6C9, "cg_turretKillCamBackOffset" }, - { 0xD3EDB9AC, "cg_turretKillCamCloseXYDist" }, - { 0x541835D5, "cg_turretKillCamCloseZDist" }, - { 0x8016F59F, "cg_turretKillCamFarBlur" }, - { 0xF7FF50F3, "cg_turretKillCamFarBlurDist" }, - { 0xF8FE9AAD, "cg_turretKillCamFarBlurStart" }, - { 0x0D4A2A5C, "cg_turretKillCamFov" }, - { 0x4EF7FF34, "cg_turretKillCamHeightIncrease" }, - { 0xF26177AC, "cg_turretKillCamNearBlur" }, - { 0x24622463, "cg_turretKillCamNearBlurEnd" }, - { 0xC67D6CDA, "cg_turretKillCamNearBlurStart" }, - { 0xF0B36A5D, "cg_turretKillCamSideOffset" }, - { 0xA556CEB1, "cg_ufo_scaler" }, - { 0x40F45CDC, "cg_usNewEventQueueScheme" }, - { 0x995C3D1B, "cg_useColorControl" }, - { 0x0E69B471, "cg_useFovSensitivity" }, - { 0x4DB643C0, "cg_useSafeSpectatorCam" }, - { 0x3449CD2F, "cg_useWeaponBasedVariableZoom" }, - { 0x3B3D07F4, "cg_useWeaponSwitchReloadCancel" }, - { 0x18959080, "cg_use_colored_smoke" }, - { 0x8831409B, "cg_usingClientScripts" }, - { 0x53E4E931, "cg_viewVehicleInfluenceGunner" }, - { 0x21AFD770, "cg_viewVehicleInfluenceGunnerFiring" }, - { 0xEF5A4521, "cg_viewZSmoothingMax" }, - { 0xEF5A461F, "cg_viewZSmoothingMin" }, - { 0xDAA6E0EA, "cg_viewZSmoothingTime" }, - { 0x8F2F3E39, "cg_visionSetLerpMaxDecreasePerFrame" }, - { 0x89BBD767, "cg_visionSetLerpMaxIncreasePerFrame" }, - { 0xD6209E28, "cg_watersheeting" }, - { 0x616A07DA, "cg_weaponHeat" }, - { 0x5B826836, "cg_weaponHintsCoD1Style" }, - { 0x0FEBC1DA, "cg_weaponSimulateFireAnims" }, - { 0xA3DC03E9, "challengeResponseResendBackoffInterval" }, - { 0x8948C3DD, "challengeResponseResendInterval" }, - { 0x014A13E8, "checkEmblemForRank" }, - { 0xE9F47676, "cl_bspmismatchFatal" }, - { 0x3A3D3B24, "cl_connectTimeout" }, - { 0xDD633055, "cl_connectionAttempts" }, - { 0xBEDF0D7E, "cl_deathMessageWidth" }, - { 0xC98ABB2A, "cl_freelook" }, - { 0x37CCF024, "cl_ingame" }, - { 0xE1C32BA0, "cl_leanCountMin" }, - { 0x403FE6BF, "cl_maxppf" }, - { 0xE62451BA, "cl_migrationPingTime" }, - { 0xB18C511E, "cl_motdString" }, - { 0xFE6F5694, "cl_mouseAccel" }, - { 0xB46F331A, "cl_nodelta" }, - { 0x473DC6D5, "cl_paused" }, - { 0x1431E885, "cl_profileWriteLimiter" }, - { 0x659FD911, "cl_splitscreenGamestateHack" }, - { 0x74F0955A, "cl_timeout" }, - { 0x38EA4789, "cl_voice" }, - { 0x60CBB715, "cl_yawspeed" }, - { 0x9C12E867, "clancard_clanid" }, - { 0x6A4569EA, "classVersionNumber" }, - { 0xC5740DFC, "client_notify" }, - { 0x8A04A058, "com_desiredMenu" }, - { 0x2995DDA4, "com_freemoveScale" }, - { 0x3F44BDAE, "com_introPlayed" }, - { 0x1851C25B, "com_maxclients" }, - { 0x75FE5192, "com_maxfps" }, - { 0xE7D5D4B2, "com_recommendedSet" }, - { 0x98B9403A, "com_report_syserrors" }, - { 0x2E5F6129, "com_statmon" }, - { 0x0A87E7DA, "com_timescale" }, - { 0xC630125F, "com_voip_resume_time" }, - { 0xD3653F1B, "compass" }, - { 0x04007424, "compassClampIcons" }, - { 0x688126B3, "compassEnableColorBlindPlayerIcons" }, - { 0x77595958, "compassEnemyFootstepEnabled" }, - { 0x12A06300, "compassEnemyFootstepMaxRange" }, - { 0x64D8C62D, "compassEnemyFootstepMaxZ" }, - { 0x6338DE62, "compassEnemyFootstepMinSpeed" }, - { 0x2A3EB400, "compassForcePlayerIcon" }, - { 0x123AC94C, "compassGridAlign" }, - { 0xA3774B12, "compassGridCols" }, - { 0xC412138C, "compassGridEnabled" }, - { 0xA37F862C, "compassGridRows" }, - { 0xF82D8378, "compassLocalRadarRadius" }, - { 0x0639D542, "compassLocalRadarUpdateTime" }, - { 0x345DDA4E, "compassMaxRange" }, - { 0x205BFAC7, "compassMinRadius" }, - { 0x84DC2A0C, "compassMinRange" }, - { 0x564817BD, "compassObjectiveDetailDist" }, - { 0xD8569B2F, "compassObjectiveHeight" }, - { 0x6FD98C95, "compassObjectiveMaxHeight" }, - { 0x5CA729DB, "compassObjectiveMinDistRange" }, - { 0xD021D413, "compassObjectiveMinHeight" }, - { 0x0304214B, "compassObjectiveNearbyDist" }, - { 0xD1523CD6, "compassObjectiveWidth" }, - { 0xBB1AB999, "compassRadarLineThickness" }, - { 0xC7497752, "compassRadarPingFadeTime" }, - { 0xB74756C5, "compassRadarUpdateFastTime" }, - { 0x363F5137, "compassRadarUpdateTime" }, - { 0xAA7968CF, "compassSatellitePingFadeTime" }, - { 0x9DC99DB6, "compassSatelliteScanTime" }, - { 0x31E32C4C, "compassSatelliteStaticImageFadeTime" }, - { 0x201CB782, "compassShowEnemies" }, - { 0x87DA1D91, "compassSoundPingFadeTime" }, - { 0x55464298, "compassStaticImageUpdateTime" }, - { 0xC265F283, "con_gameMsgWindow0FadeInTime" }, - { 0xED5BC464, "con_gameMsgWindow0FadeOutTime" }, - { 0xF52755D3, "con_gameMsgWindow0Filter" }, - { 0x9894D13E, "con_gameMsgWindow0LineCount" }, - { 0xCBE2E603, "con_gameMsgWindow0MsgTime" }, - { 0xD4237FEB, "con_gameMsgWindow0ScrollTime" }, - { 0xA2D37E61, "con_gameMsgWindow0SplitscreenScale" }, - { 0x47C2A7C4, "con_gameMsgWindow1FadeInTime" }, - { 0x1E4F21C5, "con_gameMsgWindow1FadeOutTime" }, - { 0x42219294, "con_gameMsgWindow1Filter" }, - { 0x9C9F625F, "con_gameMsgWindow1LineCount" }, - { 0xB824BAE4, "con_gameMsgWindow1MsgTime" }, - { 0x5980352C, "con_gameMsgWindow1ScrollTime" }, - { 0x35AD6062, "con_gameMsgWindow1SplitscreenScale" }, - { 0xCD1F5D05, "con_gameMsgWindow2FadeInTime" }, - { 0x4F427F26, "con_gameMsgWindow2FadeOutTime" }, - { 0x8F1BCF55, "con_gameMsgWindow2Filter" }, - { 0xA0A9F380, "con_gameMsgWindow2LineCount" }, - { 0xA4668FC5, "con_gameMsgWindow2MsgTime" }, - { 0xDEDCEA6D, "con_gameMsgWindow2ScrollTime" }, - { 0xC8874263, "con_gameMsgWindow2SplitscreenScale" }, - { 0x527C1246, "con_gameMsgWindow3FadeInTime" }, - { 0x8035DC87, "con_gameMsgWindow3FadeOutTime" }, - { 0xDC160C16, "con_gameMsgWindow3Filter" }, - { 0xA4B484A1, "con_gameMsgWindow3LineCount" }, - { 0x90A864A6, "con_gameMsgWindow3MsgTime" }, - { 0x64399FAE, "con_gameMsgWindow3ScrollTime" }, - { 0x5B612464, "con_gameMsgWindow3SplitscreenScale" }, - { 0x37DDF0DF, "con_hintBoxColor" }, - { 0x3340AC3C, "con_inputBoxColor" }, - { 0x56E6DB07, "con_inputCmdColor" }, - { 0x3D385B73, "con_inputColor" }, - { 0x31C64660, "con_inputDvarColor" }, - { 0xC08BCD89, "con_outputBarColor" }, - { 0x503D91B7, "con_outputSliderColor" }, - { 0xAD6F130C, "con_outputWindowColor" }, - { 0x195C44BD, "con_typewriterColorBase" }, - { 0xC9E14689, "con_versionColor" }, - { 0xC8253727, "content_trialcontentpackbits" }, - { 0x5AA5C862, "counterDownloadInterval" }, - { 0xD03DE84F, "counterUploadInterval" }, - { 0x134D5297, "createfx" }, - { 0x6AC13DAC, "createfx_autosave_time" }, - { 0x94DE57D9, "createfx_drawaxis" }, - { 0x74012625, "createfx_drawaxis_range" }, - { 0x94DFBE78, "createfx_drawdist" }, - { 0xC888BAB4, "createfx_map" }, - { 0xA6DCBA49, "createfx_oneshot_max_delay" }, - { 0x072501C7, "createfx_oneshot_min_delay" }, - { 0x5A7DE640, "createfx_print_frames" }, - { 0xD0C4376B, "createfx_scaleid" }, - { 0xF75FC86A, "creditsScrollScale" }, - { 0x7547FDB7, "currentTUVersion" }, - { 0x4083079F, "customGameMode" }, - { 0x78A08DA5, "custom_killstreak_1" }, - { 0xC6C534A3, "custom_killstreak_1_kills" }, - { 0x78A08DA6, "custom_killstreak_2" }, - { 0x13BF7164, "custom_killstreak_2_kills" }, - { 0x78A08DA7, "custom_killstreak_3" }, - { 0x60B9AE25, "custom_killstreak_3_kills" }, - { 0x2F851AB2, "custom_perks_allow_pro" }, - { 0xD7997EA3, "debugRenderCollisionDistance" }, - { 0x7706D878, "debugRenderMask" }, - { 0xC450CB50, "debug_color_pallete" }, - { 0x36FAE5DF, "debug_dynamic_ai_spawning" }, - { 0x99BAF398, "debug_engage_dists" }, - { 0xC394DFE1, "debug_killstreak" }, - { 0xBC8CA09D, "debug_protocol" }, - { 0x628768B6, "debug_reflection" }, - { 0x33E24970, "debug_reflection_matte" }, - { 0x1BE0BEF8, "debug_show_viewpos" }, - { 0xB695B6BC, "dedicated" }, - { 0x6BB51720, "dedicatedPingLog_DoTestChance" }, - { 0x18733050, "dedicatedPingLog_Interval" }, - { 0xDE7133E0, "dedicatedPingLog_MaxTestTime" }, - { 0x5109875B, "dedicatedPingLog_ServerLocation" }, - { 0x02C22CBE, "dedicatedPingLog_TimesToPing" }, - { 0xE08DB901, "dedicatedPingLog_WaitBeforePing" }, - { 0x3818BA6F, "defaultDamageDuration" }, - { 0xBF7C098E, "defaultDamageInterval" }, - { 0x1EC4674E, "defaultHitDamage" }, - { 0x22712C30, "demoRenderDuration" }, - { 0x8A05C09D, "demoRenderSizeX" }, - { 0x8A05C09E, "demoRenderSizeY" }, - { 0xC447A05D, "demo_bookmarkEventThresholdTime" }, - { 0x3954E759, "demo_bytesPerSecondMax" }, - { 0x3954E857, "demo_bytesPerSecondMin" }, - { 0x24FC2AA8, "demo_client" }, - { 0xA4C08C31, "demo_currentDemo" }, - { 0xD9EA7236, "demo_dollycamHighlightThreshholdDistance" }, - { 0x9F36FEB3, "demo_dollycamMarkerInformationFarDist" }, - { 0x8722AD27, "demo_dollycamMarkerInformationFarScale" }, - { 0xF5612B60, "demo_dollycamMarkerInformationNearDist" }, - { 0xE406EEC6, "demo_dollycamMarkerInformationThreshholdDistance" }, - { 0xA835DCDC, "demo_dollycamMarkerTimeScaleMode" }, - { 0xAF8CCC14, "demo_dollycamMarkerTimeScaleValue" }, - { 0x0A6AF093, "demo_dollycamTrackWidth" }, - { 0xB0706CF6, "demo_downloadStreamDataBlockRequestSize" }, - { 0x0ACFAC77, "demo_downloadStreamDataBlockThrottleTime" }, - { 0xC5FFA847, "demo_downloadStreamMaxRetryAttemps" }, - { 0x26DD2407, "demo_downloadStreamRetryWaitTime" }, - { 0xC5B0EC92, "demo_downloadStreamThrottleTime" }, - { 0x81790759, "demo_enableClipRecordEvent" }, - { 0x0D6912A5, "demo_enableDollyCam" }, - { 0x7218C783, "demo_enableSvBandwidthLimitThrottle" }, - { 0x628DD734, "demo_enabled" }, - { 0x41A474B8, "demo_errormessage" }, - { 0x63881475, "demo_errortitle" }, - { 0x938D4002, "demo_extraNetworkProfileData" }, - { 0x6A5638C8, "demo_fileLimit" }, - { 0xB7479483, "demo_filesizeLimit" }, - { 0x43D0DF12, "demo_freeCameraLockOnHighlightThreshholdDistance" }, - { 0xD85282C2, "demo_freeCameraLockOnOrbitRadius" }, - { 0xD6DD200D, "demo_freeCameraShowLockableObjectsAlways" }, - { 0x4D7B0788, "demo_highlightReelGameResultFilter" }, - { 0x7B760BB8, "demo_highlightReelMinimumStarsFilter" }, - { 0xD207F94D, "demo_highlightReelNumberOfSegments" }, - { 0xDCA2CBFC, "demo_highlightReelPlayerFilter" }, - { 0x5E08A8F3, "demo_highlightReelStylesFilter" }, - { 0x92C4695A, "demo_highlightReelTransitionFilter" }, - { 0x2E6C10B6, "demo_inGameThrottleBandwitdhPercent" }, - { 0x0BF93314, "demo_inLobbyThrottleBandwitdhPercent" }, - { 0x1B7DF9C9, "demo_keyframerate" }, - { 0xC7D17E59, "demo_matchRecordEventOnPlaylists" }, - { 0xFE6BB0E6, "demo_maxTimeScale" }, - { 0x7ADE0A5D, "demo_packetsPerSecondMax" }, - { 0x7ADE0B5B, "demo_packetsPerSecondMin" }, - { 0x9D2B1EE7, "demo_pause" }, - { 0xBF7049D3, "demo_pauseOnNextSnapshot" }, - { 0xAC28EE30, "demo_recordPrivateMatch" }, - { 0x7B442595, "demo_recordStaticEntityPositions" }, - { 0x0A5AEBB2, "demo_recordingrate" }, - { 0x5118F161, "demo_refreshDollyCamFxEveryFrame" }, - { 0xE8590727, "demo_save_smp" }, - { 0xD2AA909D, "demo_selectedSegmentIndex" }, - { 0x81FF4482, "demo_streamUploadKeepAliveFrequency" }, - { 0xDA350331, "demo_streamingAdjustmentFactor" }, - { 0xF1442485, "demo_streamingSendSocketBuffSizeForOtherUploads" }, - { 0x2D418E08, "demo_streamingSendSocketBuffSizeForRecording" }, - { 0x5F5FBA7A, "demo_svBandwidthLimitThrottleMaxBytesPercent" }, - { 0x6BB613C3, "demo_svBandwidthLimitThrottleTimeout" }, - { 0xEF5D6150, "demo_useCinematicsBuffer" }, - { 0x2A7D534B, "demoname" }, - { 0x1783D2AB, "developer" }, - { 0x9B1A5ADF, "developer_script" }, - { 0xB67B1D0D, "devgui_bot" }, - { 0x605D81B6, "devgui_bot_weapon" }, - { 0x0CA7B9CD, "devgui_dev_cac" }, - { 0xB67B2582, "devgui_dog" }, - { 0x9488D1C1, "devgui_notify" }, - { 0x85E86196, "devgui_tank" }, - { 0xE84C2013, "disableAllTheEliteThings" }, - { 0x95D03C81, "disableHost_matchesHostedRatio" }, - { 0x53839BAC, "disableHost_matchesHostedStreak" }, - { 0x211F6979, "disableHost_matchesPlayedRatio" }, - { 0x48B867A4, "disableHost_matchesPlayedStreak" }, - { 0x54BE814E, "disableLookAtEntityLogic" }, - { 0xFBF5426E, "disable_rope" }, - { 0xFFE0B464, "disable_vcs" }, - { 0x3413A22F, "disable_vcs_viewmodel" }, - { 0x320BAF1F, "disconnected_ctrls" }, - { 0x18CB2AC6, "dlc3_zm_ai_lookAheadAllowBackTrack" }, - { 0x29D5A864, "dlc3_zm_ai_lookAheadAllowRestore" }, - { 0x35A52FE5, "dog_MeleeDamage" }, - { 0x91E9B846, "dog_turn180_angle" }, - { 0x83BC2B16, "dog_turn90_angle" }, - { 0xC1F1399F, "dog_turn_min_goal_dist" }, - { 0x8A6CA03B, "door_breach_weapondrop" }, - { 0xD95E2BA0, "doublescreen" }, - { 0xE54E61D2, "doublesided_raycasts" }, - { 0x0B886BAD, "dtp" }, - { 0xC3C2374B, "dtp_exhaustion_window" }, - { 0xDC52E706, "dtp_fall_damage_max_height" }, - { 0x45A41E44, "dtp_fall_damage_min_height" }, - { 0xB49AFCE4, "dtp_max_apex_duration" }, - { 0xBACD664D, "dtp_max_slide_addition" }, - { 0xBC486287, "dtp_max_slide_duration" }, - { 0xEE594700, "dtp_min_speed" }, - { 0xE905783C, "dtp_new_trajectory" }, - { 0xA5B9CC42, "dtp_new_trajectory_multiplier" }, - { 0xCAAFEDA5, "dtp_post_move_pause" }, - { 0x482810ED, "dtp_startup_delay" }, - { 0x0BCF9209, "dwFileFetchTryIntervalBase" }, - { 0xD9921BF4, "dwFileFetchTryIntervalMax" }, - { 0x70F928A1, "dwFileFetchTryMaxAttempts" }, - { 0xB0C7FD5B, "dwStreamingSendSocketBuffSize" }, - { 0xD0446110, "dwVerboseQosLogging" }, - { 0xBFB4785B, "dw_active" }, - { 0xC4FF0914, "dw_connectafterlogin" }, - { 0xB1224DDF, "dw_defaultDTLSAssociationTimeout" }, - { 0xA3684515, "dw_dupe_key" }, - { 0x88DDE577, "dw_logging_frequency" }, - { 0x8F5FBE36, "dw_logging_last_match_logged" }, - { 0x2EE6E45E, "dw_logging_level_chance" }, - { 0x0D5C32CA, "dw_party_active" }, - { 0x738045D3, "dw_popup" }, - { 0xD6D286C8, "dynEntPieces_angularVelocity" }, - { 0x3A7BBA9C, "dynEntPieces_impactForce" }, - { 0x021F38BE, "dynEntPieces_velocity" }, - { 0x34A1EF0D, "dynEnt_bulletForce" }, - { 0x111B02A5, "dynEnt_damageRadiusScale" }, - { 0x63EF6776, "dynEnt_explodeForce" }, - { 0x18046EE7, "dynEnt_explodeMaxEnts" }, - { 0x6923363A, "dynEnt_explodeMinForce" }, - { 0x5047AC09, "dynEnt_explodeSpinScale" }, - { 0x04E3238B, "dynEnt_explodeUpbias" }, - { 0xA5386AED, "dynEnt_shouldCullEntitiesForSplitscreen" }, - { 0x09DFA667, "dynEnt_spawnedLimit" }, - { 0x57577B9F, "emblemImageUpload" }, - { 0x4624D9D6, "enableERegErrorRecording" }, - { 0xEF943586, "enableJapaneseElite" }, - { 0x849E4E4F, "enableUCDErrorRecording" }, - { 0x8006F08D, "enable_global_wind" }, - { 0x2872A47C, "enable_grass_wind" }, - { 0x00520CBA, "enable_moving_paths" }, - { 0x5FADFED5, "enable_new_prone_check" }, - { 0x129C6F77, "excellentPing" }, - { 0xA3556655, "exp_softclip" }, - { 0x33495B58, "fbEnabled" }, - { 0x6A6328D8, "fixNegativeLosses" }, - { 0x4AEA5EC4, "fixedtime" }, - { 0x095C56F9, "fixedtime_float" }, - { 0xD6D2E02E, "flame_config_valid" }, - { 0x5FC2CC8F, "flame_debug_render" }, - { 0x80A0B5D1, "flame_kick_offset" }, - { 0x289C8C90, "flame_kick_recover_speed" }, - { 0x70CED57B, "flame_kick_speed" }, - { 0x15D6DF09, "flame_render" }, - { 0x90430D58, "flame_system_enabled" }, - { 0xF643E92E, "flame_team_damage" }, - { 0x34725E89, "flame_test" }, - { 0x50EE3C95, "flame_use_dvars" }, - { 0x0E7511C3, "flareDisableEffects" }, - { 0x3BA5817A, "footstep_sounds_cutoff" }, - { 0xE18BB6E3, "friction" }, - { 0xC8EAB592, "fs_basegame" }, - { 0xC8EFA5E5, "fs_basepath" }, - { 0xFC601CD1, "fs_cdpath" }, - { 0x8E023A2B, "fs_copyfiles" }, - { 0x173C1F24, "fs_debug" }, - { 0xC2A65097, "fs_game" }, - { 0x7A2B01F3, "fs_homepath" }, - { 0x1DF81DF8, "fs_ignoreLocalized" }, - { 0xC2068F2D, "fs_restrict" }, - { 0xF0017528, "fs_usedevdir" }, - { 0x6DB4EBAE, "fs_userDocuments" }, - { 0x37132DB9, "fs_usermapdir" }, - { 0xFF0D665C, "fshCustomGameName" }, - { 0x2C509999, "fshElite" }, - { 0x5D5C384D, "fshEnableRender" }, - { 0x2394FF6D, "fshFileDebug" }, - { 0xFE64B1A0, "fshMtxName" }, - { 0x9A9A2054, "fshRecentsXUID" }, - { 0x6FBEB5F2, "fshRenderSuccessURL" }, - { 0x978D15D8, "fshRenderWriteTimeout" }, - { 0x70716EAB, "fshRetryDelay" }, - { 0xDB860EDE, "fshSearchTaskDelay" }, - { 0x5957B9EC, "fshSkipFileStats" }, - { 0xE87E59F4, "fshStaffXuid" }, - { 0xB42A1723, "fshSummaryDelay" }, - { 0xCCE68E67, "fshThrottleEnabled" }, - { 0x53D071D0, "fshThrottleKBytesPerSec" }, - { 0x005977E3, "fx" }, - { 0x9F005509, "fx_enable" }, - { 0x168C2040, "fxfrustumCutoff" }, - { 0x0928994F, "g_FactionName_" }, - { 0x80D3D909, "g_FactionName_Allies" }, - { 0x3399E604, "g_FactionName_Axis" }, - { 0x4114B8B8, "g_ScoresColor_" }, - { 0xD9BE2332, "g_ScoresColor_Allies" }, - { 0xB9E991ED, "g_ScoresColor_Axis" }, - { 0x16A945FD, "g_ScoresColor_EnemyTeam" }, - { 0xB9EC35BA, "g_ScoresColor_Free" }, - { 0xF6AB9AC5, "g_ScoresColor_MyTeam" }, - { 0x3642E36D, "g_ScoresColor_Spectator" }, - { 0x8C58EFD0, "g_TeamColor_" }, - { 0x82854C4A, "g_TeamColor_Allies" }, - { 0xEC239505, "g_TeamColor_Axis" }, - { 0xF498F815, "g_TeamColor_EnemyTeam" }, - { 0x55A326F6, "g_TeamColor_EnemyTeamAlt" }, - { 0xEC2638D2, "g_TeamColor_Free" }, - { 0x9F72C3DD, "g_TeamColor_MyTeam" }, - { 0x2D9ABDBE, "g_TeamColor_MyTeamAlt" }, - { 0x3F69858D, "g_TeamColor_MyTeamAlt_Party" }, - { 0x71992F60, "g_TeamColor_Party" }, - { 0x14329585, "g_TeamColor_Spectator" }, - { 0x204F6C54, "g_TeamIcon_Allies" }, - { 0x5BF22A8F, "g_TeamIcon_Axis" }, - { 0x5BF4CE5C, "g_TeamIcon_Free" }, - { 0x674E314F, "g_TeamIcon_Spectator" }, - { 0x430FA872, "g_TeamName_" }, - { 0x7BC0766C, "g_TeamName_Allies" }, - { 0x1AE9CEA7, "g_TeamName_Axis" }, - { 0x7972D3EA, "g_TeamName_Three" }, - { 0xE8684F57, "g_actorAndVehicleAntilag" }, - { 0x832D22BE, "g_actorAndVehicleAntilagDebug" }, - { 0x7C972B95, "g_ai" }, - { 0xFA2C162D, "g_aiEventDump" }, - { 0x67B97008, "g_allowVote" }, - { 0x942E58E9, "g_avoidEnabled" }, - { 0x06BF71E8, "g_banIPs" }, - { 0xB764C692, "g_broadcastLocalSound" }, - { 0x2C1277E8, "g_compassShowEnemies" }, - { 0xF44B1795, "g_connectpaths" }, - { 0x8D1F0A47, "g_customTeamName_Allies" }, - { 0x4C4BAFC2, "g_customTeamName_Axis" }, - { 0xD710D865, "g_customTeamName_Three" }, - { 0xDEAF3421, "g_customTeamNames" }, - { 0x7C23A76D, "g_debugBullets" }, - { 0xB1AE74B1, "g_debugDamage" }, - { 0x4F3AC40F, "g_debugLocDamage" }, - { 0x5F884C4C, "g_debugLocDamageEntity" }, - { 0xC54FB315, "g_debugLocHit" }, - { 0x7DAE9EA4, "g_debugLocHitTime" }, - { 0xC3BDC4F5, "g_disableDemonwareSubscriptionRefresh" }, - { 0xEE047C4E, "g_disableEliteButton" }, - { 0x08BAEC9C, "g_disableEliteEmblemUploads" }, - { 0x69ED03A1, "g_disableEliteRegistrationPopup" }, - { 0x0898E724, "g_disablePlatformAutofill" }, - { 0x613C0BD9, "g_dumpAnims" }, - { 0xB7B64D0B, "g_dumpAnimsCommands" }, - { 0xE45BFE9E, "g_entinfo" }, - { 0xACA1F7EC, "g_entinfo_AItext" }, - { 0xCA3A1F97, "g_entinfo_maxdist" }, - { 0x2D470745, "g_entinfo_scale" }, - { 0xCB1296BF, "g_entinfo_type" }, - { 0xE7906176, "g_erroronpathsnotconnected" }, - { 0x74682944, "g_fogColorReadOnly" }, - { 0xE1FDE974, "g_fogHalfDistReadOnly" }, - { 0xF7F46A27, "g_fogStartDistReadOnly" }, - { 0x7204F1FD, "g_friendlyNameDist" }, - { 0x8371FC22, "g_friendlyfireDist" }, - { 0x302C4A05, "g_gameEnded" }, - { 0x4F118387, "g_gametype" }, - { 0x240A82FB, "g_ignoreVisData" }, - { 0x9DBECF2F, "g_inactivity" }, - { 0x9725F732, "g_knockback" }, - { 0x78782059, "g_lagged_damage_threshold" }, - { 0x7AB99713, "g_loadScripts" }, - { 0x0F7CCE2D, "g_log" }, - { 0x00A33D8A, "g_logSync" }, - { 0x672A7AE7, "g_logTimeStampInSeconds" }, - { 0xE524BDE0, "g_mantleBlockTimeBuffer" }, - { 0x33FE555C, "g_maxDroppedWeapons" }, - { 0xC377046A, "g_maxERegPopupsShown" }, - { 0xB42D06A6, "g_maxElapsedTime_Before_ERegPopup" }, - { 0x23E0B0A4, "g_minElapsedTime_Before_ERegPopup" }, - { 0xFE302BA9, "g_minElapsedTime_Before_RefreshUCDAccountStatus" }, - { 0x222107B5, "g_minGrenadeDamageSpeed" }, - { 0xC0B1CE53, "g_minNumLogins_Before_ERegPopup" }, - { 0xFF17223F, "g_motd" }, - { 0x4AFC3D2C, "g_no_script_spam" }, - { 0xAC5FC51E, "g_password" }, - { 0x14960A70, "g_quadrotorFlyHeight" }, - { 0x18BB172D, "g_randomSeed" }, - { 0x908BDBA7, "g_redCrosshairs" }, - { 0xFEFF67DF, "g_removeRedundantLinks" }, - { 0x1D657D7E, "g_spawnai" }, - { 0xE2684A3C, "g_speed" }, - { 0x04242108, "g_synchronousClients" }, - { 0xA4C5A666, "g_turretBipodOffset" }, - { 0xC4485CC6, "g_turretServerPitchMax" }, - { 0xC4485DC4, "g_turretServerPitchMin" }, - { 0x11CFCD17, "g_useholdspawndelay" }, - { 0xBA822D92, "g_vehicleDebug" }, - { 0xC2C9D5E6, "g_vehicleDrawPath" }, - { 0x38D19597, "g_vehicleDrawSplines" }, - { 0x52A0EDCF, "g_vehiclePlaneCurveTime" }, - { 0xBA9F6EFD, "gamedate" }, - { 0xBAA4E9E0, "gamename" }, - { 0x5B9D43EF, "geographicalMatchmakingOverride" }, - { 0xF4EDB01C, "goodPing" }, - { 0x5B55E465, "gpad_button_deadzone" }, - { 0x11401BA0, "gpad_button_lstick_deflect_max" }, - { 0xA5C4E866, "gpad_button_rstick_deflect_max" }, - { 0x5BD5EC05, "gpad_buttonsConfig" }, - { 0x47F5D167, "gpad_debug" }, - { 0x7E8C108B, "gpad_enabled" }, - { 0xA2CE9BCC, "gpad_stick_deadzone_max" }, - { 0xA2CE9CCA, "gpad_stick_deadzone_min" }, - { 0x021230D3, "gpad_stick_pressed" }, - { 0x74453BE5, "gpad_stick_pressed_hysteresis" }, - { 0xBE4E7AC7, "gpad_sticksConfig" }, - { 0xE6A14BE7, "grenadeBounceRestitutionMax" }, - { 0xBDDF009D, "grenadeBumpFreq" }, - { 0xA8A9C644, "grenadeBumpMag" }, - { 0xA8A9C655, "grenadeBumpMax" }, - { 0xB6369186, "grenadeCurveMax" }, - { 0x27D8FD59, "grenadeFrictionHigh" }, - { 0x3F44B4AB, "grenadeFrictionLow" }, - { 0xEC2FEFCD, "grenadeFrictionMaxThresh" }, - { 0xBFD92C26, "grenadeRestThreshold" }, - { 0xAE9A851D, "grenadeRollingEnabled" }, - { 0xFC25B8A4, "grenadeWobbleFreq" }, - { 0x9CD05BAC, "grenadeWobbleFwdMag" }, - { 0xDB6F499D, "grenadeWobbleSideDamp" }, - { 0xFEE47DD0, "grenadeWobbleSideMag" }, - { 0x8B93B594, "grenade_indicators_enabled" }, - { 0x6CB34FEF, "groupDownloadInterval" }, - { 0x723A289C, "groupUploadInterval" }, - { 0xFEAB2827, "gts_validation_enabled" }, - { 0x3DE7CA11, "gump_name3" }, - { 0x62147B0A, "gumpgump_name3" }, - { 0x3EB30083, "gumpgumpgump_name3" }, - { 0xA9999A7C, "gumpgumpgumpgump_name3" }, - { 0xDEEB1657, "gunXPGroups" }, - { 0xC12DB9ED, "hatch_mantle_fwd" }, - { 0x3C282E51, "hatch_mantle_up" }, - { 0x0F943F25, "hiDef" }, - { 0xC6C655D4, "highlightedPlayerName" }, - { 0xD5C71324, "hudElemPausedBrightness" }, - { 0xBE391294, "ik_ai_hand_get_data" }, - { 0xE12DF95F, "ik_ai_hand_offset_vec" }, - { 0xDD5BF928, "ik_ai_hand_rotation_vec" }, - { 0x44C2A150, "ik_ai_hand_tuning" }, - { 0x53189835, "ik_ai_pool_size" }, - { 0xF8357753, "ik_ai_range_max" }, - { 0x742FB7BF, "ik_debug" }, - { 0x2AF71E41, "ik_dvar_ai_aim_tracking_rate" }, - { 0xA03BBD67, "ik_dvar_lookatentity_eyes_scale" }, - { 0x5A1B39FE, "ik_dvar_lookatentity_notorso" }, - { 0xF3254B88, "ik_dvar_lookatentity_tracking_rate" }, - { 0x770E773C, "ik_dvar_lookatpos_eyes_scale" }, - { 0x07DB3BF3, "ik_dvar_lookatpos_notorso" }, - { 0x969E313D, "ik_dvar_lookatpos_tracking_rate" }, - { 0xFD1DD89F, "ik_enable" }, - { 0xF5DE80C2, "ik_enable_ai_hand" }, - { 0x7D1A16FC, "ik_enable_ai_terrain" }, - { 0x81D93685, "ik_enable_player_hand" }, - { 0xA27F99DF, "ik_enable_player_terrain" }, - { 0xFA4F340F, "ik_foot_test" }, - { 0x8561AAF2, "ik_hand_test" }, - { 0x9BE9BA0E, "ik_left_hand_lerp_test" }, - { 0x0F741997, "ik_lookatentity_head_scale" }, - { 0x4097CFEC, "ik_lookatpos_head_scale" }, - { 0x477FE38A, "ik_paranoid_matrix_checks" }, - { 0x5235338A, "ik_pelvis_test" }, - { 0x0D42FCD3, "ik_pitch_limit_max" }, - { 0xB9766A7B, "ik_pitch_limit_thresh" }, - { 0xCB1BCDC1, "ik_right_hand_lerp_test" }, - { 0x6A36B5F4, "ik_roll_limit_max" }, - { 0x3B0D9BFC, "ik_roll_limit_thresh" }, - { 0x58D0DAEC, "ik_yaw_limit_max" }, - { 0xEFAD3DF4, "ik_yaw_limit_thresh" }, - { 0x5BC716E4, "in_mouse" }, - { 0x7A726C79, "inviteText" }, - { 0x1F48DCEB, "invite_waitPeriod" }, - { 0x7D3E7879, "jump_height" }, - { 0x55EDBF33, "jump_ladderPushVel" }, - { 0xF5012724, "jump_slowdownEnable" }, - { 0x7656DC68, "jump_spreadAdd" }, - { 0x67905337, "jump_stepSize" }, - { 0x99DBAF6D, "killOnlyTrailFX" }, - { 0x14D0C551, "laggedDamageTagThreshold" }, - { 0x82622996, "lagometer_pos" }, - { 0x0B5B56B2, "lanChallengeResponse" }, - { 0x5A6B41C9, "language" }, - { 0x9E9B0782, "laserAlpha" }, - { 0x9ECD4083, "laserDebug" }, - { 0x1B9A097A, "laserEndOffset" }, - { 0x17DAA304, "laserFadeADS" }, - { 0x5BDDC76D, "laserFlarePct" }, - { 0x1B5378ED, "laserFlarePct_alt" }, - { 0x9CBB1F40, "laserLightBeginOffset" }, - { 0x02D509BE, "laserLightBodyTweak" }, - { 0x5BAE8432, "laserLightEndOffset" }, - { 0x33A5C55C, "laserLightRadius" }, - { 0x71B6D65C, "laserLightRadius_alt" }, - { 0x8732908E, "laserLightRangePlayer" }, - { 0x0DB4EA5A, "laserLightWithoutNightvision" }, - { 0x98D60FA4, "laserRadius" }, - { 0x2F1304A4, "laserRadius_alt" }, - { 0x9FC89749, "laserRange" }, - { 0xF01487D6, "laserRangePlayer" }, - { 0xF59AD6C9, "laserRange_alt" }, - { 0x9D32BEB5, "lbTaskDelay" }, - { 0x7694AD24, "leagueLoserBonus" }, - { 0x2F7BA092, "leagueWinnerBonus" }, - { 0xFFA732BB, "league_defaultPlaylistID" }, - { 0x0B6B62B6, "league_forcePreSeason" }, - { 0xC59F2092, "league_friendsRefetchTime" }, - { 0x21A4F525, "league_historyInfoRefetchTime" }, - { 0x22A97BCB, "league_kickForBadHash" }, - { 0x497FE67C, "league_leaderboardRefetchTime" }, - { 0x2540D00D, "league_teamLeagueInfoRefetchTime" }, - { 0xB42CFE95, "level_notify" }, - { 0xFFCF5728, "liveVideoURLEnv" }, - { 0x318DDC02, "liveVideoURLExpiration" }, - { 0x31C1A9B0, "liveVideoURLParam" }, - { 0xF9C1B153, "liveVideoURLSalt" }, - { 0x713F1456, "liveVideoURLServer" }, - { 0x2CB67789, "liveVoteErrorBackoff" }, - { 0xC858C795, "liveVoteTaskDelay" }, - { 0x3BF95D4E, "live_dedicatedUnparkPingExcellent" }, - { 0x7D3751D0, "live_dedicatedUnparkPingMax" }, - { 0x377DA78C, "live_maxMatchMakingPing" }, - { 0xE8102CBC, "live_maxMostAwesomePing" }, - { 0x54393CCA, "live_minMatchMakingPing" }, - { 0xDA7AD083, "live_readPublisherStorageLocally" }, - { 0xB90DB765, "live_service" }, - { 0x2125DC05, "live_startmatchDeadline" }, - { 0x100B34F0, "live_statscaching" }, - { 0xDB14681B, "live_steamid" }, - { 0xF10FD431, "live_testValue" }, - { 0x49133E68, "live_useActiveFriends" }, - { 0x1B8D3234, "live_useTwitch" }, - { 0x8D33C114, "live_useTwitter" }, - { 0xFC46D5AE, "live_useYouTube" }, - { 0xBEC6A9EA, "livestreamcontrollerneeded" }, - { 0xD8184D7B, "loc_forceEnglish" }, - { 0x7B7CC786, "loc_language" }, - { 0xAC1DDE0B, "loc_warnings" }, - { 0x71B8087C, "loc_warningsAsErrors" }, - { 0xF5DF8EDE, "log_append" }, - { 0x87BF7427, "logfile" }, - { 0x77F155B8, "long_blocking_call" }, - { 0xF30152E7, "lowAmmoWarningColor1" }, - { 0xF30152E8, "lowAmmoWarningColor2" }, - { 0x08618D6E, "lowAmmoWarningNoAmmoColor1" }, - { 0x08618D6F, "lowAmmoWarningNoAmmoColor2" }, - { 0x7BEEB1DB, "lowAmmoWarningNoReloadColor1" }, - { 0x7BEEB1DC, "lowAmmoWarningNoReloadColor2" }, - { 0xD059CC1B, "ls_demoauthor" }, - { 0x0D9C670E, "ls_demoduration" }, - { 0xF05BB80A, "ls_demotitle" }, - { 0x7868B11F, "ls_gametype" }, - { 0x1EBC5F5A, "ls_maplocation" }, - { 0x9B70D482, "ls_mapname" }, - { 0xDDB6EC47, "ls_status" }, - { 0xC2BE7ACB, "lui_checksum_enabled" }, - { 0x80C0A572, "lui_devmode" }, - { 0xE8C278D6, "lui_disable_blur" }, - { 0x1EEB6793, "lui_error_report" }, - { 0x2A326AA1, "lui_error_report_delay" }, - { 0xE52098A5, "lui_timescale" }, - { 0x9A2EEA57, "m_filter" }, - { 0xEE795086, "m_forward" }, - { 0xB00BD629, "m_pitch" }, - { 0x0D1944B6, "m_side" }, - { 0x0FE996C2, "m_yaw" }, - { 0x39A6CD41, "magic_chest_movable" }, - { 0x5B1C0FAC, "mantle_adjustment_tu" }, - { 0xB2BB0509, "mantle_check_angle" }, - { 0x7EF6A72B, "mantle_check_glass_extra_range" }, - { 0x30D66AEA, "mantle_check_radius" }, - { 0xB3E7A1CF, "mantle_check_range" }, - { 0xD743260B, "mantle_check_range_mp" }, - { 0x2CB444EC, "mantle_debug" }, - { 0xC6340B6C, "mantle_enable" }, - { 0xB2BBCFE4, "mantle_view_yawcap" }, - { 0x9C7AC26B, "mantle_weapon_anim_height" }, - { 0x0EEDAB07, "mantle_weapon_height" }, - { 0x0D3BB8DB, "mapcrc" }, - { 0xB4B895C4, "mapname" }, - { 0xFC04EAAF, "matchmaking_debug" }, - { 0x38893B81, "maxLossesValue" }, - { 0xBF1BEDC3, "maxMetPlayerListCount" }, - { 0xB1D02FB5, "maxStatsBackupInterval" }, - { 0xD3DD6600, "maxreservedslots" }, - { 0xEA2590B3, "melee_debug" }, - { 0x99730541, "metPlayerListCleanupInterval" }, - { 0xB79D7BFC, "metPlayerListUpdateInterval" }, - { 0xC9051A1E, "metPlayerListUploadInterval" }, - { 0x238570FF, "mgTurret" }, - { 0x35375A55, "microwave_turret_placement_trace_maxs" }, - { 0x35377B13, "microwave_turret_placement_trace_mins" }, - { 0xBA715225, "microwave_turretplacement_traceOffset" }, - { 0x3DC4221E, "migration_blocksperframe" }, - { 0x0941B7DB, "migration_forceHost" }, - { 0xB50106CD, "migration_limit" }, - { 0xB40EFE3A, "migration_minclientcount" }, - { 0x1F27E31C, "migration_msgtimeout" }, - { 0x89610DDC, "migration_soak" }, - { 0x37E55BA7, "migration_timeBetween" }, - { 0xBF47B3A7, "minDelayForOtherPlayerStatsFetch" }, - { 0xF95FF250, "miniscoreboardhide" }, - { 0x82C26CF2, "missileDroneAccelClimb" }, - { 0x7A672661, "missileDroneAccelDescend" }, - { 0x2D55E2FC, "missileDroneClimbAngleDirect" }, - { 0xA6E860F4, "missileDroneClimbAngleTop" }, - { 0x1D7B92B0, "missileDroneClimbCeilingDirect" }, - { 0xD3A10D28, "missileDroneClimbCeilingTop" }, - { 0xC84228CE, "missileDroneClimbHeightDirect" }, - { 0xF38C2806, "missileDroneClimbHeightTop" }, - { 0xB9F37754, "missileDroneClimbMaxDist" }, - { 0xF4DAFB88, "missileDroneClimbToOwner" }, - { 0x1309AA14, "missileDroneDistSqTargetAvoidanceDisabled" }, - { 0xAC8BE0C8, "missileDroneDistanceAvoidance" }, - { 0xDFEF8263, "missileDroneDistanceAvoidanceSec" }, - { 0x1408E4CA, "missileDroneSpeedLimitClimb" }, - { 0x772AF439, "missileDroneSpeedLimitDescend" }, - { 0x607F07C8, "missileDroneSpeedMin" }, - { 0x7FD4A059, "missileDroneTurnDecel" }, - { 0x74789EEE, "missileDroneTurnMaxRate" }, - { 0x7478D97B, "missileDroneTurnMaxRoll" }, - { 0xF6B286C1, "missileDroneTurnMaxRollChange" }, - { 0x93055786, "missileDroneTurnRateAscent" }, - { 0x09FAECD2, "missileDroneTurnRateAvoidance" }, - { 0x99077A5B, "missileDroneTurnRateDecent" }, - { 0x1770DD53, "missileDroneTurnRateSmallAdjustments" }, - { 0x1E554299, "missileDroneflattenRollRatio" }, - { 0x370075AF, "missileHellfireMaxSlope" }, - { 0xE7E81A43, "missileHellfireUpAccel" }, - { 0x81ED14FB, "missileJavAccelClimb" }, - { 0xEEDBF4AA, "missileJavAccelDescend" }, - { 0x50AAADC5, "missileJavClimbAngleDirect" }, - { 0xA9F6F85D, "missileJavClimbAngleTop" }, - { 0x692E33B9, "missileJavClimbCeilingDirect" }, - { 0xD4B322D1, "missileJavClimbCeilingTop" }, - { 0x56304CB7, "missileJavClimbHeightDirect" }, - { 0x586DAC8F, "missileJavClimbHeightTop" }, - { 0x694FC9D1, "missileJavClimbToOwner" }, - { 0x151AFA73, "missileJavSpeedLimitClimb" }, - { 0x05191822, "missileJavSpeedLimitDescend" }, - { 0x9ED5EB42, "missileJavTurnDecel" }, - { 0xFE39992C, "missileJavTurnRateDirect" }, - { 0xD98C4524, "missileJavTurnRateTop" }, - { 0xA865C45A, "missileMolotovBlobNum" }, - { 0xB5216739, "missileMolotovBlobTime" }, - { 0xB983FBE9, "missilePlantableSize" }, - { 0xB471B19E, "missileTVGuidedBoost" }, - { 0x12BF9927, "missileTVGuidedBoostSpeedDown" }, - { 0x2129CB14, "missileTVGuidedBoostSpeedUp" }, - { 0x963739D4, "missileTVGuidedFlatteningRollAccel" }, - { 0xC3FE1B1A, "missileTVGuidedMPSpecific" }, - { 0xDEB6B29D, "missileTVGuidedMaxRollAngle" }, - { 0xD7477DDF, "missileTVGuidedStickDeadzone" }, - { 0xFD5AABCC, "missileTVGuidedTurnRate" }, - { 0x5A0C59EF, "missileTVGuidedTurningRollAccel" }, - { 0x8531AF79, "missileWaterMaxDepth" }, - { 0x063C6800, "missingCommandWillError" }, - { 0x5BBF66CA, "mortarStrikesLeft" }, - { 0xCD962908, "motdDelay" }, - { 0x536DAE02, "net_broadcast_port" }, - { 0x2911A290, "net_emu_client" }, - { 0x3935BC43, "net_emu_jitter" }, - { 0xE7306441, "net_emu_latency" }, - { 0x69572129, "net_emu_packet_loss" }, - { 0x4DEAB7A8, "net_emu_server" }, - { 0x0FDB62E4, "net_ip" }, - { 0xFC911591, "net_noudp" }, - { 0x74438D70, "net_port" }, - { 0x4DC488D9, "net_socksEnabled" }, - { 0x6FAB64A1, "net_socksPassword" }, - { 0x50F31D33, "net_socksPort" }, - { 0x6079D0C5, "net_socksServer" }, - { 0x55CD55AE, "net_socksUsername" }, - { 0x608C818B, "nextarena" }, - { 0x0B9BB4E2, "nextmap" }, - { 0x2BD6864B, "nightVisionDisableEffects" }, - { 0xFC98B985, "nightVisionFadeInOutTime" }, - { 0x44BAA890, "nightVisionPowerOnTime" }, - { 0x4A195B44, "onlinegame" }, - { 0x1273AD6A, "overrideNVGModelWithKnife" }, - { 0x2F9F59D7, "partyMigrate_NomineeRecalcInterval" }, - { 0x6F592102, "partyMigrate_TestInterval" }, - { 0xF44C064F, "partyMigrate_debugEnabled" }, - { 0x529E1EB5, "partyMigrate_disabled" }, - { 0x3FC76E47, "partyMigrate_maxBWPackets" }, - { 0x268AC20E, "party_allowguests" }, - { 0x950A8887, "party_autoteams" }, - { 0x00BFE457, "party_challengeResponseGraceTime" }, - { 0xA29241CB, "party_challengeResponseInterval" }, - { 0xA61D66A5, "party_chanceToFailConnection" }, - { 0x3BE354E3, "party_chooseLowestPingSlot" }, - { 0x7D5F337A, "party_clientTimeout" }, - { 0x21BA7F45, "party_connectTimeout" }, - { 0x2C9D7AB6, "party_connectToOthers" }, - { 0x6BA1D774, "party_connect_dedicated" }, - { 0xE1BA33C4, "party_considerStreamingForHostMigration" }, - { 0x7A5FF17B, "party_debugShowSkill" }, - { 0x41E080BF, "party_dedicatedMergeMinPlayers" }, - { 0x5743B92D, "party_dedicatedOnly" }, - { 0x0BEDF208, "party_disableLockin" }, - { 0x0E8B353D, "party_disconnectPlayerOnJoinFailed" }, - { 0x8FEFF79E, "party_disconnectPlayerOnRemoval" }, - { 0xF57A7969, "party_editingsettings" }, - { 0x96C1504E, "party_firstSubpartyIndex" }, - { 0x3ED325C2, "party_forceMemberUpdateOnVoiceConnectivityBits" }, - { 0x0CC48B26, "party_forceMigrateAfterRound" }, - { 0x8B3F65C5, "party_forceMigrateOnMatchStartRegression" }, - { 0x604CA7DF, "party_gameStartTimerLength" }, - { 0x111850BA, "party_gameStartTimerLengthPrivate" }, - { 0xA8048A29, "party_gamesize" }, - { 0xA8055950, "party_gametype" }, - { 0xD9013353, "party_hostname" }, - { 0x22EE7029, "party_iamhost" }, - { 0x2E821F4D, "party_isPreviousMapVoted" }, - { 0x41331858, "party_joinInProgressAllowed" }, - { 0x0F273337, "party_keepPartyAliveWhileMatchmaking" }, - { 0x3E26FEBB, "party_kickplayerquestion" }, - { 0x36230A8F, "party_leagueValidityGrace" }, - { 0x50EADE5D, "party_linearMapCycle" }, - { 0xE106DA7E, "party_linearMapCycleRandom" }, - { 0x0A2730F8, "party_lobbyExtensionTime" }, - { 0x2BF675A6, "party_localTeamTest" }, - { 0x5710BA93, "party_mapname" }, - { 0x394C14A4, "party_mappacks" }, - { 0x256D4120, "party_matchedPlayerCount" }, - { 0x62583455, "party_maxChangeListDiff" }, - { 0x97ADF730, "party_maxDesperateMigrationTime" }, - { 0xB5C7EEFA, "party_maxMemberUpdateInterval" }, - { 0x3DC0DE73, "party_maxMigrationTime" }, - { 0x7AB48FE5, "party_maxlocalplayers" }, - { 0x9823CDC4, "party_maxlocalplayers_leaguematch" }, - { 0x97638EBA, "party_maxlocalplayers_local_splitscreen" }, - { 0xB9D656E1, "party_maxlocalplayers_mainlobby" }, - { 0xB530D69E, "party_maxlocalplayers_playermatch" }, - { 0x156A03CC, "party_maxlocalplayers_privatematch" }, - { 0xF0883A57, "party_maxlocalplayers_systemlink" }, - { 0x2CE983D1, "party_maxlocalplayers_theater" }, - { 0x9D959247, "party_maxlocalplayers_wagermatch" }, - { 0x383E837A, "party_maxplayers" }, - { 0x5382C8D9, "party_maxplayers_leaguematch" }, - { 0x8B59C58F, "party_maxplayers_local_splitscreen" }, - { 0x50442061, "party_maxplayers_partylobby" }, - { 0x708FD1B3, "party_maxplayers_playermatch" }, - { 0x3CA86181, "party_maxplayers_privatematch" }, - { 0x05B9A6CC, "party_maxplayers_systemlink" }, - { 0x4F243C66, "party_maxplayers_theater" }, - { 0xB2C6FEBC, "party_maxplayers_wagermatch" }, - { 0x13223BD7, "party_maxplayers_wagerpartylobby" }, - { 0x8623E887, "party_memberUpdateBackoffRate" }, - { 0xA9C00C96, "party_membersMissingMapPack" }, - { 0x111B9328, "party_mergingEnabled" }, - { 0x422C51CF, "party_mergingJitter" }, - { 0x4D220AAA, "party_migrateRestTime" }, - { 0x4FFB805F, "party_minLobbyTime" }, - { 0x20A87AF8, "party_minMemberUpdateInterval" }, - { 0xBAEBB6E9, "party_minResumeMs" }, - { 0xA18FBAB8, "party_minplayers" }, - { 0xD046D605, "party_neverJoinRecent" }, - { 0xDF031A6A, "party_playerCount" }, - { 0x549FBE4F, "party_playervisible" }, - { 0xA0092066, "party_pregameStartTimerLength" }, - { 0x37D50B61, "party_pregameStartTimerLengthPrivate" }, - { 0x5D5477F5, "party_readyAllowOnlyLocalPlayers" }, - { 0x8A67EAB3, "party_readyButtonVisible" }, - { 0x2D136C7B, "party_readyPercentRequired" }, - { 0xBA8E9E9B, "party_reconnectToClientOnTimeout" }, - { 0xF6B8859A, "party_reconnectToHostOnTimeout" }, - { 0x1BC1FCAF, "party_requestMigrateDuringAutoStartIfStreaming" }, - { 0x3B83D87E, "party_restartMatchmakingTimer" }, - { 0xB7E588EF, "party_searchInterval" }, - { 0xD77122C9, "party_sequentialPreviousMapVotingAllowed" }, - { 0xE318377B, "party_simulateLongQoS" }, - { 0x3452EC2C, "party_skillAllowancePerSecond" }, - { 0xCE14BB4F, "party_skillBaseDifferenceAllowance" }, - { 0xA586B699, "party_subSearchInterval" }, - { 0x686D095C, "party_teamSwitchDelay" }, - { 0x1D3BB0C3, "party_theaterTimeoutWhenLoaded" }, - { 0xC4B1DBD8, "party_theaterTimeoutWhenLoading" }, - { 0x78EB86DC, "party_vetoButtonVisible" }, - { 0x0FD90650, "party_vetoDelayTime" }, - { 0x39DF6372, "party_vetoPassed" }, - { 0xCAEEB6E4, "party_vetoPercentRequired" }, - { 0x9CA3B333, "partyend_reason" }, - { 0x247FD890, "partymigrate_HostWaitMS" }, - { 0x8D7A9CFF, "partymigrate_MaxPacketWaitTime" }, - { 0x64302BF6, "partymigrate_MinScoreDiff" }, - { 0xB95AC71D, "partymigrate_NomineeWaitMS" }, - { 0x8B54E51C, "partyprober_chanceToFailAssociation" }, - { 0xC98AEE69, "partyprober_chanceToFailSend" }, - { 0x17F6DC38, "password" }, - { 0xAF7AE8C8, "pc_newversionavailable" }, - { 0x1D605895, "pclive_updateFriends" }, - { 0x779B8FF7, "penetrationCount" }, - { 0xAFA96030, "penetrationCount_allies" }, - { 0x4945776B, "penetrationCount_axis" }, - { 0x4ED23E88, "perk_armorPiercing" }, - { 0xE394558E, "perk_blackbirdShowsGpsJammer" }, - { 0x738E704E, "perk_bulletPenetrationMultiplier" }, - { 0xDA125E04, "perk_damageKickReduction" }, - { 0x25E82970, "perk_deathStreakCountRequired" }, - { 0xAACD4273, "perk_delayExplosiveTime" }, - { 0x773B1EE4, "perk_disarmExplosiveTime" }, - { 0x813107E0, "perk_dogsAttackGhost" }, - { 0xD1CABD70, "perk_extraBreath" }, - { 0x9298991E, "perk_fastLadderClimbMultiplier" }, - { 0xDED1B162, "perk_fireproof" }, - { 0x24C240A6, "perk_flakJacket" }, - { 0x5317A62D, "perk_flakJacket_hardcore" }, - { 0x71C54201, "perk_gpsjammer_alpha" }, - { 0xF3A54EF9, "perk_gpsjammer_fade_time" }, - { 0x1C81E2F3, "perk_gpsjammer_graceperiods" }, - { 0x0E39D2C9, "perk_gpsjammer_min_distance" }, - { 0x7A4A1F4F, "perk_gpsjammer_min_speed" }, - { 0xEC6135EC, "perk_gpsjammer_time_period" }, - { 0xB9DDD532, "perk_grenadeDeath" }, - { 0x5DF05B07, "perk_grenadeTossBackTimer" }, - { 0xC55B3BC4, "perk_healthRegenMultiplier" }, - { 0x7104C528, "perk_interactSpeedMultiplier" }, - { 0x0AB51496, "perk_killstreakDeathPenaltyMultiplier" }, - { 0x37067E05, "perk_killstreakMomentumMultiplier" }, - { 0x9159E179, "perk_killstreakReduction" }, - { 0x083502A4, "perk_mantleReduction" }, - { 0xB081EAF6, "perk_marksmanEnemyNameFadeIn" }, - { 0xC0BF6497, "perk_marksmanEnemyNameFadeOut" }, - { 0xDC453540, "perk_nottargetedbyai_graceperiod" }, - { 0x38B8120F, "perk_nottargetedbyai_min_speed" }, - { 0x7665A2A1, "perk_scavenger_clip_multiplier" }, - { 0xE1ED1600, "perk_scavenger_lethal_proc" }, - { 0x02E81D2B, "perk_scavenger_tactical_proc" }, - { 0x4E723AB3, "perk_shellShockReduction" }, - { 0x2948EA4E, "perk_speedMultiplier" }, - { 0xF5E3419D, "perk_sprintMultiplier" }, - { 0x2928426C, "perk_sprintRecoveryMultiplier" }, - { 0xBBEF7FFF, "perk_throwbackInnerRadius" }, - { 0x1C43F3E2, "perk_weapAdsMultiplier" }, - { 0xA76EAC6F, "perk_weapEquipmentUseMultiplier" }, - { 0x8162B4B2, "perk_weapMeleeMultiplier" }, - { 0x80AA3A76, "perk_weapRateMultiplier" }, - { 0x651CF261, "perk_weapReloadMultiplier" }, - { 0xBF2ECA49, "perk_weapSpreadMultiplier" }, - { 0x3ECBE23C, "perk_weapSwitchMultiplier" }, - { 0x687BBEF3, "perk_weapTossMultiplier" }, - { 0xC86EC0F2, "phys_buoyancy" }, - { 0x3C493F44, "phys_buoyancyDistanceCutoff" }, - { 0xE9A47F08, "phys_buoyancyFloatHeightOffset" }, - { 0x05E74F9A, "phys_disableEntsAndDynEntsCollision" }, - { 0xE3D0F1EE, "phys_gravity" }, - { 0x65EA084C, "phys_gravity_dir" }, - { 0x90BC2F76, "phys_impact_distance_cutoff" }, - { 0xB8C52523, "phys_impact_fx" }, - { 0x8E9BCAAA, "phys_impact_intensity_limit" }, - { 0x904E7AD3, "phys_maxFloatTime" }, - { 0xEF7F85DC, "phys_piecesSpawnDistanceCutoff" }, - { 0x0B55A136, "phys_ragdoll_buoyancy" }, - { 0xBF9F7ADE, "phys_vehicleDamageFroceScale" }, - { 0x34BF14F5, "phys_vehicleGravityMultiplier" }, - { 0xD4BF00A6, "phys_vehicleWheelEntityCollision" }, - { 0x6B585811, "pickupPrints" }, - { 0xF4AE66C6, "playerPushAmount" }, - { 0x630648DA, "player_MGUseRadius" }, - { 0x81D3E7B2, "player_adsExitDelay" }, - { 0xAC07B120, "player_animRunThreshhold" }, - { 0x9698F3FA, "player_animWalkThreshhold" }, - { 0x33016B9B, "player_backSpeedScale" }, - { 0x0959566A, "player_bayonetLaunchDebugging" }, - { 0x882C4124, "player_bayonetLaunchProof" }, - { 0x232D5B2C, "player_bayonetLaunchZCap" }, - { 0x5A4CE110, "player_bayonetRange" }, - { 0x695C3F1E, "player_bayonetTargetDist" }, - { 0x7A80B5BA, "player_breath_fire_delay" }, - { 0x5DC3BAA3, "player_breath_gasp_lerp" }, - { 0x16B85958, "player_breath_gasp_scale" }, - { 0x5DC82DFF, "player_breath_gasp_time" }, - { 0x87043F1F, "player_breath_hold_lerp" }, - { 0x8708B27B, "player_breath_hold_time" }, - { 0x28F65399, "player_breath_snd_delay" }, - { 0xABECD2FD, "player_breath_snd_lerp" }, - { 0x02679ADB, "player_clipSizeMultiplier" }, - { 0x60DDBAAE, "player_debugHealth" }, - { 0x7B56CC18, "player_debugSprint" }, - { 0x8920799F, "player_disableWeaponsOnVehicle" }, - { 0x32FC2BCC, "player_dmgtimer_flinchTime" }, - { 0x72B4329E, "player_dmgtimer_maxTime" }, - { 0x19A34195, "player_dmgtimer_minScale" }, - { 0xBD6FC894, "player_dmgtimer_stumbleTime" }, - { 0x0BF841A9, "player_dmgtimer_timePerPoint" }, - { 0x63315A9D, "player_enableShuffleAnims" }, - { 0xCC0FE69F, "player_enduranceSpeedScale" }, - { 0x36022BAD, "player_footstepsThreshhold" }, - { 0x3404D3A9, "player_forceRedCrosshair" }, - { 0xBABB8D64, "player_knockbackMoveThreshhold" }, - { 0x661A27E2, "player_lastStandBleedoutTime" }, - { 0xA148FFD0, "player_lastStandBleedoutTimeNoRevive" }, - { 0x30BB6D26, "player_lastStandHealthOverlayTime" }, - { 0x51BB033F, "player_lean_rotate" }, - { 0x1B260EA2, "player_lean_rotate_crouch" }, - { 0x7EA7234E, "player_lean_shift" }, - { 0x1909A7D1, "player_lean_shift_crouch" }, - { 0x24C8C560, "player_lookAtEntityAllowChildren" }, - { 0x94141FF8, "player_meleeCalcSpeedFromTarget" }, - { 0x28BDB281, "player_meleeChargeFriction" }, - { 0xA609217A, "player_meleeChargeMaxSpeed" }, - { 0x3FEF08B2, "player_meleeHeight" }, - { 0x1CB54BC2, "player_meleeInterruptFrac" }, - { 0x02A2D146, "player_meleeRange" }, - { 0x030185F9, "player_meleeWidth" }, - { 0x19923F1D, "player_moveThreshhold" }, - { 0x5B284F38, "player_move_factor_on_torso" }, - { 0x364DE272, "player_name" }, - { 0x101A31CA, "player_revivePlayerListCycleTime" }, - { 0x327BA51E, "player_reviveTriggerRadius" }, - { 0x8AAA39DB, "player_runThreshhold" }, - { 0xA89BB4A8, "player_runbkThreshhold" }, - { 0x33021F61, "player_scopeExitOnDamage" }, - { 0xFEFF847E, "player_slick_accel" }, - { 0x3968A6A4, "player_slick_invspeed" }, - { 0x27A75DD2, "player_slick_wishspeed" }, - { 0xF72C9158, "player_sliding_friction" }, - { 0x1B029E5C, "player_sliding_velocity_cap" }, - { 0x58137F06, "player_sliding_wishspeed" }, - { 0xFBAC4900, "player_slopeAnimAngle" }, - { 0x1C321603, "player_spectateSpeedScale" }, - { 0x98E9126D, "player_sprintCameraBob" }, - { 0xBA5486E2, "player_sprintForwardMinimum" }, - { 0xB2A6B6C4, "player_sprintMinTime" }, - { 0xD295E7F0, "player_sprintRechargePause" }, - { 0x488E3CEA, "player_sprintSpeedScale" }, - { 0xF683C80F, "player_sprintStrafeSpeedScale" }, - { 0xCA4662C6, "player_sprintThreshhold" }, - { 0xEEDBF8C0, "player_sprintTime" }, - { 0x85056D7C, "player_sprintUnlimited" }, - { 0x357C3ABD, "player_standingViewHeight" }, - { 0x930AA0C7, "player_strafeAnimCosAngle" }, - { 0x02AA1E0F, "player_strafeSpeedScale" }, - { 0x7711B3C2, "player_sustainAmmo" }, - { 0xEB2C2590, "player_swimDamage" }, - { 0xF982BF27, "player_swimDamagerInterval" }, - { 0xC8C5B700, "player_swimTime" }, - { 0xC4FA62BA, "player_throwbackInnerRadius" }, - { 0xBC5B402D, "player_throwbackOuterRadius" }, - { 0x45AD9153, "player_throwbackOuterRadius_zm" }, - { 0x33418672, "player_turnAnims" }, - { 0xEFD45FA6, "player_useRadius" }, - { 0x03C8AA2C, "player_useRadius_zm" }, - { 0x989E32FC, "player_viewLockEnt" }, - { 0x17DE0520, "player_viewRateScale" }, - { 0xF0911DBA, "player_view_pitch_down" }, - { 0x1D9B0EE7, "player_view_pitch_up" }, - { 0xCAE178ED, "player_waterSpeedScale" }, - { 0x2E121A78, "player_zombieMeleeHeight" }, - { 0x4027C24C, "player_zombieMeleeRange" }, - { 0x408676FF, "player_zombieMeleeWidth" }, - { 0xE1B103F0, "player_zombieSpeedScale" }, - { 0xFA215A70, "player_zombieSprintSpeedScale" }, - { 0xFB5A0D45, "playlist_allowdevmaps" }, - { 0xF4162161, "playlist_enabled" }, - { 0x6D1108E8, "playlist_entry" }, - { 0x10397B3C, "playlist_excludeGametype" }, - { 0x952E5E5A, "playlist_excludeGametypeMap" }, - { 0x12B8E33E, "playlist_excludeMap" }, - { 0xF3CF0035, "playlist_next" }, - { 0x2E8668E8, "popInLetterFXTime" }, - { 0xD58724EF, "probation_league_enabled" }, - { 0x2BFC883F, "probation_league_forgiveCount" }, - { 0x1FD3A269, "probation_league_kickcalar" }, - { 0x506F5A7B, "probation_league_matchHistoryWindow" }, - { 0xAE92735F, "probation_league_probationThreshold" }, - { 0x87400001, "probation_league_probationTime" }, - { 0x0C24A25D, "probation_league_quitScalar" }, - { 0xAFE7FAC1, "probation_league_timeoutScalar" }, - { 0xA08F2E47, "probation_league_warningThreshold" }, - { 0x6AC3DB9B, "probation_public_enabled" }, - { 0x82D24A6B, "probation_public_forgiveCount" }, - { 0xFFA016A8, "probation_public_kickScalar" }, - { 0x90110DA7, "probation_public_matchHistoryWindow" }, - { 0xEE34268B, "probation_public_probationThreshold" }, - { 0xB8CE07AD, "probation_public_probationTime" }, - { 0xCC0BE989, "probation_public_quitScalar" }, - { 0xE176026D, "probation_public_timeoutScalar" }, - { 0x13922673, "probation_public_warningThreshold" }, - { 0x7ED35038, "probation_version" }, - { 0x2737A487, "profileDirtyInterval" }, - { 0xBAA3771C, "prone_bipod_enable" }, - { 0x2B4DC497, "protocol" }, - { 0xC15079F5, "ps3Game" }, - { 0xB9D5B614, "qosMaxAllowedPing" }, - { 0xAF9305E5, "qosPreferredPing" }, - { 0x0035DC6D, "quit_on_error" }, - { 0xF55836AD, "r_aaSamples" }, - { 0x34553033, "r_aaSamplesMax" }, - { 0x47E6823A, "r_alphaMap" }, - { 0x3033F08E, "r_anaglyphFX_enable" }, - { 0x50898175, "r_aspectRatio" }, - { 0x3783FECD, "r_aspectRatioWindow" }, - { 0xB77B2116, "r_autoLodScale" }, - { 0x5ADAF0D1, "r_autopriority" }, - { 0x040B36A6, "r_blinkCullNone" }, - { 0x2C878E96, "r_blinkLayers" }, - { 0x6C53817D, "r_blinkLitQuasiOpaque" }, - { 0x4F86874E, "r_blinkTrans" }, - { 0x00E4F489, "r_bloomHiQuality" }, - { 0x81D4D99E, "r_bloomTweaks" }, - { 0x18B9CC6B, "r_blur" }, - { 0xE897EA4F, "r_brightness" }, - { 0x96D55CB9, "r_brushLimit" }, - { 0xC8F3B4BC, "r_clearColor" }, - { 0xE76A4C6E, "r_clearColor2" }, - { 0x25A69CBC, "r_clipCodec" }, - { 0x4652B747, "r_clipFPS" }, - { 0x10B0A499, "r_clipSize" }, - { 0x87111DA0, "r_cmdbuf_worker" }, - { 0xFE8C3DB3, "r_colorMap" }, - { 0x0390D8C4, "r_contrast" }, - { 0xA7041A45, "r_convergence" }, - { 0x738EBD94, "r_cubicUpsampleParam" }, - { 0xA9D8DF01, "r_currentMonitor" }, - { 0x7D344216, "r_customMode" }, - { 0xE0AE7105, "r_debugMetalStorm" }, - { 0x1EF61AAF, "r_debugPerformance" }, - { 0x3E396234, "r_debugShader" }, - { 0x6BBD9273, "r_debugShowCoronas" }, - { 0xDCE826CE, "r_debugShowDynamicLights" }, - { 0x4A60B6ED, "r_debugShowPrimaryLights" }, - { 0xC141A400, "r_defaultMode" }, - { 0xE1092E29, "r_desaturation" }, - { 0xE9D9108D, "r_disableGenericFilter" }, - { 0xEDED1E11, "r_dlightLimit" }, - { 0x36B1A874, "r_dobjLimit" }, - { 0x3336D70D, "r_dofHDR" }, - { 0xDBA4BFAD, "r_dof_bias" }, - { 0x5F2D1955, "r_dof_enable" }, - { 0x74AB139C, "r_dof_farBlur" }, - { 0x60A062DE, "r_dof_farEnd" }, - { 0x0B453615, "r_dof_farStart" }, - { 0x79795549, "r_dof_nearBlur" }, - { 0xE4A6A2EB, "r_dof_nearEnd" }, - { 0xA9DBAD62, "r_dof_nearStart" }, - { 0xF550DA16, "r_dof_showdebug" }, - { 0x518A2ACA, "r_dof_tweak" }, - { 0x6E57EB31, "r_dof_viewModelEnd" }, - { 0x65001F28, "r_dof_viewModelStart" }, - { 0xB9CA4325, "r_dpvs_useCellForceInvisibleBits" }, - { 0xC1D9AB4B, "r_drawDebugFogParams" }, - { 0xFBDCB497, "r_drawLightmapDrawlists" }, - { 0xE31F8D0A, "r_drawLitDrawlists" }, - { 0xCD92C247, "r_drawWater" }, - { 0xB9ADA04E, "r_dualPlayActive" }, - { 0xC3BEC619, "r_dualPlayEnable" }, - { 0x97929F1B, "r_dualPlayTestCount" }, - { 0x6EB3AB6A, "r_enableCubicUpsample" }, - { 0xCB838423, "r_enableFlashlight" }, - { 0x98D0F001, "r_enableOccluders" }, - { 0x7F5AF570, "r_enablePlayerShadow" }, - { 0x30FB6E0D, "r_exposureTweak" }, - { 0x3113AF0E, "r_exposureValue" }, - { 0x73612A63, "r_extracam_custom_aspectratio" }, - { 0xB97D3050, "r_extracam_lod_scale" }, - { 0x2676B233, "r_filmLut" }, - { 0xE64F5AD3, "r_filmTweakBrightness" }, - { 0x2A5ECFAD, "r_filmTweakDesaturation" }, - { 0xFCA2DF41, "r_filmTweakEnable" }, - { 0x06031352, "r_filmTweakInvert" }, - { 0x2D8A998F, "r_filmTweakLut" }, - { 0xCF79E67A, "r_filmUseTweaks" }, - { 0xDAB558F6, "r_finalShiftX" }, - { 0xDAB558F7, "r_finalShiftY" }, - { 0xD78A9C21, "r_flameFX_FPS" }, - { 0xB760648E, "r_flameFX_distortionScaleFactor" }, - { 0x59BFFCEE, "r_flameFX_fadeDuration" }, - { 0x046752B6, "r_flameFX_magnitude" }, - { 0xF462DA95, "r_flameScaler" }, - { 0xA3191622, "r_flame_allowed" }, - { 0x433F7FA3, "r_flashLightBobAmount" }, - { 0x8F065CBB, "r_flashLightBobRate" }, - { 0x40FBB875, "r_flashLightBrightness" }, - { 0x9501CF9B, "r_flashLightColor" }, - { 0x752FC99B, "r_flashLightEndRadius" }, - { 0xFF9FF7B0, "r_flashLightFlickerAmount" }, - { 0x70DF6D88, "r_flashLightFlickerRate" }, - { 0x2BF09A59, "r_flashLightFovInnerFraction" }, - { 0x50939383, "r_flashLightOffset" }, - { 0x96099949, "r_flashLightRange" }, - { 0x9B36BF55, "r_flashLightShadows" }, - { 0xC3E6A2E3, "r_flashLightSpecularScale" }, - { 0x5CC52352, "r_flashLightStartRadius" }, - { 0x1043C232, "r_fog" }, - { 0x60D5E681, "r_fogBaseDist" }, - { 0xF6F02606, "r_fogBaseHeight" }, - { 0xB6CD2391, "r_fogColor" }, - { 0xDA1EDFE1, "r_fogHalfDist" }, - { 0xE65CF766, "r_fogHalfHeight" }, - { 0x3BE6948B, "r_fogOpacity" }, - { 0x08F9E0C7, "r_fogSunColor" }, - { 0x0965EEA4, "r_fogSunInner" }, - { 0xCC377741, "r_fogSunOpacity" }, - { 0x09D671D7, "r_fogSunOuter" }, - { 0x09E1F580, "r_fogSunPitch" }, - { 0xB631F459, "r_fogSunYaw" }, - { 0xB805078E, "r_fogTweak" }, - { 0x6CA71B05, "r_fog_disable" }, - { 0x89AC5D21, "r_fontResolution" }, - { 0x0DA54081, "r_forceCameraHdg" }, - { 0xC250C9B4, "r_forceCameraNode" }, - { 0xA249616D, "r_forceCamerarecord" }, - { 0xD07066A4, "r_forceLod" }, - { 0x7A70AC47, "r_fullPrepass" }, - { 0x8DBA54A9, "r_fullbright" }, - { 0xB4577E49, "r_fullscreen" }, - { 0x18BC2E56, "r_fxaa" }, - { 0xC9E32424, "r_genericSceneVector0" }, - { 0xC9E32425, "r_genericSceneVector1" }, - { 0xC9E32426, "r_genericSceneVector2" }, - { 0xC9E32427, "r_genericSceneVector3" }, - { 0x3260753A, "r_genericSceneVector_debug" }, - { 0xCFED433C, "r_glossMap" }, - { 0x3157F17D, "r_grassEnable" }, - { 0xE2EC341E, "r_grassWindForceEnable" }, - { 0xADB4B524, "r_heroLightScale" }, - { 0xE8A6ACFA, "r_heroLighting" }, - { 0x2234C8C9, "r_highLodDist" }, - { 0x123A877C, "r_ignorehwgamma" }, - { 0x8C662FD3, "r_lightConflicts" }, - { 0x04CC2FA2, "r_lightGridContrast" }, - { 0x0D225A6A, "r_lightGridEnableTweaks" }, - { 0x179C52DB, "r_lightGridIntensity" }, - { 0x42123026, "r_lightMapFilterDisable" }, - { 0x7D96A674, "r_lightMapSecondary" }, - { 0xD717740A, "r_lightTweakAmbient" }, - { 0x9271BC69, "r_lightTweakAmbientColor" }, - { 0xDA0F9ABF, "r_lightTweakSunColor" }, - { 0x1E89EEE5, "r_lightTweakSunDiffuseColor" }, - { 0xDA7A2601, "r_lightTweakSunDirection" }, - { 0xDAAF16D8, "r_lightTweakSunLight" }, - { 0x296FBFA6, "r_lightmapOnlyBspSurfs" }, - { 0x76A6B108, "r_lightmapOnlyEntSurfs" }, - { 0x6A02A845, "r_lightmapOnlySModelSurfs" }, - { 0x87E608D4, "r_loadForRenderer" }, - { 0x752B8F54, "r_loadingScreen" }, - { 0x01AF2E58, "r_lockPvs" }, - { 0xB2CAF0CA, "r_lockPvsInCode" }, - { 0xAF42F0C3, "r_lodBiasRigid" }, - { 0xDD8DE260, "r_lodBiasSkinned" }, - { 0xE8E33AAC, "r_lodScaleRigid" }, - { 0x00684A89, "r_lodScaleSkinned" }, - { 0x3A736B3D, "r_lodscale" }, - { 0x2F36403B, "r_lowLodDist" }, - { 0x7D2E26A7, "r_lowestLodDist" }, - { 0x81E8DB50, "r_materialXYZ" }, - { 0x80806AEA, "r_mediumLodDist" }, - { 0x57474CD7, "r_missile_cam_debug_display" }, - { 0x18BFDF1B, "r_mode" }, - { 0x30BBC2AC, "r_mode1" }, - { 0x30BBC2AD, "r_mode2" }, - { 0x891A7326, "r_modelLimit" }, - { 0x1F37B307, "r_modelVertColor" }, - { 0x4F6F6FFE, "r_monitor" }, - { 0x91297707, "r_monitorCount" }, - { 0x07516E8D, "r_multiGpu" }, - { 0xB46FD69B, "r_multi_extracam_debug" }, - { 0x4A8C3418, "r_noipak" }, - { 0x87204F02, "r_norefresh" }, - { 0x996BEEFD, "r_normalMap" }, - { 0x23140C58, "r_num_viewports" }, - { 0xEFBD9983, "r_occlusionMap" }, - { 0x7EBF2447, "r_open_automate" }, - { 0x05EE08D3, "r_outdoorAwayBias" }, - { 0x956C11B9, "r_outdoorDownBias" }, - { 0x19022C01, "r_outdoorFeather" }, - { 0x4EC69C58, "r_picmip" }, - { 0x337CE88B, "r_picmip_bump" }, - { 0x1E98BAB5, "r_picmip_manual" }, - { 0x338624A2, "r_picmip_spec" }, - { 0xE2319926, "r_poisonFX_blurMax" }, - { 0xE2319A24, "r_poisonFX_blurMin" }, - { 0xABF38118, "r_poisonFX_debug_enable" }, - { 0xE6C1015F, "r_poisonFX_dvisionX" }, - { 0x0318BD34, "r_poisonFX_pulse" }, - { 0x312CCC5A, "r_portalMinRecurseDepth" }, - { 0x6D141C16, "r_portalWalkLimit" }, - { 0xE43FEB66, "r_previousFullscreen" }, - { 0x29DB0183, "r_primaryLightTweakDiffuseStrength" }, - { 0x0B25E37C, "r_primaryLightTweakSpecularStrength" }, - { 0x86138A2E, "r_primaryLightUseTweaks" }, - { 0x0EFA34CF, "r_qrcode_debug_display" }, - { 0xB14E8469, "r_qrcode_debug_display_size" }, - { 0xF7B30924, "r_reflectionProbeGenerate" }, - { 0x70620FE0, "r_remotescreen_renderlastframe" }, - { 0xC812E1FD, "r_resampleScene" }, - { 0xEABD8BEA, "r_resolution" }, - { 0xA9A7634B, "r_reviveFX_debug" }, - { 0xBED8002D, "r_reviveFX_edgeAmount" }, - { 0x3CC9ACEE, "r_reviveFX_edgeColorTemp" }, - { 0x44EB9187, "r_reviveFX_edgeContrast" }, - { 0xB8B84D10, "r_reviveFX_edgeMaskAdjust" }, - { 0xDEFC9460, "r_reviveFX_edgeOffset" }, - { 0xE67699A3, "r_reviveFX_edgeSaturation" }, - { 0x0ECA6D21, "r_reviveFX_edgeScale" }, - { 0x3B81A865, "r_rimIntensity" }, - { 0x93BE58EB, "r_rimIntensity_debug" }, - { 0x80831B9E, "r_scaleViewport" }, - { 0x3CF504F4, "r_seethru_decal_enable" }, - { 0x84E53235, "r_shaderDebugA" }, - { 0x84E53236, "r_shaderDebugB" }, - { 0x84E53237, "r_shaderDebugC" }, - { 0xCFE68842, "r_shaderWarming" }, - { 0x46ECCE34, "r_shaderWarmingPerFrame" }, - { 0xCB593133, "r_shader_constant_set_debug_range" }, - { 0x6A53E647, "r_shader_constant_set_enable" }, - { 0x6932CCC2, "r_showForcedInvisibleCells" }, - { 0x89A92F15, "r_showLightGrid" }, - { 0x640A2888, "r_showLightingOrigins" }, - { 0xF264B36F, "r_showMissingLightGrid" }, - { 0x98404922, "r_showOutdoorVolumeDebug" }, - { 0x2116BBC0, "r_showPenetration" }, - { 0xA258F580, "r_showReflectionProbeSelection" }, - { 0x14985435, "r_showSunDirectionDebug" }, - { 0xBA73E6B8, "r_singleCell" }, - { 0xC68B7557, "r_skinnedCacheOverflowLodMaxScale" }, - { 0x48916EF7, "r_skinnedCacheOverflowLodScaleDecay" }, - { 0x13A18606, "r_skipPvs" }, - { 0x88CEF962, "r_skyColorTemp" }, - { 0x4302F51D, "r_skyRotation" }, - { 0xD29EFD78, "r_skyTransition" }, - { 0xF815F309, "r_sky_intensity_angle0" }, - { 0xF815F30A, "r_sky_intensity_angle1" }, - { 0x5D20A801, "r_sky_intensity_factor0" }, - { 0x5D20A802, "r_sky_intensity_factor1" }, - { 0x237F0D10, "r_sky_intensity_showDebugDisplay" }, - { 0x177D74BF, "r_smp_worker" }, - { 0x193BC186, "r_smp_worker_thread0" }, - { 0x193BC187, "r_smp_worker_thread1" }, - { 0x193BC188, "r_smp_worker_thread2" }, - { 0x193BC189, "r_smp_worker_thread3" }, - { 0x193BC18A, "r_smp_worker_thread4" }, - { 0x193BC18B, "r_smp_worker_thread5" }, - { 0x193BC1C9, "r_smp_worker_threads" }, - { 0x416B48FB, "r_sortBackToFront" }, - { 0x1665AE24, "r_sortDrawSurfsBsp" }, - { 0x3CF4A8B8, "r_sortDrawSurfsStaticModel" }, - { 0x20D69B73, "r_specularMap" }, - { 0xA160548A, "r_spotLightEntityShadows" }, - { 0x45F8ADD1, "r_spotLightSModelShadows" }, - { 0x5ED10B2D, "r_spotLightShadows" }, - { 0x18C33A0C, "r_ssao" }, - { 0xDCE0E8CB, "r_ssaoBias" }, - { 0x79200693, "r_ssaoDebug" }, - { 0x59DB0DB3, "r_ssaoIntensity" }, - { 0xBD8197B4, "r_ssaoRadius" }, - { 0x7A2E57F4, "r_ssaoScale" }, - { 0x7D7B97C0, "r_stereo3DAvailable" }, - { 0xF4A656B8, "r_stereo3DEyeSeparation" }, - { 0xD0E24492, "r_stereo3DEyeSeparationScaler" }, - { 0x3CEFE35C, "r_stereo3DIPD" }, - { 0xDAEE7C84, "r_stereo3DMode" }, - { 0xAC8364BC, "r_stereo3DOn" }, - { 0xF50495DD, "r_stereoFocusDepth" }, - { 0x6D1CCED0, "r_stereoGunShift" }, - { 0xF809BF2C, "r_stereoTurretShift" }, - { 0x7B03E923, "r_streamDumpDistance" }, - { 0xE1FD5615, "r_sunFlareTint" }, - { 0xC6E00DDE, "r_sun_from_dvars" }, - { 0x29DFD2BD, "r_sun_fx_position" }, - { 0x71EBD5DB, "r_sunblind_fadein" }, - { 0xAF66AC1C, "r_sunblind_fadeout" }, - { 0x47B5AEC0, "r_sunblind_max_angle" }, - { 0x4485C66E, "r_sunblind_max_darken" }, - { 0xA7FDF63E, "r_sunblind_min_angle" }, - { 0xD3985B3C, "r_sunflare_fadein" }, - { 0x46A3DD9D, "r_sunflare_fadeout" }, - { 0xA3045180, "r_sunflare_max_alpha" }, - { 0xA3054481, "r_sunflare_max_angle" }, - { 0xBF28FC95, "r_sunflare_max_size" }, - { 0x034D8BFF, "r_sunflare_min_angle" }, - { 0x0FA74C53, "r_sunflare_min_size" }, - { 0xF2686D0C, "r_sunflare_shader" }, - { 0x048BB89D, "r_sunglare_fadein" }, - { 0x9602E71E, "r_sunglare_fadeout" }, - { 0x464CB242, "r_sunglare_max_angle" }, - { 0x4F5737A6, "r_sunglare_max_lighten" }, - { 0xA694F9C0, "r_sunglare_min_angle" }, - { 0x354E8BD9, "r_sunsprite_shader" }, - { 0xF977855D, "r_sunsprite_size" }, - { 0xCF76B5BD, "r_superFlareDraw" }, - { 0x97B9F058, "r_superflare_drawlist" }, - { 0xF7AB0B95, "r_swrk_override_characterCharredAmount" }, - { 0x671C0E30, "r_swrk_override_characterDissolveColor" }, - { 0xB19289A4, "r_swrk_override_wetness" }, - { 0x12CF79BC, "r_tension_enable" }, - { 0x7FD1FE8D, "r_texFilterAnisoMax" }, - { 0x7FD1FF8B, "r_texFilterAnisoMin" }, - { 0xA1BFD961, "r_texFilterDisable" }, - { 0x56565B72, "r_texFilterMipBias" }, - { 0x565C7D78, "r_texFilterMipMode" }, - { 0xA53344B6, "r_texFilterQuality" }, - { 0xDD9F3B0C, "r_textureMode" }, - { 0x18C3DBA4, "r_txaa" }, - { 0xB1F1F5EA, "r_txaaDepth1" }, - { 0xB1F1F5EB, "r_txaaDepth2" }, - { 0x490EB869, "r_txaaMode" }, - { 0xBC92EBEB, "r_txaaMotion1" }, - { 0xBC92EBEC, "r_txaaMotion2" }, - { 0x4DE1BB4A, "r_txaaSupported" }, - { 0x401C9206, "r_ui3d_debug_display" }, - { 0x5A55EDB2, "r_ui3d_h" }, - { 0x6A60BEEC, "r_ui3d_use_debug_values" }, - { 0x5A55EDC1, "r_ui3d_w" }, - { 0x5A55EDC2, "r_ui3d_x" }, - { 0x5A55EDC3, "r_ui3d_y" }, - { 0x077BF7B7, "r_vc_compile" }, - { 0x3D91D684, "r_viewportBackingColor" }, - { 0x31612B69, "r_vsync" }, - { 0xBBBCC6B6, "r_vsyncThreshold" }, - { 0x7B3E1437, "r_warmShaders" }, - { 0xE1E26C15, "r_waterFogTest" }, - { 0xBCCC5715, "r_waterSheetingFX_allowed" }, - { 0x7FEAEFE3, "r_waterSheetingFX_distortionScaleFactor" }, - { 0x7BC65734, "r_waterSheetingFX_enable" }, - { 0xEC12768B, "r_waterSheetingFX_magnitude" }, - { 0x992FECF5, "r_waterSheetingFX_radius" }, - { 0xC5902371, "r_waterWaveAmplitude" }, - { 0x14388713, "r_waterWaveAngle" }, - { 0xBACBBF87, "r_waterWaveBase" }, - { 0x928BE5FD, "r_waterWaveNormalScale" }, - { 0x154493BD, "r_waterWavePhase" }, - { 0xD764A0C8, "r_waterWaveScriptShader0" }, - { 0xD764A0C9, "r_waterWaveScriptShader1" }, - { 0x157F4F7D, "r_waterWaveSpeed" }, - { 0x0D834E26, "r_waterWaveSteepness" }, - { 0xCF475521, "r_waterWaveWavelength" }, - { 0xA0E464EC, "r_watersim_enabled" }, - { 0x1950EE71, "r_zbufferDebug" }, - { 0xA6F298DE, "r_zbufferDebugRange" }, - { 0x227099C1, "r_zebrastripe" }, - { 0x18C6D969, "r_zfar" }, - { 0x31A678D6, "r_znear" }, - { 0x74957FD7, "r_zombieDarkness" }, - { 0x4DFCD7D1, "r_zombieDisableEarthEffect" }, - { 0x0217006E, "r_zombieDisableSlideEffect" }, - { 0x53380D37, "r_zombieNameAllowDevList" }, - { 0x5B8EC763, "r_zombieNameAllowFriendsList" }, - { 0x10D5D4D1, "radius_damage_debug" }, - { 0xCA089EC5, "ragdoll_baselerp_time" }, - { 0xE0781B7F, "ragdoll_bullet_force" }, - { 0x128258B4, "ragdoll_bullet_upbias" }, - { 0x1A22B8F0, "ragdoll_debug" }, - { 0x6170FFF0, "ragdoll_enable" }, - { 0x0B89BF68, "ragdoll_explode_force" }, - { 0x9FC879BD, "ragdoll_explode_upbias" }, - { 0x62C1C672, "ragdoll_fps" }, - { 0x52E281E2, "ragdoll_jitter_scale" }, - { 0x139B75CE, "ragdoll_jointlerp_time" }, - { 0x307AC8AE, "ragdoll_max_life" }, - { 0x2BBBB858, "ragdoll_reactivation_cutoff" }, - { 0x15C521EC, "ragdoll_rotvel_scale" }, - { 0x7ABB0625, "ragdoll_self_collision_scale" }, - { 0x7C9D3EB1, "rate" }, - { 0x19992209, "rcon_password" }, - { 0x549215EB, "recordPointsSpent" }, - { 0x458DF103, "redactionDisplayTime" }, - { 0x802DE914, "redactionFadeDuration" }, - { 0x55A53653, "redactionStartStrokeTime" }, - { 0x23CEEC65, "redactionStrokeTime" }, - { 0xD72B5155, "reliableResendTime" }, - { 0x91366CFB, "reliableTimeoutTime" }, - { 0xA15185C5, "reportUserInterval" }, - { 0xDE68EE01, "restore_gump_name" }, - { 0x19519796, "revive_time_taken" }, - { 0xB7C82BA0, "riotshield_assist_time" }, - { 0xBB6F1DE8, "riotshield_bullet_damage_scale" }, - { 0x08B73F7A, "riotshield_damage_score_max" }, - { 0x8576E701, "riotshield_damage_score_threshold" }, - { 0xC320348D, "riotshield_deploy_limit_radius" }, - { 0x2DB5E224, "riotshield_deploy_pitch_max" }, - { 0xB4C054A5, "riotshield_deploy_roll_max" }, - { 0xD563D05F, "riotshield_deploy_zdiff_max" }, - { 0xAA9B5326, "riotshield_deployed_health" }, - { 0x0217C6C3, "riotshield_destroyed_cleanup_time" }, - { 0x88D773FF, "riotshield_explosive_damage_scale" }, - { 0x23526A28, "riotshield_melee_damage_scale" }, - { 0x19FAA051, "riotshield_projectile_damage_scale" }, - { 0xDD7F5246, "safeArea_horizontal" }, - { 0x149CE636, "safeArea_vertical" }, - { 0x010BB950, "saved_gameskill" }, - { 0x9ED10890, "scavenger_clip_multiplier" }, - { 0x7C9DD34C, "scr_" }, - { 0x8BA2CC7B, "scr_HeldKillstreak_Penalty" }, - { 0xDA835401, "scr_QRDroneFlyTime" }, - { 0x33CF364A, "scr_RequiredMapAspectratio" }, - { 0xF549D4C5, "scr_ai_tank_no_timeout" }, - { 0xC2DDDCC6, "scr_allies" }, - { 0x2417B16D, "scr_allow_killstreak_building" }, - { 0xD1996D68, "scr_art_dump" }, - { 0x9EF57A6C, "scr_art_sun_fog_dir_set" }, - { 0x05E997AE, "scr_art_tweak" }, - { 0xFE68F88A, "scr_art_visionfile" }, - { 0x72E5D681, "scr_axis" }, - { 0x959D90CA, "scr_bomb_explode_delay" }, - { 0x487CD523, "scr_bot_follow" }, - { 0x1D5FB2EC, "scr_botsAllowKillstreaks" }, - { 0x8330ABEF, "scr_botsGrenadesOnly" }, - { 0x98F33417, "scr_botsHasPlayerWeapon" }, - { 0xFC880A10, "scr_botsSpecialGrenadesOnly" }, - { 0xD81AD9C1, "scr_cam_move_time" }, - { 0x69E20811, "scr_cinematic_autofocus" }, - { 0x8D448453, "scr_codPointsCap" }, - { 0x9D07FE34, "scr_codpointsmatchscale" }, - { 0x4B61B909, "scr_codpointsperchallenge" }, - { 0x5DB7110F, "scr_codpointsxpscale" }, - { 0x0D6F71B0, "scr_crane_arm_y_move_time" }, - { 0x92CC26F1, "scr_crane_arm_z_move_time" }, - { 0xC39D2ABF, "scr_crane_claw_drop_speed" }, - { 0xF60036C0, "scr_crane_claw_drop_time_min" }, - { 0x33ED9F5F, "scr_crane_claw_move_time" }, - { 0xCFA0F999, "scr_crane_crate_lower_time" }, - { 0xB4D4D064, "scr_crane_crate_raise_time" }, - { 0xC8077F47, "scr_csmode" }, - { 0xF6F112EA, "scr_ctf_spawnPointFacingAngle" }, - { 0x651F4AD8, "scr_custom_score_assist" }, - { 0xC371F046, "scr_debug_render_snapshotmode" }, - { 0x42308B33, "scr_debug_render_spawn_data" }, - { 0x423962DE, "scr_debug_render_spawn_text" }, - { 0x62ACF3A7, "scr_debug_spawn_player" }, - { 0x2CCCDCB5, "scr_debugheli" }, - { 0x8E9CA497, "scr_deleteexplosivesonspawn" }, - { 0xC0DBB722, "scr_devHeliPathsDebugDraw" }, - { 0xAD911707, "scr_devStrafeRunPathDebugDraw" }, - { 0x1F70E0F8, "scr_devgui_spawn" }, - { 0x6086CCA2, "scr_dial_rotate_time" }, - { 0x8D5C0C16, "scr_disableChallenges" }, - { 0x3B63ABAC, "scr_disableSetDStat" }, - { 0x742CBFAF, "scr_disableStatTracking" }, - { 0x68ECFF24, "scr_disable_air_death_ragdoll" }, - { 0x732A4726, "scr_disable_cac" }, - { 0x5661F47E, "scr_disable_weapondrop" }, - { 0x70B3C3B7, "scr_do_notify" }, - { 0x628ADECB, "scr_dof_enable" }, - { 0xE3C187D2, "scr_dof_farBlur" }, - { 0x63FE2854, "scr_dof_farEnd" }, - { 0x5D2A310B, "scr_dof_farStart" }, - { 0xCB5E503F, "scr_dof_nearBlur" }, - { 0x53BD1721, "scr_dof_nearEnd" }, - { 0x38600718, "scr_dof_nearStart" }, - { 0x9CB86F60, "scr_draw_triggers" }, - { 0x5CCEB632, "scr_drawfriend" }, - { 0xBAC14FFE, "scr_dynamic_source_loading" }, - { 0xD04570F2, "scr_emp_damage_debug" }, - { 0xC2F42DBB, "scr_emp_jammed" }, - { 0x35E553D4, "scr_emp_timeout" }, - { 0xEB32B46C, "scr_env_destroy_delay" }, - { 0x829C0FDB, "scr_fog_baseheight" }, - { 0x699F914F, "scr_fog_blue" }, - { 0x9DA55446, "scr_fog_color" }, - { 0x93B3FAED, "scr_fog_color_scale" }, - { 0x54D01B47, "scr_fog_exp_halfheight" }, - { 0xB59305FE, "scr_fog_exp_halfplane" }, - { 0xB6F06C9D, "scr_fog_fraction" }, - { 0x9DEF3C58, "scr_fog_green" }, - { 0x81EA8425, "scr_fog_max_opacity" }, - { 0x5C40223D, "scr_fog_nearplane" }, - { 0xA61C5EC2, "scr_fog_red" }, - { 0x9003F201, "scr_force_finalkillcam" }, - { 0xA0259FFF, "scr_force_roundkillcam" }, - { 0xB107A31D, "scr_forceevent" }, - { 0xA21C71D1, "scr_forcegrenade" }, - { 0x760BFF29, "scr_forcelaststand" }, - { 0x5A4675BD, "scr_forcerankedmatch" }, - { 0x4C560F97, "scr_freelock" }, - { 0xF35973DA, "scr_game_arcadescoring" }, - { 0x77F933CC, "scr_game_bulletdamage" }, - { 0x883B0EB8, "scr_game_difficulty" }, - { 0x9C756AF7, "scr_game_friendlyFireDelay" }, - { 0x273F6466, "scr_game_medalsenabled" }, - { 0xFBBF61E4, "scr_game_pinups" }, - { 0xDFD7387C, "scr_game_rankenabled" }, - { 0x62447114, "scr_gamemodeslideout" }, - { 0xA0215B8E, "scr_give_equipment" }, - { 0x227BB8EC, "scr_give_grenade" }, - { 0xADB1B0DE, "scr_give_player_score" }, - { 0x46AB9A04, "scr_giveaitankdrop" }, - { 0x00EBCD76, "scr_giveautoturret" }, - { 0x049A620B, "scr_giveautoturretdrop" }, - { 0xEC3C6603, "scr_givecounteruav" }, - { 0xAB6F11E4, "scr_givedogs" }, - { 0xE62A2B59, "scr_giveemp" }, - { 0xA3D942D2, "scr_givehelicopter_comlink" }, - { 0xB0D450A0, "scr_givehelicopter_player_gunner" }, - { 0xB1DB4779, "scr_givehelicopterguard" }, - { 0xD58518BD, "scr_givem32_drop" }, - { 0x2904A24A, "scr_givemicrowaveturret" }, - { 0x83F980DF, "scr_givemicrowaveturretdrop" }, - { 0x18F60E02, "scr_giveminigun_drop" }, - { 0xC92281E5, "scr_givemissiledrone" }, - { 0x0D2EA699, "scr_givemissileremote" }, - { 0xCA347457, "scr_givemissileswarm" }, - { 0xE3F1D258, "scr_givemortarremote" }, - { 0xAB757D49, "scr_giveperk" }, - { 0xA36DE8DC, "scr_giveplanemortar" }, - { 0xA25E17F2, "scr_giveqrdrone" }, - { 0x1A46E981, "scr_giveradar" }, - { 0x52559802, "scr_giveradardirection" }, - { 0x63476D2C, "scr_givercbomb" }, - { 0x812082F1, "scr_givestraferun" }, - { 0xD3345BF9, "scr_givesupplydrop" }, - { 0x78762059, "scr_givetestsupplydrop" }, - { 0xD0ABF43F, "scr_givexp" }, - { 0x2A181C06, "scr_gunxpscale" }, - { 0x2677BAB4, "scr_hardcore" }, - { 0x6290D591, "scr_hardpoint_allowauto_turret" }, - { 0x5D6984FF, "scr_hardpoint_allowcounteruav" }, - { 0x85DFA3E0, "scr_hardpoint_allowdogs" }, - { 0x31C39DCE, "scr_hardpoint_allowhelicopter_comlink" }, - { 0x42C9BAFD, "scr_hardpoint_allowradar" }, - { 0xC2B1D4FE, "scr_hardpoint_allowradardirection" }, - { 0x9C246E28, "scr_hardpoint_allowrcbomb" }, - { 0x1392B05F, "scr_hardpoint_allowuav" }, - { 0x9A7D1E68, "scr_health_debug" }, - { 0x6249656E, "scr_heli_armor" }, - { 0xE2B966D4, "scr_heli_armor_bulletdamage" }, - { 0xC6B2F352, "scr_heli_armored_maxhealth" }, - { 0x3D5BBF4C, "scr_heli_attract_range" }, - { 0x186C896E, "scr_heli_attract_strength" }, - { 0x62785FF4, "scr_heli_debug" }, - { 0x7C5F43A4, "scr_heli_debug_crash" }, - { 0xC0CA41D1, "scr_heli_dest_wait" }, - { 0x2CF8CBA6, "scr_heli_guard_debug" }, - { 0xC2866782, "scr_heli_guard_no_timeout" }, - { 0x281134C6, "scr_heli_guard_timeout" }, - { 0xB396CECE, "scr_heli_health_degrade" }, - { 0x621E506D, "scr_heli_loopmax" }, - { 0x8D68E269, "scr_heli_maxhealth" }, - { 0xC54F1A5A, "scr_heli_missile_friendlycare" }, - { 0xD8ED3F08, "scr_heli_missile_max" }, - { 0xC9937EAF, "scr_heli_missile_range" }, - { 0x1DD06B01, "scr_heli_missile_regen_time" }, - { 0x7A5CFC47, "scr_heli_missile_reload_time" }, - { 0xD8ED5609, "scr_heli_missile_rof" }, - { 0x26FA658D, "scr_heli_missile_target_cone" }, - { 0x752B7B9C, "scr_heli_missile_valid_target_cone" }, - { 0x7F88878D, "scr_heli_protect_pos_time" }, - { 0xE8F66195, "scr_heli_protect_radius" }, - { 0x5B31A6BC, "scr_heli_protect_time" }, - { 0x83687D34, "scr_heli_target_recognition" }, - { 0x488F0063, "scr_heli_target_spawnprotection" }, - { 0xDF26D040, "scr_heli_targeting_delay" }, - { 0x2CE7C256, "scr_heli_turretClipSize" }, - { 0x6089DAF9, "scr_heli_turretReloadTime" }, - { 0xCC3095FB, "scr_heli_turret_angle_tan" }, - { 0x0D444BDF, "scr_heli_turret_spinup_delay" }, - { 0xDF9746BD, "scr_heli_turret_target_cone" }, - { 0x2960222D, "scr_heli_visual_range" }, - { 0x3D82DFAD, "scr_heli_warning_distance" }, - { 0xA0E858EE, "scr_helicopterTurretMaxAngle" }, - { 0xF4485188, "scr_help_dist" }, - { 0x1F8C9394, "scr_hostmigrationtest" }, - { 0x1CC516F5, "scr_hydro_water_rush" }, - { 0x45A06390, "scr_killbots" }, - { 0x1F9534FE, "scr_killbottimer" }, - { 0x1961F5E9, "scr_killcam" }, - { 0xE449EBB3, "scr_lbguard_timeout" }, - { 0xA0F97FC5, "scr_mapsize" }, - { 0xD16D59FD, "scr_max_rank" }, - { 0x4EBE2CF2, "scr_min_prestige" }, - { 0x6B3B5DAF, "scr_minimap_height" }, - { 0xA8BC3161, "scr_missileDudDeleteDelay" }, - { 0x0BC0001B, "scr_missile_swarm_cam" }, - { 0x4FEEA279, "scr_missile_swarm_lifetime" }, - { 0x72EC4620, "scr_motd" }, - { 0xA879D65F, "scr_numLives" }, - { 0x875C8507, "scr_obj" }, - { 0x38F47B13, "scr_oldschool" }, - { 0x2DB97368, "scr_player_allowrevive" }, - { 0xA990D882, "scr_player_ammo" }, - { 0xEC01172A, "scr_player_momentum" }, - { 0x4E90EDE7, "scr_player_sprinttime" }, - { 0xB3003261, "scr_player_zero_ammo" }, - { 0x6A09CB73, "scr_playerwarp" }, - { 0xD2451F63, "scr_popupchallenge" }, - { 0x3437A4DA, "scr_popupcontractfail" }, - { 0x343D21F5, "scr_popupcontractpass" }, - { 0xBAC602EA, "scr_popupgun" }, - { 0x84B614C3, "scr_popupmedal" }, - { 0x138C13AC, "scr_popuprank" }, - { 0x9CAAE1C4, "scr_pregame_abort" }, - { 0xB1153665, "scr_proximityGrenadeMaxInstances" }, - { 0x0E9EC149, "scr_qrdrone_no_timeout" }, - { 0x855FF558, "scr_rampagebonusscale" }, - { 0x6032F3B4, "scr_rankXpCap" }, - { 0x08660C30, "scr_rcbomb_car_size" }, - { 0xB2F33084, "scr_rcbomb_notimeout" }, - { 0x96EBB72E, "scr_recordspawndata" }, - { 0xF9AB897A, "scr_remote_mortar_lifetime" }, - { 0x6C3088CA, "scr_round_end" }, - { 0x3B362771, "scr_round_pause" }, - { 0x469616C5, "scr_scorestreaks" }, - { 0x181EB11E, "scr_scorestreaks_maxstacking" }, - { 0x84C6D64D, "scr_script_based_influencer_system" }, - { 0x41CA5EC2, "scr_selecting_location" }, - { 0x36B7604F, "scr_set_level" }, - { 0xF8E39F40, "scr_show_hq_spawns" }, - { 0xBB4CAD78, "scr_showperksonspawn" }, - { 0xE0FC7E63, "scr_showspawnid" }, - { 0x16553A29, "scr_showspawns" }, - { 0x472D7677, "scr_showstartspawns" }, - { 0x55AE206D, "scr_sideBetTimer" }, - { 0x32A4AA9D, "scr_spawn_aitank_influencer_radius" }, - { 0xEA566E11, "scr_spawn_aitank_influencer_score" }, - { 0x5A6AA155, "scr_spawn_aitank_influencer_score_curve" }, - { 0x70D13C3D, "scr_spawn_artillery_influencer_radius" }, - { 0xA6674BB1, "scr_spawn_artillery_influencer_score" }, - { 0x055336F5, "scr_spawn_artillery_influencer_score_curve" }, - { 0xD2C811B8, "scr_spawn_auto_turret_influencer_close_radius" }, - { 0x5BCBDDCC, "scr_spawn_auto_turret_influencer_close_score" }, - { 0x0AC1B150, "scr_spawn_auto_turret_influencer_close_score_curve" }, - { 0x2277A463, "scr_spawn_auto_turret_influencer_radius" }, - { 0x3F2E4717, "scr_spawn_auto_turret_influencer_score" }, - { 0x9FDEA6DB, "scr_spawn_auto_turret_influencer_score_curve" }, - { 0x9D27D281, "scr_spawn_claymore_influencer_radius" }, - { 0x33622975, "scr_spawn_claymore_influencer_score" }, - { 0xDBD657B9, "scr_spawn_claymore_influencer_score_curve" }, - { 0xC1950ECF, "scr_spawn_ctf_dropped_influencer_radius" }, - { 0x89D21403, "scr_spawn_ctf_dropped_influencer_score" }, - { 0x77DB74C7, "scr_spawn_ctf_dropped_influencer_score_curve" }, - { 0xCE7F4C59, "scr_spawn_ctf_enemy_base_influencer_radius" }, - { 0xC845C84D, "scr_spawn_ctf_enemy_base_influencer_score" }, - { 0xB39BB891, "scr_spawn_ctf_enemy_base_influencer_score_curve" }, - { 0xD43685E6, "scr_spawn_ctf_enemy_carrier_influencer_radius" }, - { 0x1605843A, "scr_spawn_ctf_enemy_carrier_influencer_score" }, - { 0x22A5F23E, "scr_spawn_ctf_enemy_carrier_influencer_score_curve" }, - { 0x730E18B8, "scr_spawn_ctf_friendly_base_influencer_radius" }, - { 0x77ED04CC, "scr_spawn_ctf_friendly_base_influencer_score" }, - { 0x1AE41850, "scr_spawn_ctf_friendly_base_influencer_score_curve" }, - { 0x4615E9E5, "scr_spawn_ctf_friendly_carrier_influencer_radius" }, - { 0x1978E459, "scr_spawn_ctf_friendly_carrier_influencer_score" }, - { 0xD96EAD9D, "scr_spawn_ctf_friendly_carrier_influencer_score_curve" }, - { 0x7D9CD88B, "scr_spawn_dead_friend_influencer_count" }, - { 0x532E8D2A, "scr_spawn_dead_friend_influencer_radius" }, - { 0x7EB7B2FE, "scr_spawn_dead_friend_influencer_score" }, - { 0xAF592402, "scr_spawn_dead_friend_influencer_score_curve" }, - { 0x4DAE2717, "scr_spawn_dead_friend_influencer_timeout_seconds" }, - { 0x67876952, "scr_spawn_dem_enemy_base_influencer_radius" }, - { 0x6FD1AA26, "scr_spawn_dem_enemy_base_influencer_score" }, - { 0xC6E9D92A, "scr_spawn_dem_enemy_base_influencer_score_curve" }, - { 0xC4211E9F, "scr_spawn_dog_influencer_radius" }, - { 0xC03369D3, "scr_spawn_dog_influencer_score" }, - { 0xD479E697, "scr_spawn_dog_influencer_score_curve" }, - { 0x21B805BB, "scr_spawn_dom_enemy_flag_A_influencer_radius" }, - { 0x8CBBDD6F, "scr_spawn_dom_enemy_flag_A_influencer_score" }, - { 0xD2926BFC, "scr_spawn_dom_enemy_flag_B_influencer_radius" }, - { 0x7AD1FF90, "scr_spawn_dom_enemy_flag_B_influencer_score" }, - { 0x836CD23D, "scr_spawn_dom_enemy_flag_C_influencer_radius" }, - { 0x68E821B1, "scr_spawn_dom_enemy_flag_C_influencer_score" }, - { 0xD49B2413, "scr_spawn_dom_enemy_flag_influencer_score_curve" }, - { 0xC68B703A, "scr_spawn_dom_owned_flag_A_influencer_radius" }, - { 0x997C740E, "scr_spawn_dom_owned_flag_A_influencer_score" }, - { 0x7765D67B, "scr_spawn_dom_owned_flag_B_influencer_radius" }, - { 0x8792962F, "scr_spawn_dom_owned_flag_B_influencer_score" }, - { 0x28403CBC, "scr_spawn_dom_owned_flag_C_influencer_radius" }, - { 0x75A8B850, "scr_spawn_dom_owned_flag_C_influencer_score" }, - { 0xE6F3F232, "scr_spawn_dom_owned_flag_influencer_score_curve" }, - { 0x61B4001D, "scr_spawn_dom_unowned_flag_influencer_radius" }, - { 0x22111391, "scr_spawn_dom_unowned_flag_influencer_score" }, - { 0xBBEB66D5, "scr_spawn_dom_unowned_flag_influencer_score_curve" }, - { 0x6983B543, "scr_spawn_enemy_influencer_radius" }, - { 0x1A8BBBF7, "scr_spawn_enemy_influencer_score" }, - { 0x8B7843BB, "scr_spawn_enemy_influencer_score_curve" }, - { 0x94B66574, "scr_spawn_enemy_spawned_influencer_radius" }, - { 0x3320AA08, "scr_spawn_enemy_spawned_influencer_score" }, - { 0x8425BA8C, "scr_spawn_enemy_spawned_influencer_score_curve" }, - { 0x4C96F2A1, "scr_spawn_enemy_spawned_influencer_timeout_seconds" }, - { 0x2778D919, "scr_spawn_enemyavoiddist" }, - { 0x1517800D, "scr_spawn_enemyavoidweight" }, - { 0x0BD11226, "scr_spawn_force_unified" }, - { 0xC54475E4, "scr_spawn_friend_weak_influencer_radius" }, - { 0xA8F66C78, "scr_spawn_friend_weak_influencer_score" }, - { 0x953F90FC, "scr_spawn_friend_weak_influencer_score_curve" }, - { 0xE627E85B, "scr_spawn_grenade_endpoint_influencer_radius" }, - { 0x7B69EC0F, "scr_spawn_grenade_endpoint_influencer_score" }, - { 0xBDB025D3, "scr_spawn_grenade_endpoint_influencer_score_curve" }, - { 0xAD51D75B, "scr_spawn_grenade_influencer_radius" }, - { 0xFD91FB0F, "scr_spawn_grenade_influencer_score" }, - { 0xE76774D3, "scr_spawn_grenade_influencer_score_curve" }, - { 0xB5B47D0E, "scr_spawn_helicopter_influencer_length" }, - { 0xC3659BB4, "scr_spawn_helicopter_influencer_radius" }, - { 0x91A21848, "scr_spawn_helicopter_influencer_score" }, - { 0xC410D8CC, "scr_spawn_helicopter_influencer_score_curve" }, - { 0x2094EB22, "scr_spawn_hq_initial_spawns_influencer_radius" }, - { 0xF94E31F6, "scr_spawn_hq_initial_spawns_influencer_score" }, - { 0xFEC0FCFA, "scr_spawn_hq_initial_spawns_influencer_score_curve" }, - { 0x95AB0AD3, "scr_spawn_hq_objective_influencer_inner_radius" }, - { 0xED569F87, "scr_spawn_hq_objective_influencer_inner_score" }, - { 0xF7F772CC, "scr_spawn_hq_objective_influencer_score" }, - { 0x80890650, "scr_spawn_hq_objective_influencer_score_curve" }, - { 0x0D5441FF, "scr_spawn_koth_initial_spawns_influencer_radius" }, - { 0x93DFA133, "scr_spawn_koth_initial_spawns_influencer_score" }, - { 0x5A0A25F7, "scr_spawn_koth_initial_spawns_influencer_score_curve" }, - { 0x4CAF9F75, "scr_spawn_koth_objective_influencer_radius" }, - { 0x11EA27E9, "scr_spawn_koth_objective_influencer_score" }, - { 0x6D485D2D, "scr_spawn_koth_objective_influencer_score_curve" }, - { 0x7188033E, "scr_spawn_napalm_influencer_radius" }, - { 0xB5F0B692, "scr_spawn_napalm_influencer_score" }, - { 0x1CB38696, "scr_spawn_napalm_influencer_score_curve" }, - { 0x44DFDDDC, "scr_spawn_objective_facing_bonus" }, - { 0xE372755D, "scr_spawn_pegasus_influencer_radius" }, - { 0xFF35E0D1, "scr_spawn_pegasus_influencer_score" }, - { 0x85452415, "scr_spawn_pegasus_influencer_score_curve" }, - { 0x24A61F21, "scr_spawn_point_test_mode" }, - { 0x09200D73, "scr_spawn_qrdrone_cylinder_influencer_length" }, - { 0x16D12C19, "scr_spawn_qrdrone_cylinder_influencer_radius" }, - { 0xD9FAB00D, "scr_spawn_qrdrone_cylinder_influencer_score" }, - { 0xC4CF7051, "scr_spawn_qrdrone_cylinder_influencer_score_curve" }, - { 0xD0FE2400, "scr_spawn_qrdrone_influencer_radius" }, - { 0xF6E4C714, "scr_spawn_qrdrone_influencer_score" }, - { 0xFF867098, "scr_spawn_qrdrone_influencer_score_curve" }, - { 0x6486379A, "scr_spawn_randomly" }, - { 0xE3E17B1A, "scr_spawn_randomness_range" }, - { 0x99A7841A, "scr_spawn_rcbomb_influencer_radius" }, - { 0xED758BEE, "scr_spawn_rcbomb_influencer_score" }, - { 0xC5B1F0F2, "scr_spawn_rcbomb_influencer_score_curve" }, - { 0x9E85FAFC, "scr_spawn_showbad" }, - { 0x2363973F, "scr_spawn_tvmissile_influencer_length" }, - { 0x3114B5E5, "scr_spawn_tvmissile_influencer_radius" }, - { 0xF9CE3059, "scr_spawn_tvmissile_influencer_score" }, - { 0x2F8CF99D, "scr_spawn_tvmissile_influencer_score_curve" }, - { 0x367873A1, "scr_spawn_vehicle_influencer_lead_seconds" }, - { 0xD46C6C99, "scr_spawn_vehicle_influencer_score" }, - { 0xED7765DD, "scr_spawn_vehicle_influencer_score_curve" }, - { 0xA1755E55, "scr_spawnenemyheli" }, - { 0x23E1517A, "scr_spawnenemyu2" }, - { 0x4058B332, "scr_spawnidcycle" }, - { 0x632110E6, "scr_spawnpointdebug" }, - { 0x7CA769A6, "scr_spawnprofile" }, - { 0x292A749F, "scr_spawnsimple" }, - { 0x66A189BB, "scr_sun_fog_color" }, - { 0xFA1301D9, "scr_sun_fog_end_angle" }, - { 0xECC36390, "scr_sun_fog_start_angle" }, - { 0x38F6C211, "scr_supply_drop_gui" }, - { 0xBB77CC24, "scr_switch_team" }, - { 0x12AE1013, "scr_takeoff_rocket" }, - { 0x2952A7C3, "scr_takeperk" }, - { 0xA651B120, "scr_team_fftype" }, - { 0xA77CF4BC, "scr_team_teamkillerplaylistbanpenalty" }, - { 0x18E5C00A, "scr_team_teamkillerplaylistbanquantum" }, - { 0x81F89399, "scr_teambalance" }, - { 0xB95CDBBC, "scr_teamslideout" }, - { 0x316B7BEF, "scr_testScriptRuntimeError" }, - { 0x8EF43DBE, "scr_testclients" }, - { 0xC97483EC, "scr_testclientsremove" }, - { 0x70EE00F9, "scr_testdvar" }, - { 0x3478842E, "scr_timeplayedcap" }, - { 0xD3B62F34, "scr_turret_no_timeout" }, - { 0x31F91106, "scr_usedogs" }, - { 0xB7538EFB, "scr_veh_alive_cleanuptimemax" }, - { 0xB7538FF9, "scr_veh_alive_cleanuptimemin" }, - { 0x8D2EFFB2, "scr_veh_cleanupabandoned" }, - { 0xAAD1512A, "scr_veh_cleanupdebugprint" }, - { 0xA7D9B018, "scr_veh_cleanupdrifted" }, - { 0x69770092, "scr_veh_cleanupmaxspeedmph" }, - { 0x098C9729, "scr_veh_cleanupmindistancefeet" }, - { 0xED378BD8, "scr_veh_cleanuptime_dmgfactor_deadtread" }, - { 0xD92137A0, "scr_veh_cleanuptime_dmgfactor_max" }, - { 0xD921389E, "scr_veh_cleanuptime_dmgfactor_min" }, - { 0xEF99099A, "scr_veh_cleanuptime_dmgfraction_curve_begin" }, - { 0x7CCFC4CC, "scr_veh_cleanuptime_dmgfraction_curve_end" }, - { 0x6C2FBBF8, "scr_veh_dead_cleanuptimemax" }, - { 0x6C2FBCF6, "scr_veh_dead_cleanuptimemin" }, - { 0x63AF17E6, "scr_veh_disableoverturndamage" }, - { 0x4AAF6102, "scr_veh_disablerespawn" }, - { 0xEB58349F, "scr_veh_disappear_maxpreventdistancefeet" }, - { 0xF3A863DC, "scr_veh_disappear_maxpreventvisibilityfeet" }, - { 0x33313A70, "scr_veh_disappear_maxwaittime" }, - { 0x8AB44691, "scr_veh_driversarehidden" }, - { 0x027D6F6C, "scr_veh_driversareinvulnerable" }, - { 0xA0CE2AC2, "scr_veh_explode_on_cleanup" }, - { 0x1A397FE8, "scr_veh_explosion_doradiusdamage" }, - { 0xF0E3D76A, "scr_veh_explosion_husk_forcepointvariance" }, - { 0xF7AEC6C3, "scr_veh_explosion_husk_horzvelocityvariance" }, - { 0xB8C043DE, "scr_veh_explosion_husk_vertvelocitymax" }, - { 0xB8C044DC, "scr_veh_explosion_husk_vertvelocitymin" }, - { 0xDDBCFBD3, "scr_veh_explosion_maxdamage" }, - { 0x3E054351, "scr_veh_explosion_mindamage" }, - { 0x2CC23AB6, "scr_veh_explosion_radius" }, - { 0x34D27475, "scr_veh_explosion_spawnfx" }, - { 0x20DC0967, "scr_veh_health_jeep" }, - { 0x20E17551, "scr_veh_health_tank" }, - { 0x16B521FF, "scr_veh_ondeath_createhusk" }, - { 0xA770BB2C, "scr_veh_ondeath_usevehicleashusk" }, - { 0xA85448C3, "scr_veh_respawnafterhuskcleanup" }, - { 0x099A7783, "scr_veh_respawntimemax" }, - { 0x099A7881, "scr_veh_respawntimemin" }, - { 0xB75883F5, "scr_veh_respawnwait_iterationwaitseconds" }, - { 0xC775AA8A, "scr_veh_respawnwait_maxiterations" }, - { 0x49F6FDB6, "scr_veh_waittillstoppedandmindist_maxtime" }, - { 0xDC2C41B5, "scr_veh_waittillstoppedandmindist_maxtimeenabledistfeet" }, - { 0x23853F1F, "scr_vehicle_damage_scalar" }, - { 0xE4C48E3D, "scr_wagerBet" }, - { 0x7D5E2D7C, "scr_wagerPool" }, - { 0xD9B598A2, "scr_wagerSideBet" }, - { 0x7D604436, "scr_wagerTier" }, - { 0x37DA5242, "scr_wager_defaultScore" }, - { 0x09190F6B, "scr_wager_firstPayout" }, - { 0x09D31C56, "scr_wager_firstPlayer" }, - { 0x809E429F, "scr_wager_secondPayout" }, - { 0x81584F8A, "scr_wager_secondPlayer" }, - { 0x7BDACDDE, "scr_wager_thirdPayout" }, - { 0x7C94DAC9, "scr_wager_thirdPlayer" }, - { 0x7B0C173C, "scr_weapon_allowbetty" }, - { 0x8D41C02B, "scr_weapon_allowc4" }, - { 0x7B57FEE2, "scr_weapon_allowflash" }, - { 0x7B5B47A7, "scr_weapon_allowfrags" }, - { 0x7BD53AD0, "scr_weapon_allowmines" }, - { 0xE4BBBD90, "scr_weapon_allowrpgs" }, - { 0x81AEAF38, "scr_weapon_allowsatchel" }, - { 0x7C440453, "scr_weapon_allowsmoke" }, - { 0xD65C9A98, "scr_weaponobject_coneangle" }, - { 0x38868733, "scr_weaponobject_debug" }, - { 0x771D3F71, "scr_weaponobject_graceperiod" }, - { 0x3335D0A4, "scr_weaponobject_mindist" }, - { 0x69B82C54, "scr_weaponobject_radius" }, - { 0x7AEF62D7, "scr_writeConfigStrings" }, - { 0x5625D4BA, "scr_x_kills_y" }, - { 0x12E4DD1C, "scr_xpscale" }, - { 0x92FC9AA3, "scr_xpzmscale" }, - { 0xB0FB65D0, "scr_zm_enable_bots" }, - { 0xD3E0C36D, "sd_can_switch_device" }, - { 0xDF2D597D, "sd_xa2_device_guid" }, - { 0xDF30DB95, "sd_xa2_device_name" }, - { 0x511E7257, "sd_xa2_num_devices" }, - { 0x442C2675, "searchSessionDedicatedGeoMin" }, - { 0x8EDE412A, "searchSessionDedicatedMaxPing" }, - { 0xD00E4013, "searchSessionGeo1Weight" }, - { 0x1D087CD4, "searchSessionGeo2Weight" }, - { 0x6A02B995, "searchSessionGeo3Weight" }, - { 0xB6FCF656, "searchSessionGeo4Weight" }, - { 0xD334DA3E, "searchSessionGeoMin" }, - { 0xC0D1F8B3, "searchSessionIgnoreMapPacks" }, - { 0xF3B7FE4A, "searchSessionIsEmpty" }, - { 0xE887AEC9, "searchSessionMapPackFlags" }, - { 0xD8074419, "searchSessionMaxIntervalTime" }, - { 0x3F39397D, "searchSessionMaxIntervalTimeBeforeUnpark" }, - { 0x875FE0E0, "searchSessionNextTaskDelay" }, - { 0x63CAE1AF, "searchSessionRandom_0" }, - { 0x63CAE1B0, "searchSessionRandom_1" }, - { 0xBDA48286, "searchSessionSkillWeight" }, - { 0xB7B193BE, "selectedFriendIndex" }, - { 0xE68BCA47, "selectedFriendName" }, - { 0x48C9FC53, "selectedGroupIndex" }, - { 0x3CEBBBEA, "selectedMenuItemIndex" }, - { 0xE18DA155, "selectedPlayerXuid" }, - { 0x442D8970, "sensitivity" }, - { 0xF50F3E57, "sessionSearchMaxAttempts" }, - { 0xF1798E1F, "sessionTaskFailDebug" }, - { 0x074599BC, "session_nonblocking" }, - { 0xB937350C, "shieldBlastDamageProtection_120" }, - { 0xB93735D2, "shieldBlastDamageProtection_180" }, - { 0x6A76099C, "shieldBlastDamageProtection_30" }, - { 0x6A7609FF, "shieldBlastDamageProtection_60" }, - { 0xE753123D, "shieldDeployShakeDuration" }, - { 0xB3ADE5FF, "shieldDeployShakeScale" }, - { 0xD527A516, "shieldImpactBulletShakeDuration" }, - { 0x92C2BF78, "shieldImpactBulletShakeScale" }, - { 0xE9C64C2F, "shieldImpactExplosionHighShakeDuration" }, - { 0x15801531, "shieldImpactExplosionHighShakeScale" }, - { 0x15A9E841, "shieldImpactExplosionLowShakeDuration" }, - { 0x7330DA83, "shieldImpactExplosionLowShakeScale" }, - { 0x89E2526A, "shieldImpactExplosionThreshold" }, - { 0xC8F3B7A4, "shieldImpactMissileShakeDuration" }, - { 0xF81F2CC6, "shieldImpactMissileShakeScale" }, - { 0x3C7C8479, "shieldPlayerBulletProtectionDegrees" }, - { 0xA0B3DE1B, "shortversion" }, - { 0xE51B23E3, "shoutcastHighlightedClient" }, - { 0x3DD517CB, "shoutcastSelectedClient" }, - { 0x6A2BE3DD, "showVisionSetDebugInfo" }, - { 0x77ADBB5B, "sidebet_made" }, - { 0xD0E5DEBB, "skill_scoreBeta" }, - { 0xEEC0F44C, "skill_scoreRange" }, - { 0x73487FA6, "skill_teamBeta" }, - { 0xDD77B297, "skill_teamRange" }, - { 0x627DEC6B, "sm_enable" }, - { 0x1AC3422E, "sm_fastSunShadow" }, - { 0xD52875D5, "sm_maxLights" }, - { 0xBBE14732, "sm_polygonOffsetBias" }, - { 0x393A833B, "sm_polygonOffsetScale" }, - { 0x766885B1, "sm_spotEnable" }, - { 0xEF8DA2B3, "sm_spotQuality" }, - { 0x75BE6E0F, "sm_spotShadowFadeTime" }, - { 0x1C141D6B, "sm_spotShadowLargeRadiusScale" }, - { 0xBA22D76D, "sm_strictCull" }, - { 0xAA14AFEF, "sm_sunAlwaysCastsShadow" }, - { 0xF3745721, "sm_sunEnable" }, - { 0x0E13A223, "sm_sunQuality" }, - { 0x1A3C7D9D, "sm_sunSampleSizeNear" }, - { 0x44259BA1, "sm_sunShadowCenter" }, - { 0x9E57A848, "sm_sunShadowScale" }, - { 0x9E5D2419, "sm_sunShadowSmall" }, - { 0xD8AE81C0, "sm_sunShadowSmallEnable" }, - { 0x01D23A8B, "snd_autoSim" }, - { 0x61A81562, "snd_autosim_window" }, - { 0xCDEA72FF, "snd_boat_current_rpm" }, - { 0x179B7ABE, "snd_boat_engine_off" }, - { 0xC23A924F, "snd_boat_lerp_rpm" }, - { 0x2545C36A, "snd_boat_pitch_high_max" }, - { 0x2545C468, "snd_boat_pitch_high_min" }, - { 0x9C17EA28, "snd_boat_pitch_idle_max" }, - { 0x9C17EB26, "snd_boat_pitch_idle_min" }, - { 0xC044E63C, "snd_boat_pitch_low_max" }, - { 0xC044E73A, "snd_boat_pitch_low_min" }, - { 0xF493BB20, "snd_boat_pitch_med_max" }, - { 0xF493BC1E, "snd_boat_pitch_med_min" }, - { 0x195E1E2E, "snd_boat_rpm_high_fin_end" }, - { 0x9D0E8A89, "snd_boat_rpm_high_start" }, - { 0xB2343110, "snd_boat_rpm_idle_end" }, - { 0xFDD66904, "snd_boat_rpm_idle_fout_start" }, - { 0xD8361E44, "snd_boat_rpm_low_end" }, - { 0x691EDB20, "snd_boat_rpm_low_fin_end" }, - { 0x282AF3B8, "snd_boat_rpm_low_fout_start" }, - { 0xBF3762FB, "snd_boat_rpm_low_start" }, - { 0x0C84F328, "snd_boat_rpm_med_end" }, - { 0x20D58204, "snd_boat_rpm_med_fin_end" }, - { 0xA7A4E01C, "snd_boat_rpm_med_fout_start" }, - { 0x428F00DF, "snd_boat_rpm_med_start" }, - { 0xC868FEB2, "snd_boat_rpm_scalar" }, - { 0x9B1172B4, "snd_boat_using_lerp_rpm" }, - { 0x58B39F61, "snd_boat_water_fast_min" }, - { 0xF3044753, "snd_boat_water_idle_max" }, - { 0x840065AD, "snd_boat_water_pitch_max" }, - { 0x9DADB11A, "snd_boat_water_slow_max" }, - { 0x9DADB218, "snd_boat_water_slow_min" }, - { 0xE0034D4E, "snd_draw3D" }, - { 0xEE29AD63, "snd_drawInfo" }, - { 0xEE2F2EFF, "snd_drawSort" }, - { 0xA100EC92, "snd_futz" }, - { 0x69E7605C, "snd_jetgun_loop_start" }, - { 0xF4959003, "snd_jetgun_pitch_end" }, - { 0x713A407A, "snd_jetgun_pitch_start" }, - { 0xEEF7E8A6, "snd_losOcclusion" }, - { 0xDED49143, "snd_max_ram_voice" }, - { 0x82A08E2F, "snd_max_stream_voice" }, - { 0xB5FE1126, "snd_minigun_loop_start" }, - { 0xB8D44F8D, "snd_minigun_pitch_end" }, - { 0x40270A84, "snd_minigun_pitch_start" }, - { 0x7D7035D6, "snd_ps3_vol_occlusion_attenuation_dry" }, - { 0x7D7084F7, "snd_ps3_vol_occlusion_attenuation_wet" }, - { 0xAF00532C, "snd_speakerConfiguration" }, - { 0xA63612C6, "snd_throttle_reduce_vol" }, - { 0xF6620000, "snd_throttle_time_held_down" }, - { 0xED9B95E3, "snd_trace_master" }, - { 0xF98F29FD, "snd_trace_reverb" }, - { 0x9380886D, "snd_trace_voice" }, - { 0x23594A7E, "spawnsystem_allow_culling" }, - { 0x962F067C, "spawnsystem_allow_non_team_spawns" }, - { 0x3CB0EBA1, "spawnsystem_badspawn_aggression_delay" }, - { 0x8740906E, "spawnsystem_badspawn_damage_delay" }, - { 0xB768E8AE, "spawnsystem_badspawn_force_record" }, - { 0x3DD40F51, "spawnsystem_danger_time" }, - { 0xCACE8639, "spawnsystem_debug" }, - { 0xB40F1B1A, "spawnsystem_debug_archive" }, - { 0xAAD69222, "spawnsystem_debug_best_points" }, - { 0x030681EB, "spawnsystem_debug_influencer_pulse" }, - { 0x035124B7, "spawnsystem_debug_influencer_types" }, - { 0xAC212D56, "spawnsystem_debug_influencers" }, - { 0xD413BE8E, "spawnsystem_debug_liveedit" }, - { 0x851C1585, "spawnsystem_debug_player" }, - { 0xE98AFCFC, "spawnsystem_debug_point_weights" }, - { 0x85569535, "spawnsystem_debug_points" }, - { 0xAF17956B, "spawnsystem_debug_showclients" }, - { 0xCE19E6D8, "spawnsystem_debug_sideswitched" }, - { 0xDAC0C03F, "spawnsystem_debug_team" }, - { 0xB8E74020, "spawnsystem_debug_visibility" }, - { 0xFD0CD50E, "spawnsystem_debug_visibility_time" }, - { 0x4875FFD0, "spawnsystem_demo_enable_parsing" }, - { 0x903501C8, "spawnsystem_demo_max_written" }, - { 0x79FF75AD, "spawnsystem_enemy_influencer_stacking" }, - { 0xE355341E, "spawnsystem_enemy_spawned_influencer_stacking" }, - { 0xB8053DC7, "spawnsystem_friend_influencer_stacking" }, - { 0x2A39BDED, "spawnsystem_old_vis_mask" }, - { 0x9B16B75C, "spawnsystem_score_cull_min_points" }, - { 0xC17771CD, "spawnsystem_score_cull_percent" }, - { 0xC9CD0750, "spawnsystem_score_cull_time_max" }, - { 0xC9CD084E, "spawnsystem_score_cull_time_min" }, - { 0x8AFE7F9D, "spawnsystem_sight_check_max_distance" }, - { 0xD3530F8F, "spawnsystem_sight_height_offset" }, - { 0xBE5CA5AA, "spawnsystem_weapon_influencer_min_length" }, - { 0x3DFB7EC5, "spawnsystem_weapon_influencer_push_through" }, - { 0x22133061, "spawnsystem_weapon_influencer_sight_check" }, - { 0x0E697DCC, "spawnsystem_weapon_influencer_update_interval" }, - { 0x99132F31, "splitscreen" }, - { 0xD45F3B5E, "splitscreen_lobbyPlayerCount" }, - { 0x5FFE1776, "splitscreen_partyPlayerCount" }, - { 0xE6FF85E6, "splitscreen_playerCount" }, - { 0x477105CD, "splitscreen_playerNum" }, - { 0x1C48A84D, "spmode" }, - { 0x300AD8E6, "stat_version" }, - { 0x000EDFD5, "statsLocationFatal" }, - { 0x540EF316, "stats_version_check" }, - { 0xC1FA099C, "stopspeed" }, - { 0xA197286D, "storeMapPackMaskToStats" }, - { 0x7DDC1B7F, "sv_FFCheckSums" }, - { 0x05D7216D, "sv_FFNames" }, - { 0xB21396CF, "sv_FakeRemoteClient" }, - { 0xACABA59A, "sv_allowAimAssist" }, - { 0x02A5BA35, "sv_allowAnonymous" }, - { 0xEDA81065, "sv_allowDof" }, - { 0x500363B1, "sv_assistWorkers" }, - { 0xF0F8D0A5, "sv_authenticating" }, - { 0xAB0EF6CA, "sv_badLoadoutAction" }, - { 0x0A7DE6FE, "sv_badRankAction" }, - { 0x2592DAA3, "sv_bitfieldTracking" }, - { 0xABB9B265, "sv_cheats" }, - { 0x27323074, "sv_clientFpsLimit" }, - { 0xA4DCD66C, "sv_clientSideBullets" }, - { 0xDC6C5144, "sv_clientSideVehicles" }, - { 0x259C67B1, "sv_clientside" }, - { 0xE1EED5FE, "sv_connectTimeout" }, - { 0x6852EE80, "sv_connectionLogProbability" }, - { 0x42C6E4B7, "sv_connectionLogSamplesPerSecond" }, - { 0x6F794DD3, "sv_disableClientConsole" }, - { 0x1410B478, "sv_dwlsgerror" }, - { 0xC45E58C3, "sv_enableBounces" }, - { 0xC8DB9DCC, "sv_endGameIfISuck" }, - { 0xA2A8EFB9, "sv_expensive_bullet_time" }, - { 0x208A1E8C, "sv_externalEventLoop" }, - { 0xD367D3FB, "sv_fakeServerLoad" }, - { 0x2B1787E0, "sv_fakeServerLoadRand" }, - { 0xC5EFFAC2, "sv_floodprotect" }, - { 0x59EA1BF4, "sv_forceunranked" }, - { 0x5B0D334C, "sv_hostname" }, - { 0x8BB00AE5, "sv_iwdNames" }, - { 0xB25C5584, "sv_iwds" }, - { 0x2C426345, "sv_keywords" }, - { 0x5CCDBF3B, "sv_mapRotation" }, - { 0xC32D27FE, "sv_mapRotationCurrent" }, - { 0x27BE48D2, "sv_maxPhysExplosionSpheres" }, - { 0x15C21E61, "sv_maxPing" }, - { 0x851B42E5, "sv_maxclients" }, - { 0x27B66E5F, "sv_minPing" }, - { 0x755EF890, "sv_momentumPercent" }, - { 0x15341B00, "sv_networkRateSolution" }, - { 0x5D8EB89F, "sv_network_fps" }, - { 0xC5E60B4B, "sv_noname" }, - { 0xB960A666, "sv_onlineHostSnapshotRateThrottled" }, - { 0xC99727AF, "sv_paused" }, - { 0xBF2D1F2E, "sv_playlistFetchInterval" }, - { 0xC6CA84DA, "sv_privateClients" }, - { 0xC5857133, "sv_privateClientsForClients" }, - { 0x69081AFB, "sv_privatePassword" }, - { 0xB2602569, "sv_pure" }, - { 0x597F84CC, "sv_rateBoostingAllowUnackDeltas" }, - { 0x040BB9F6, "sv_rateBoostingDebugForceSuspend" }, - { 0x76BE2F89, "sv_rateBoostingEnabled" }, - { 0xDB3BB67E, "sv_rateBoostingMaxUploadUsage" }, - { 0x6C85664F, "sv_rateBoostingMinUploadScale" }, - { 0x8E98B743, "sv_rateBoostingRecoverTime" }, - { 0xE435F8AD, "sv_rateBoostingSuspendBadFramesCPU" }, - { 0x6616C07A, "sv_rateBoostingSuspendBadFramesCPUThreshold" }, - { 0xC38ABE74, "sv_rateBoostingSuspendBadFramesCPUTimeout" }, - { 0x87494249, "sv_rateBoostingSuspendedMaxUploadUsage" }, - { 0xF6BACA8D, "sv_reconnectlimit" }, - { 0xF9608092, "sv_referencedFFCheckSums" }, - { 0x45C5F500, "sv_referencedFFNames" }, - { 0xC97950D8, "sv_referencedIwdNames" }, - { 0x768299F7, "sv_referencedIwds" }, - { 0xC9EB8E36, "sv_restrictedTempEnts" }, - { 0xC4966CEE, "sv_running" }, - { 0x53432D26, "sv_serverLogClientPings" }, - { 0x42761174, "sv_timeout" }, - { 0xFECDF523, "sv_voice" }, - { 0x1661226C, "sv_voiceQuality" }, - { 0x4960F978, "sv_writeConfigStrings" }, - { 0x9D64B4C2, "sv_zombietime" }, - { 0x260AD10E, "sys_configSum" }, - { 0x58DE470E, "sys_configureGHz" }, - { 0xB6C90254, "sys_cpuGHz" }, - { 0x8FED046C, "sys_cpuName" }, - { 0xBABFFB2F, "sys_gpu" }, - { 0x6B899E51, "sys_sysMB" }, - { 0x0BBF1FB8, "systemlink" }, - { 0x5297D838, "teamsplitter_verbose" }, - { 0x32B722EC, "terriblePing" }, - { 0xDB9886D4, "throwback_enabled" }, - { 0xAD15CC70, "tickerHeaderWidth" }, - { 0x5BFDEB7C, "timescale" }, - { 0x41121C2D, "tree_bend" }, - { 0xB90AB786, "tree_frequency" }, - { 0xF3141235, "tree_random" }, - { 0x1C57763F, "tu10_demo_oldposInsteadOfMapCenter" }, - { 0xF8CC24E9, "tu10_demo_skipBuildingDemoSnapshotDuringCinematicPlayback" }, - { 0x9FA398EC, "tu10_eliteMarketingOptInPopupEnabled" }, - { 0x246E0A60, "tu10_noProfileWriteSleep" }, - { 0xAD44CD2C, "tu10_reconnectToClientOnDTLSTimeout" }, - { 0xD95DEBFC, "tu10_searchSessionIgnoreMapPacks" }, - { 0x1F00DC1E, "tu10_statsCheckIW6promo" }, - { 0x5BD9699F, "tu10_updateLobbyMapPackFlagsOnClientJoin" }, - { 0xC3C4280D, "tu11_AddMapPackFlagsUserInfo" }, - { 0x574561EA, "tu11_cg_killstreak_target_diamond_when_emped" }, - { 0xE46013C4, "tu11_deleteSessionIfNotHost" }, - { 0xDE1190A5, "tu11_demoSendEventOnFailure" }, - { 0x71F6B9EA, "tu11_gateInGameMenusOnInitialPlayersConnectedRespondedTo" }, - { 0x0AD089CC, "tu11_handleLowmipReadErrors" }, - { 0xE506EC19, "tu11_luiCompleteAnimationFix" }, - { 0x572040AF, "tu11_partymigrate_WirelessLatencyIncrease" }, - { 0x7E163044, "tu11_partymigrate_allowPrivatePartyClientsToHost" }, - { 0xD1AB9ADE, "tu11_partymigrate_useStdDev" }, - { 0x64B6C9E9, "tu11_player_keepZVelocity" }, - { 0x8141CCF5, "tu11_resetGameModesOnCablePull" }, - { 0x067159DD, "tu11_returnChangedInUpdateClientInfoWhenRemovingAttachModel" }, - { 0xC06B792D, "tu11_sendVoteToFBEnabled" }, - { 0x662C36B7, "tu11_showGeoInfo" }, - { 0xFC5EF3DC, "tu11_statsSetConnectionType" }, - { 0x2CF97355, "tu11_useMissileKnockbackHeldWeaponsOnly" }, - { 0x6430CBB5, "tu11_use_animscripted_blends" }, - { 0xC11D15FC, "tu11_waitOnContent" }, - { 0x93FFECE3, "tu11_waitOnContentTimeout" }, - { 0xB3416C1D, "tu11_zombie_turret_placement_ignores_bodies" }, - { 0x23C59279, "tu12_always_switch_away_from_briefcase" }, - { 0x7298DE7A, "tu12_cg_vehicleCamAboveWater" }, - { 0xC8CECDC1, "tu12_destructible_entity_radius_damage_fix" }, - { 0x6F4D2CFA, "tu12_mtxLostVoteChecks" }, - { 0x03F066BE, "tu12_searchSessionOverrideGeoLocation" }, - { 0x79E55BD0, "tu12_updatePCacheOfAllLocalPlayers" }, - { 0xB146C45E, "tu12_validate_bonus_cards_on_server" }, - { 0x5A0C823E, "tu12_zm_force_center_cg_cursorhint" }, - { 0x731FEB37, "tu12_zm_stack_fire_fix" }, - { 0x2B397BB1, "tu12_zm_stop_firing_when_overheated" }, - { 0xD9DEE937, "tu12_zombie_allow_switch_to_detonator_only" }, - { 0x1F0A2129, "tu12_zombies_allow_hint_weapon_from_script" }, - { 0xED6F8D8E, "tu13_allow_no_player_melee_blood" }, - { 0x363D476E, "tu13_bg_enableBulletWeaponBounce" }, - { 0x99A2BD37, "tu13_filterdedicatedserverresults" }, - { 0xD05C478C, "tu13_recordContentAvailable" }, - { 0x5B6D0EE6, "tu13_zm_check_traversal_max_z" }, - { 0xC66CB275, "tu14_aiAllowForceNoCullCheck" }, - { 0xCBEDA0DC, "tu14_bg_chargeShotExponentialAmmoPerChargeLevel" }, - { 0x0F942F44, "tu14_demo_enableHeliHeightLockExcludeFromDemo" }, - { 0xC70C177F, "tu14_initialize_groundEntityNum" }, - { 0x99F9C902, "tu14_preventStartingChargeShotWhileFiring" }, - { 0x529E1858, "tu14_reloadCustomGameTypesAfterFFOTD" }, - { 0x311CEF9C, "tu14_resumeLobbyCountdown" }, - { 0x9756E586, "tu15_quadrotorPathingFix" }, - { 0xDF1D9C6E, "tu15_zombie_local_player_test_honors_client_server_divide" }, - { 0x6D7FE587, "tu16_waitOnGhostLBRetrieval" }, - { 0xC102720E, "tu16_waitOnGhostLBRetrievalTimeout" }, - { 0x43EC441B, "tu2_delayComErrorForPlaylistRules" }, - { 0x5FA17DEB, "tu2_luiHacksDisabled" }, - { 0x7FD62C69, "tu2_partyCheckRulesAlways" }, - { 0xB4AF1846, "tu2_partyCheckRulesOnSetup" }, - { 0x120DD899, "tu2_stopPartyForPlaylistRules" }, - { 0x62A6693E, "tu3_canSetDvars" }, - { 0xFAC387AA, "tu3_disableDWGuests" }, - { 0x0F5159FE, "tu3_resetStatsOnFailedValidate" }, - { 0xFA520861, "tu4_checkStatsCheckSum" }, - { 0x5E0E5480, "tu4_checkXUIDBeforeStatsUpload" }, - { 0x922D4C28, "tu4_copyGamertagOnStatsDownload" }, - { 0xD450E494, "tu4_removeClientsFromInactivePartyToNotify" }, - { 0x73C3068E, "tu4_removeUsingXuidClientFromPartyToNotify" }, - { 0x82ABFB69, "tu4_statsParity" }, - { 0xB0F3FB62, "tu4_useRealXUIDForStats" }, - { 0x2BE7E5DB, "tu5_check_unique_attachments_enabled" }, - { 0x386F8B2B, "tu5_uav_ads_fix" }, - { 0xB73F9A6A, "tu6_CaCImportVerifyDLCWeapons" }, - { 0xA0D067E5, "tu6_cg_destructible_radius_damage_enabled" }, - { 0xEBCB0280, "tu6_checkNonPrimaryXUIDPS3" }, - { 0x5527FA83, "tu6_clearFileShareOnSignOut" }, - { 0xAFB7475A, "tu6_conflictingAttachmentCheck" }, - { 0x7F93BBC6, "tu6_dynEnt_disable_rb_collision" }, - { 0xA321E96B, "tu6_dynEnt_small_cylinder_dimension" }, - { 0xA78DEA72, "tu6_dynEnt_small_cylinder_max_avel" }, - { 0xBA3E5E4C, "tu6_emblemVoting" }, - { 0x97A055DA, "tu6_enableDLCWeapons" }, - { 0x2A61B3BD, "tu6_execffotdlua" }, - { 0xF4F65946, "tu6_hideDLCImages" }, - { 0x23D7A354, "tu6_ignoreOtherModesDLC" }, - { 0x9A54ED27, "tu6_ignoreSeasonPass" }, - { 0xB3E588CF, "tu6_marketingOptIn" }, - { 0x7806AA54, "tu6_perkBonusCardCheck" }, - { 0xF0556873, "tu6_player_jump_blocks_tac_insert" }, - { 0x1C65C685, "tu6_player_shallowWaterHeight" }, - { 0x4A609F88, "tu6_verifyUnusedAttachmentSlotsCheck" }, - { 0x230B08DC, "tu6_writeStatsXUIDOnGameStart" }, - { 0x1DDCA0B0, "tu7_3rdPersonSpecateFix" }, - { 0xE7AEF324, "tu7_additionalGrenadeChecks" }, - { 0x460A4EF4, "tu7_botsCountAsPartyMembers" }, - { 0xA3C6CD74, "tu7_cg_deathCamAboveWater" }, - { 0x47556581, "tu7_clampMeleeChargeHorzLaunch" }, - { 0x7F77093D, "tu7_clampMeleeChargeJumping" }, - { 0xE1534BE4, "tu7_clampMeleeChargeJumpingMaxZVel" }, - { 0xE68FD88D, "tu7_fileshareRetry" }, - { 0xFA97D3A0, "tu7_fileshareShowFailure" }, - { 0x80EBAA1E, "tu7_itemOptionLocked" }, - { 0xBC8648FC, "tu7_itemOptionLockedByChallenge" }, - { 0xC1C0E83B, "tu7_itemOptionLockedByChallengeResult" }, - { 0x88271ADD, "tu7_itemOptionLockedResult" }, - { 0x027EB3EF, "tu7_mapbased_killstreaks_fix" }, - { 0x033F5A5C, "tu7_partyDoublePartyCloseFix" }, - { 0xB08EDADD, "tu7_restoreBlur" }, - { 0x0E18A546, "tu7_scoreboardPingAsNumbers" }, - { 0xD945CF3A, "tu7_setGuestStatsFetched" }, - { 0x0FE6FE05, "tu7_skipStableStats" }, - { 0xA13C6EAA, "tu7_statsCheckGroupMask" }, - { 0x872E1511, "tu7_statsCheckSeasonPass" }, - { 0x6E4C0B33, "tu7_statsErrorBackup" }, - { 0x8B4F8966, "tu7_statsErrorNormal" }, - { 0x4DCE15AC, "tu7_statsErrorOtherPlayer" }, - { 0x974A4F38, "tu7_statsErrorStable" }, - { 0x36F9810E, "tu7_ui_multiteam_compass_fix" }, - { 0x57B97AE8, "tu7_usePCmatchmaking" }, - { 0xA5847FE2, "tu7_usePingSlider" }, - { 0xC7310023, "tu7_verifyStableStats" }, - { 0xD5BB0CA8, "tu8_additionalMTXChecks" }, - { 0xEB8D9519, "tu8_autoRestartSteamServerFailed" }, - { 0x00285083, "tu8_cancelMatchStartReturnValue" }, - { 0x376064C4, "tu8_comerrorSteamServerFailed" }, - { 0xB8C8E3B5, "tu8_defaultClassSetCount" }, - { 0x7B613368, "tu8_mtx_enabled" }, - { 0x9DC360C9, "tu8_nullStatsBuffer" }, - { 0x3ED9677B, "tu8_partyDisconnectExtraPacket" }, - { 0x6B51874F, "tu8_purchasedClassSetCount" }, - { 0x9981246D, "tu8_script_mover_workaround" }, - { 0x681164DF, "tu8_storeContentInfoInStats" }, - { 0xA5CD2445, "tu8_trackStatsAccessError" }, - { 0x273AE627, "tu8_useClassSets" }, - { 0xCC76743A, "tu9_checkForValidGameMode" }, - { 0xEE832447, "tu9_clearedMapPackFlagsFix" }, - { 0x535769D5, "tu9_deletePresenceSessionInGraveYardFix" }, - { 0x50A5FE0F, "tu9_ingnoreValidateWeaponOnDeath" }, - { 0x33CBF4E2, "tu9_keepSwappedPlayersInPartyToNotify" }, - { 0xB10C81B8, "tu9_offlinehostdisconnectfix" }, - { 0xB506A213, "tu9_partyErrorOnInGameMigrateFail" }, - { 0x4C8B50DB, "tu9_projectile_dobj_fix" }, - { 0x5530B40A, "tu9_rerunPlaylistRulesOnHost" }, - { 0x18782B97, "tu9_steamCheckMTX" }, - { 0x25084001, "tu9_steamRetryServerInit" }, - { 0xC6273984, "tu9_tank_minimap_fix" }, - { 0x1D09EE8D, "tu9_testMissingContentPacks" }, - { 0x03ABD421, "tu9_turret_mark_rate" }, - { 0x7BE3EF65, "tu9_validateStatsOnSignout" }, - { 0x8C1FD923, "tu_10_matchRatingSampleChance" }, - { 0x57D0D476, "tu_allowDLCWeaponsByOwnership" }, - { 0x25700162, "tu_cleanUpTurretOnDisconnect" }, - { 0x661CB3B3, "tu_deferScriptMissileDetonation" }, - { 0xC5132A50, "tu_dontDropKillstreakOnDeath" }, - { 0xC431A7E7, "tu_enforceRechamberOnSwitch" }, - { 0x38BE3FAB, "tu_isolateDamageFlash" }, - { 0x7F632D53, "tu_limitGrenadeImpacts" }, - { 0x86553053, "turretPlayerAvoidScale" }, - { 0x570F64D6, "turret_KillstreakTargetTime" }, - { 0xBD86B505, "turret_SentryTargetTime" }, - { 0xF3552066, "turret_TargetLeadBias" }, - { 0xE0314C49, "turret_placement_trace_maxs" }, - { 0xE0316D07, "turret_placement_trace_mins" }, - { 0x656B4419, "turretplacement_traceOffset" }, - { 0xFB2A7006, "turretplacement_useTraceOffset" }, - { 0xF37DFFDB, "twEnabled" }, - { 0x1A3EA143, "twitchEnabled" }, - { 0x2BF952EE, "typeWriterCod7LetterFXTime" }, - { 0x08C50955, "ui_DSPPromotionInterval" }, - { 0x8FA86671, "ui_MOTDScrollRate" }, - { 0xC41DC514, "ui_SPReminderPopupInterval" }, - { 0x53E50C7C, "ui_allow_classchange" }, - { 0x6F46785A, "ui_allow_controlschange" }, - { 0x5B4BD50D, "ui_allow_teamchange" }, - { 0x3EE5847F, "ui_allowvote" }, - { 0xD16B85EE, "ui_ammo_stock_width" }, - { 0xE614BF60, "ui_animSpeedScale" }, - { 0x97B631E0, "ui_autoContinue" }, - { 0xF635298B, "ui_bigFont" }, - { 0x39BC5FF2, "ui_borderLowLightScale" }, - { 0x84A6B616, "ui_busyBlockIngameMenu" }, - { 0xDA1B5727, "ui_choice_noaction" }, - { 0x76CF99CA, "ui_combatCurrScrollBarPos" }, - { 0x81F9E3E3, "ui_currentMap" }, - { 0xEAF115CA, "ui_currentNetMap" }, - { 0x0C71C601, "ui_customModeDesc" }, - { 0x655713A7, "ui_customModeEditDesc" }, - { 0x655C7DA9, "ui_customModeEditName" }, - { 0x0C773003, "ui_customModeName" }, - { 0x0C2C3BBD, "ui_custom_name" }, - { 0xBDB78ABE, "ui_deadquote" }, - { 0xAF47D0D9, "ui_dedicated" }, - { 0x70161DC8, "ui_demoname" }, - { 0x034B18F8, "ui_detailedMM" }, - { 0xAEE4740B, "ui_display_aar" }, - { 0x647AEFC9, "ui_drawBuildNumber" }, - { 0xE9380F0D, "ui_drawOldUI" }, - { 0xD4A553C1, "ui_drawSpinnerAfterMovie" }, - { 0x8C1F4E8F, "ui_email_address" }, - { 0x9FEA6F17, "ui_enableDSPPromotion" }, - { 0x9B2FEFB7, "ui_enableGhostUpsellPopup" }, - { 0x5D4F4676, "ui_enableSPReminderPopup" }, - { 0xEC342191, "ui_errorMessage" }, - { 0x00776938, "ui_errorMessageDebug" }, - { 0x6464B70E, "ui_errorTitle" }, - { 0xF32020AB, "ui_ethernetLinkActive" }, - { 0x7B3FAF2F, "ui_extraBigFont" }, - { 0x685C42E8, "ui_favoriteAddress" }, - { 0x403E1463, "ui_favoriteName" }, - { 0x529BB9A6, "ui_favorite_message" }, - { 0x105C85DF, "ui_friendMessage" }, - { 0x538E16E5, "ui_friendNameNew" }, - { 0xCBEA4E83, "ui_friendPendingSelectedInd" }, - { 0x12860E5E, "ui_friendSelectedInd" }, - { 0x16D23665, "ui_friendlyfire" }, - { 0xC9E3031B, "ui_friendsListOpen" }, - { 0xE46A2696, "ui_fxFontColor" }, - { 0xC99B0AEF, "ui_fxFontGlowColor" }, - { 0xA3D6D096, "ui_fxFontOutlineColor" }, - { 0x92C7F93C, "ui_fxFontShadowColor" }, - { 0x0041651E, "ui_gametype" }, - { 0x36DBB942, "ui_gametype_text" }, - { 0xA13E7816, "ui_generic_status_bar" }, - { 0x7D9C8E75, "ui_ghostUpsellPopupInterval" }, - { 0x06017B9C, "ui_guncycle" }, - { 0x7B0E0CB5, "ui_gv_reloadSpeedModifier" }, - { 0x9A94CB01, "ui_heatMapColor" }, - { 0x54DE7BD5, "ui_heatMapColorForPlayer" }, - { 0x47B785A4, "ui_hideLeaderboards" }, - { 0x1DD561B1, "ui_hideMiniLeaderboards" }, - { 0x291AA767, "ui_hideminimap" }, - { 0x313D3F21, "ui_hostname" }, - { 0xD5B7474A, "ui_hud_hardcore" }, - { 0x5BBF9D99, "ui_hud_obituaries" }, - { 0x5490B5FA, "ui_hud_showobjicons" }, - { 0x8534E790, "ui_hud_visible" }, - { 0x1A122D61, "ui_ignoreMousePos" }, - { 0x9475988E, "ui_inGameStoreVisible" }, - { 0x80065971, "ui_inviteScreen" }, - { 0xDF0E2C95, "ui_inviteSelectedInd" }, - { 0x498E39F4, "ui_isClanMember" }, - { 0x09D9DD90, "ui_isDLCPopupEnabled" }, - { 0x1B98F491, "ui_isDLCRequiredPopupEnabled" }, - { 0x07212C6E, "ui_joinGametype" }, - { 0x4C35DF64, "ui_keyboard_dvar_edit" }, - { 0xBC7DE768, "ui_keyboard_dvar_new" }, - { 0x98D97FD5, "ui_keyboardtitle" }, - { 0xA0040C46, "ui_language" }, - { 0x61F61FB0, "ui_languagechanged" }, - { 0xE9C5526B, "ui_lastServerRefresh_0" }, - { 0xE9C5526C, "ui_lastServerRefresh_1" }, - { 0xE9C5526D, "ui_lastServerRefresh_2" }, - { 0xE9C5526E, "ui_lastServerRefresh_3" }, - { 0xE9C5526F, "ui_lastServerRefresh_4" }, - { 0xE66D3652, "ui_levelEra" }, - { 0xDE839F1F, "ui_listboxIndex" }, - { 0xF7030439, "ui_load_index" }, - { 0x028177A9, "ui_loadscreenTimeout" }, - { 0x8675ECEE, "ui_lobbypopup" }, - { 0x90A4DC29, "ui_mapCount" }, - { 0x509D4169, "ui_mapPackChanged" }, - { 0x32F384A1, "ui_mapname" }, - { 0x167739DE, "ui_menuLvlNotify" }, - { 0x2DFFD056, "ui_motd" }, - { 0x0156EB63, "ui_mousePitch" }, - { 0x24A48AB7, "ui_mpTheaterEnabled" }, - { 0x1EF6AE8D, "ui_mpWagerMatchEnabled" }, - { 0xEDFCAB08, "ui_mtxid" }, - { 0x4C6AC95A, "ui_multiplayer" }, - { 0xD6561D86, "ui_netGametypeName" }, - { 0x23FFB21A, "ui_netSource" }, - { 0xBF97F3FF, "ui_options_open" }, - { 0xC4FEB905, "ui_partyFull" }, - { 0x17406EBB, "ui_party_download_bar_color" }, - { 0x0A415435, "ui_party_download_bar_height" }, - { 0xF608A59D, "ui_playerListOpen" }, - { 0x3C6F92FB, "ui_playercardOpen" }, - { 0x8E6B5CFD, "ui_playlistPopulationRefreshTime" }, - { 0x0A1F88FF, "ui_prevTextEntryBox" }, - { 0x40C76424, "ui_preview" }, - { 0x609ACAC1, "ui_preview_map" }, - { 0x79220E1B, "ui_readingSaveDevice" }, - { 0x562CD2C8, "ui_right_ammo_width" }, - { 0x02F8B8DA, "ui_safearea" }, - { 0xCCF34D1D, "ui_scorelimit" }, - { 0xA4D4DC66, "ui_scrollBarWidth" }, - { 0x1E6C7D84, "ui_scrollByRow" }, - { 0x9CF16803, "ui_scrollEmptySpaceHeightPercentage" }, - { 0xC2C77D50, "ui_scrollFontScale" }, - { 0x99AB4D74, "ui_scrollMOTDDelay" }, - { 0x19252B65, "ui_scrollMOTDYOffset" }, - { 0x136572F7, "ui_scrollMOTDYOffsetResetDelay" }, - { 0x2D7A20BD, "ui_scrollMinUpdateInterval" }, - { 0x1F9AF602, "ui_scrollSpeed" }, - { 0xE7BB90C5, "ui_scrollTextDelay" }, - { 0xA36D3811, "ui_scrollTextScrollRate" }, - { 0x2C5386F6, "ui_scrollTextYOffset" }, - { 0xF60437C8, "ui_scrollTextYOffsetResetDelay" }, - { 0x5C65ACE4, "ui_serverStatusTimeOut" }, - { 0xC6D82D8A, "ui_serverinfomessage" }, - { 0x39BB4229, "ui_serverinfomessagehostname" }, - { 0x110ED559, "ui_showBryceMagic" }, - { 0xCF73FCE7, "ui_showDLCMaps" }, - { 0x618612E1, "ui_showNewestLeaderboards" }, - { 0x11181601, "ui_showmap" }, - { 0x055760F2, "ui_smallFont" }, - { 0x230178DF, "ui_specops" }, - { 0x86B4448E, "ui_splitscreen" }, - { 0x70D6EFC1, "ui_storeButtonPressed" }, - { 0xD42141C5, "ui_text_endreason" }, - { 0x5434D710, "ui_timelimit" }, - { 0x8445C81E, "ui_totalDLCReleased" }, - { 0xF2772EAC, "ui_useCustomClassInfo" }, - { 0x41A6C572, "ui_weapon_tiers" }, - { 0xA4E1C392, "ui_xpscale" }, - { 0x6B64B9B4, "ui_zm_gamemodegroup" }, - { 0xC955B4CD, "ui_zm_mapstartlocation" }, - { 0x2FA084D6, "unsubscriptionCooloffTimer" }, - { 0x19548C15, "useMapPreloading" }, - { 0xAE1FF67E, "useSvMapPreloading" }, - { 0xFE18CD45, "username" }, - { 0xB8F26DBF, "using_original" }, - { 0x22550FD2, "vc_FBM" }, - { 0x22551077, "vc_FGM" }, - { 0x22551203, "vc_FSM" }, - { 0x225519B4, "vc_HMB" }, - { 0x225519B9, "vc_HMG" }, - { 0x225519C4, "vc_HMR" }, - { 0x22552A34, "vc_LIB" }, - { 0x22552A39, "vc_LIG" }, - { 0x22552A49, "vc_LIW" }, - { 0x22552AFA, "vc_LOB" }, - { 0x22552B0F, "vc_LOW" }, - { 0x22552BD2, "vc_LUT" }, - { 0x22552EF9, "vc_MMB" }, - { 0x22552EFE, "vc_MMG" }, - { 0x22552F09, "vc_MMR" }, - { 0x108E3854, "vc_RE" }, - { 0x6CFDB2E0, "vc_RGBH" }, - { 0x6CFDB2E4, "vc_RGBL" }, - { 0x108E3862, "vc_RS" }, - { 0x2255487F, "vc_SMB" }, - { 0x22554884, "vc_SMG" }, - { 0x2255488F, "vc_SMR" }, - { 0x6CFE5CEF, "vc_SNAP" }, - { 0x108E393E, "vc_YH" }, - { 0x108E3942, "vc_YL" }, - { 0x13FF0109, "vcs_WindowState" }, - { 0xC2DE4CDE, "vcs_timelimit" }, - { 0xAD6996C1, "vehGunnerSplashDamage" }, - { 0x1B673854, "vehHelicopterDefaultPitch" }, - { 0xE812A98E, "vehHelicopterFreeLook" }, - { 0xBAF177F9, "vehHelicopterHoverSpeedThreshold" }, - { 0x7864000C, "vehHelicopterInvertUpDown" }, - { 0x54B2C6EE, "vehHelicopterLookaheadTime" }, - { 0xAA4E2EE6, "vehHelicopterMaxHeightLockOffset" }, - { 0x5E7C6BE4, "vehHelicopterMinHeightLockOffset" }, - { 0xEF1AB05E, "vehHelicopterPathTransitionTime" }, - { 0xA8F24A9D, "vehHelicopterRightStickDeadzone" }, - { 0x37212BC9, "vehHelicopterRotDecel" }, - { 0x8FE822AA, "vehHelicopterScaleMovement" }, - { 0x8922B372, "vehHelicopterSoftCollisions" }, - { 0x6A326686, "vehHelicopterStrafeDeadzone" }, - { 0xB7A5BCFD, "vehHelicopterTiltFromViewangles" }, - { 0x03DD6498, "vehHelicopterYawAltitudeControls" }, - { 0xDFCE882E, "vehHelicopterYawOnLeftStick" }, - { 0x7CC8F2E6, "vehHelicopterboundMapHeight" }, - { 0x1B9C174C, "vehHelicopterboundMapLowerRightX" }, - { 0x1B9C174D, "vehHelicopterboundMapLowerRightY" }, - { 0xF4EA7E1C, "vehHelicopterboundMapUpperLeftX" }, - { 0xF4EA7E1D, "vehHelicopterboundMapUpperLeftY" }, - { 0x760DB45F, "vehHelicopterboundsOn" }, - { 0x393E622D, "vehLocationalVehicleSeatEntry" }, - { 0xB57111A2, "vehLockTurretToPlayerView" }, - { 0x316F29E6, "vehNPCThrottleMultiplier" }, - { 0xD60C8B21, "vehPlaneAssistedFlying" }, - { 0x8B66B306, "vehPlaneConventionalFlight" }, - { 0xB5AADC4D, "vehPlaneFakeLiftForce" }, - { 0x8195002D, "vehPlaneGravityForce" }, - { 0xF54E00F6, "vehPlaneLiftForce" }, - { 0x9FD008BB, "vehPlaneLowSpeed" }, - { 0x81D8C0A8, "vehPlanePitchAccel" }, - { 0x2867604F, "vehPlanePlayerAvoidance" }, - { 0xF4967D29, "vehPlaneRollAccel" }, - { 0x537EFAFB, "vehPlaneRollDeadZone" }, - { 0x458375AA, "vehPlaneSpeedControl" }, - { 0x96B01DCA, "vehPlaneTurnAssistDecayRate" }, - { 0x184193BE, "vehPlaneYawFromRollScale" }, - { 0x6978859A, "vehPlaneYawSpeed" }, - { 0xA861A373, "vehanim_debug" }, - { 0xB78D3AD3, "vehanim_enable" }, - { 0x80CFAA4C, "vehicleMouseExtraTurnSpeed" }, - { 0x521A778E, "vehicle_collision_prediction_time" }, - { 0xF27A42BE, "vehicle_damage_bouncing_betty" }, - { 0x8F401D8A, "vehicle_damage_bullet" }, - { 0xF0A9DF38, "vehicle_damage_grenade" }, - { 0x2B8A9B5E, "vehicle_damage_max_shielding" }, - { 0x4AC53CD3, "vehicle_damage_projectile" }, - { 0xAA48E5CF, "vehicle_damage_satchel_charge" }, - { 0x2502256E, "vehicle_damage_sticky_grenade" }, - { 0x9ACAE746, "vehicle_damage_zone_front" }, - { 0x42C6B007, "vehicle_damage_zone_rear" }, - { 0x42C74DC2, "vehicle_damage_zone_side" }, - { 0x9BD7F55B, "vehicle_damage_zone_under" }, - { 0x55FD9D67, "vehicle_destructible_damage_bouncing_betty" }, - { 0x274433CE, "vehicle_destructible_damage_bouncing_betty_radius" }, - { 0xC74DD601, "vehicle_destructible_damage_grenade" }, - { 0x84BF7B28, "vehicle_destructible_damage_grenade_radius" }, - { 0x2F8287C3, "vehicle_destructible_damage_projectile_radius" }, - { 0x0DCC4078, "vehicle_destructible_damage_satchel_charge" }, - { 0xE63C99BF, "vehicle_destructible_damage_satchel_charge_radius" }, - { 0x88858017, "vehicle_destructible_damage_sticky_grenade" }, - { 0xE71C307E, "vehicle_destructible_damage_sticky_grenade_radius" }, - { 0x29D4A545, "vehicle_piece_damagesfx_threshold" }, - { 0x0671C64C, "vehicle_push_during_mantle" }, - { 0xCF5FAD41, "vehicle_riding" }, - { 0xF04B1FFA, "vehicle_selfCollision" }, - { 0xD30DB9E6, "vehicle_sounds_cutoff" }, - { 0x4A24E650, "vehicle_switch_seat_delay" }, - { 0xDF156A59, "vehicle_useRadius" }, - { 0x73006C4B, "version" }, - { 0xE4ED0451, "vid_xpos" }, - { 0xE4ED90B2, "vid_ypos" }, - { 0xC9AFDAFE, "visionstore_glowTweakBloomCutoff" }, - { 0x808EE92A, "visionstore_glowTweakBloomDesaturation" }, - { 0x7EE32ECE, "visionstore_glowTweakBloomIntensity0" }, - { 0x7EE32ECF, "visionstore_glowTweakBloomIntensity1" }, - { 0xC6230C45, "visionstore_glowTweakEnable" }, - { 0x5520E2F6, "visionstore_glowTweakRadius0" }, - { 0x5520E2F7, "visionstore_glowTweakRadius1" }, - { 0xF0E19088, "visionstore_glowTweakSkyBleedIntensity0" }, - { 0xF0E19089, "visionstore_glowTweakSkyBleedIntensity1" }, - { 0x34E3FC6D, "waitOnStatsTimeout" }, - { 0x35CF496B, "wallmount_turret_placement_trace_maxs" }, - { 0x35CF6A29, "wallmount_turret_placement_trace_mins" }, - { 0x109F866F, "war_a" }, - { 0x109F8670, "war_b" }, - { 0x109F8671, "war_c" }, - { 0x109F8672, "war_d" }, - { 0x109F8673, "war_e" }, - { 0x24905703, "war_sb" }, - { 0xDC170968, "waterbrush_entity" }, - { 0x66018204, "waypointDistFade" }, - { 0x783F0BAF, "waypointDistScaleRangeMax" }, - { 0x783F0CAD, "waypointDistScaleRangeMin" }, - { 0xE246DAE1, "waypointDistScaleSmallest" }, - { 0xCBC50A22, "waypointIconHeight" }, - { 0xA2651969, "waypointIconWidth" }, - { 0x28FF1CE8, "waypointMaxDrawDist" }, - { 0x16CDE0CC, "waypointOffscreenCornerRadius" }, - { 0xF3E9A099, "waypointOffscreenDistanceThresholdAlpha" }, - { 0x000D9745, "waypointOffscreenPadBottom" }, - { 0x8CD521BB, "waypointOffscreenPadLeft" }, - { 0x27E820CE, "waypointOffscreenPadRight" }, - { 0xFC82B7C3, "waypointOffscreenPadTop" }, - { 0xB4026927, "waypointOffscreenPointerDistance" }, - { 0x2C73DE95, "waypointOffscreenPointerHeight" }, - { 0x5F81AB7C, "waypointOffscreenPointerWidth" }, - { 0xE7ACDBC8, "waypointOffscreenRoundedCorners" }, - { 0x999911A5, "waypointOffscreenScaleLength" }, - { 0x23C5D0E8, "waypointOffscreenScaleSmallest" }, - { 0x9B954958, "waypointPlayerOffsetCrouch" }, - { 0x89832898, "waypointPlayerOffsetProne" }, - { 0xBDAB1245, "waypointPlayerOffsetRevive" }, - { 0x89BA4F4E, "waypointPlayerOffsetStand" }, - { 0x924DE8D4, "waypointSplitscreenScale" }, - { 0x1B106CBF, "waypointTimeFade" }, - { 0x2A5EEDB5, "waypointTweakY" }, - { 0x43939D56, "webmDwReadDelay" }, - { 0x4FFCE86E, "webmDwReadTimeout" }, - { 0xE87FB385, "webmDwWriteDelay" }, - { 0xE047465D, "webmDwWriteTimeout" }, - { 0x3A3B67E5, "webm_arnr_maxframes" }, - { 0x71DD9D70, "webm_arnr_strength" }, - { 0x6A30E023, "webm_arnr_type" }, - { 0xCCFA8C58, "webm_auto_kf" }, - { 0xFDF8905A, "webm_bitrate" }, - { 0xEB1DE6AE, "webm_buffer_high_timeout" }, - { 0x53F3C154, "webm_buffer_high_water_mark" }, - { 0xEA513B86, "webm_buffer_low_water_mark" }, - { 0xE4C5E351, "webm_drop_thresh" }, - { 0x5ADA29AD, "webm_enableautoaltref" }, - { 0x4AA2CACD, "webm_encAllowCamera" }, - { 0x259198F9, "webm_encEliteRequired" }, - { 0x1CA76AF3, "webm_encIdentityVerificationRequired" }, - { 0xF2E2398A, "webm_encRetryTime" }, - { 0x2D636DF0, "webm_encSendBufferTimeout" }, - { 0x40215FC9, "webm_encStatus" }, - { 0x005AA6DC, "webm_encStreamEnabled" }, - { 0xBA9FA3C3, "webm_encTwitchEnabled" }, - { 0x73A48F0E, "webm_encUiEnabled" }, - { 0x8BB81689, "webm_encUiEnabledCustom" }, - { 0xAA01B16D, "webm_encUiEnabledPublic" }, - { 0x9A33A4E9, "webm_encUiSigningIn" }, - { 0x51502929, "webm_highactivitythreshold" }, - { 0x1E29D67C, "webm_hq_bandwidth" }, - { 0xC21CE3FA, "webm_httpAuthLogin" }, - { 0xA1092E06, "webm_httpAuthMode" }, - { 0xA10A9998, "webm_httpAuthPass" }, - { 0xC2ADB882, "webm_httpAuthToken" }, - { 0xE641ED07, "webm_httpUploadUrl" }, - { 0xAF52B19A, "webm_httpUploadUrlTwitch" }, - { 0x08BC41D4, "webm_httpUploadUrlYouTube" }, - { 0x1EAFB424, "webm_kf_interval" }, - { 0x998B23A3, "webm_lag" }, - { 0xE1F74C00, "webm_lq_bandwidth" }, - { 0x28B9A19C, "webm_max_intra_bitrate" }, - { 0xCAF05FF4, "webm_mode" }, - { 0x48456280, "webm_profile" }, - { 0x293C20A5, "webm_q_max" }, - { 0x293C21A3, "webm_q_min" }, - { 0x882D09F5, "webm_rc_buf_initial_sz" }, - { 0x6ACD7EA1, "webm_rc_buf_optimal_sz" }, - { 0xA822CE4C, "webm_rc_buf_sz" }, - { 0x95715817, "webm_render_auto_kf" }, - { 0xC66F5C19, "webm_render_bitrate" }, - { 0x10B8A479, "webm_render_dont_connect_upfront" }, - { 0xE2CBD057, "webm_render_fps" }, - { 0x10BC2E3F, "webm_render_profile" }, - { 0xC5BEF0A4, "webm_render_q_max" }, - { 0xC5BEF1A2, "webm_render_q_min" }, - { 0xB4F48008, "webm_render_realtime_scale" }, - { 0xD23E0550, "webm_render_send_audio_first" }, - { 0x2D872519, "webm_render_threads" }, - { 0x99D9C754, "webm_render_uv_step" }, - { 0xB109695E, "webm_target_fps" }, - { 0x5399ADA0, "webm_twitchLasterror" }, - { 0xFAFBA5DB, "webm_twitchTransferChunkSize" }, - { 0x559AC81E, "webm_twitch_summaryRefresh" }, - { 0xD7207082, "webm_twitch_summaryUrl" }, - { 0x3551C1CB, "webm_usersStreaming" }, - { 0x679A1643, "webm_usersWaitingToStream" }, - { 0xEC0E8DF9, "webm_vol_game" }, - { 0xBC9F1ADD, "webm_vol_headset" }, - { 0x55062C5A, "webm_youtube_max_posts_per_second" }, - { 0xD40BCEFF, "welcome_shown" }, - { 0x9993C78E, "wideScreen" }, - { 0xDE5D2CDD, "wiiuGame" }, - { 0xDEC75842, "wiiuIkEnabled" }, - { 0x1AE3D292, "wind_debug_display" }, - { 0x48BD59F2, "wind_global_hi_altitude" }, - { 0x46A26833, "wind_global_low_altitude" }, - { 0x48713FB6, "wind_global_low_strength_percent" }, - { 0xB96DA139, "wind_global_vector" }, - { 0x349F0182, "wind_grass_gust_distance" }, - { 0x5BD124BF, "wind_grass_gust_radius" }, - { 0x40F220A8, "wind_grass_gust_speed" }, - { 0x57DD8426, "wind_grass_gust_strength" }, - { 0x0908289D, "wind_grass_gustinterval" }, - { 0x37EB947D, "wind_grass_scale" }, - { 0x33B66AB5, "wind_grass_tension" }, - { 0x44256435, "wind_leaf_scale" }, - { 0xE09AC8CD, "xPGroups" }, - { 0x41BC55F2, "xblive_clanListChanged" }, - { 0x1E0679B9, "xblive_clanmatch" }, - { 0x0AAC47C0, "xblive_ec_firstupdatems" }, - { 0x1FF43A8C, "xblive_ec_lastupdatems" }, - { 0x7D0A9288, "xblive_ec_maxprobewait" }, - { 0x222EE1AA, "xblive_ec_minpercent" }, - { 0x4F8627A4, "xblive_ec_minprobes" }, - { 0xB03F35F7, "xblive_loggedin" }, - { 0x7C70CCFE, "xblive_mappacks" }, - { 0x8C800EEF, "xblive_matchEndingSoon" }, - { 0xCCF798F6, "xblive_privatematch" }, - { 0x21C07C90, "xblive_rankedmatch" }, - { 0xE850B6BB, "xblive_theater" }, - { 0x0F87D4F1, "xblive_wagermatch" }, - { 0xE0DDE627, "xenonGame" }, - { 0x3354CA95, "xenon_maxVoicePacketsPerSec" }, - { 0x17B355F3, "xenon_maxVoicePacketsPerSecForServer" }, - { 0x130BAFAC, "ytAuthCooloff" }, - { 0x0BB50EBB, "ytAuthCooloffTime" }, - { 0x26DDBBBC, "ytForcePrivate" }, - { 0x59145A10, "zero_stats_check" }, - { 0x5D1D04D4, "zm_rand_mode" }, - { 0xD446AE4D, "zm_rand_loc" }, - { 0xFA91EA91, "zombie_debug" }, - { 0x4CD9FAEE, "zombie_devgui" }, - { 0x27D7087D, "zombie_double_wide_checks" }, - { 0xDEB90F93, "zombie_useOldPathFallback" }, - { 0x4DECF257, "zombiemode_path_minz_bias" }, -}}; - -struct __init__ -{ - __init__() - { - static bool init = false; - if (init) return; - init = true; - - opcode_map.reserve(opcode_list.size()); - opcode_map_rev.reserve(opcode_list.size()); - - for (const auto& entry : opcode_list) - { - opcode_map.insert({ entry.first, entry.second }); - opcode_map_rev.insert({ entry.second, entry.first }); - } - - for (const auto& entry : dvar_list) - { - dvar_map.insert({ entry.first, entry.second }); - } - } -}; - -__init__ _; - -} // namespace xsk::arc::t6 - -#ifdef _MSC_VER -#pragma warning(pop) -#endif diff --git a/src/t6/t6.cpp b/src/t6/t6.cpp deleted file mode 100644 index b8b7c77b..00000000 --- a/src/t6/t6.cpp +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2023 xensik. All rights reserved. -// -// Use of this source code is governed by a GNU GPLv3 license -// that can be found in the LICENSE file. - -#include "xsk/stdinc.hpp" -#include "xsk/t6/t6.hpp" - -namespace xsk::arc::t6 -{ - -auto opcode_size(std::uint8_t id) -> std::uint32_t -{ - switch (static_cast(id)) - { - case opcode::OP_End: - case opcode::OP_Return: - case opcode::OP_GetUndefined: - case opcode::OP_GetZero: - case opcode::OP_GetLevelObject: - case opcode::OP_GetAnimObject: - case opcode::OP_GetSelf: - case opcode::OP_GetLevel: - case opcode::OP_GetGame: - case opcode::OP_GetAnim: - case opcode::OP_GetGameRef: - case opcode::OP_CreateLocalVariable: - case opcode::OP_EvalArray: - case opcode::OP_EvalArrayRef: - case opcode::OP_ClearArray: - case opcode::OP_EmptyArray: - case opcode::OP_GetSelfObject: - case opcode::OP_SafeSetVariableFieldCached: - case opcode::OP_ClearParams: - case opcode::OP_CheckClearParams: - case opcode::OP_SetVariableField: - case opcode::OP_Wait: - case opcode::OP_WaitTillFrameEnd: - case opcode::OP_PreScriptCall: - case opcode::OP_DecTop: - case opcode::OP_CastFieldObject: - case opcode::OP_CastBool: - case opcode::OP_BoolNot: - case opcode::OP_BoolComplement: - case opcode::OP_Inc: - case opcode::OP_Dec: - case opcode::OP_Bit_Or: - case opcode::OP_Bit_Xor: - case opcode::OP_Bit_And: - case opcode::OP_Equal: - case opcode::OP_NotEqual: - case opcode::OP_LessThan: - case opcode::OP_GreaterThan: - case opcode::OP_LessThanOrEqualTo: - case opcode::OP_GreaterThanOrEqualTo: - case opcode::OP_ShiftLeft: - case opcode::OP_ShiftRight: - case opcode::OP_Plus: - case opcode::OP_Minus: - case opcode::OP_Multiply: - case opcode::OP_Divide: - case opcode::OP_Modulus: - case opcode::OP_SizeOf: - case opcode::OP_WaitTill: - case opcode::OP_Notify: - case opcode::OP_EndOn: - case opcode::OP_VoidCodePos: - case opcode::OP_Vector: - case opcode::OP_RealWait: - case opcode::OP_IsDefined: - case opcode::OP_VectorScale: - case opcode::OP_AnglesToUp: - case opcode::OP_AnglesToRight: - case opcode::OP_AnglesToForward: - case opcode::OP_AngleClamp180: - case opcode::OP_VectorToAngles: - case opcode::OP_Abs: - case opcode::OP_GetTime: - case opcode::OP_GetDvar: - case opcode::OP_GetDvarInt: - case opcode::OP_GetDvarFloat: - case opcode::OP_GetDvarVector: - case opcode::OP_GetDvarColorRed: - case opcode::OP_GetDvarColorGreen: - case opcode::OP_GetDvarColorBlue: - case opcode::OP_GetDvarColorAlpha: - case opcode::OP_FirstArrayKey: - case opcode::OP_NextArrayKey: - case opcode::OP_ProfileStart: - case opcode::OP_ProfileStop: - case opcode::OP_SafeDecTop: - case opcode::OP_Nop: - case opcode::OP_Abort: - case opcode::OP_Object: - case opcode::OP_ThreadObject: - case opcode::OP_EvalLocalVariable: - case opcode::OP_EvalLocalVariableRef: - return 1; - case opcode::OP_GetByte: - case opcode::OP_GetNegByte: - case opcode::OP_SafeCreateLocalVariables: - case opcode::OP_RemoveLocalVariables: - case opcode::OP_EvalLocalVariableCached: - case opcode::OP_EvalLocalArrayRefCached: - case opcode::OP_SafeSetWaittillVariableFieldCached: - case opcode::OP_EvalLocalVariableRefCached: - case opcode::OP_ScriptFunctionCallPointer: - case opcode::OP_ScriptMethodCallPointer: - case opcode::OP_ScriptThreadCallPointer: - case opcode::OP_ScriptMethodThreadCallPointer: - case opcode::OP_WaitTillMatch: - case opcode::OP_VectorConstant: - return 2; - case opcode::OP_GetUnsignedShort: - case opcode::OP_GetNegUnsignedShort: - case opcode::OP_GetString: - case opcode::OP_GetIString: - case opcode::OP_EvalFieldVariable: - case opcode::OP_EvalFieldVariableRef: - case opcode::OP_ClearFieldVariable: - case opcode::OP_JumpOnFalse: - case opcode::OP_JumpOnTrue: - case opcode::OP_JumpOnFalseExpr: - case opcode::OP_JumpOnTrueExpr: - case opcode::OP_Jump: - case opcode::OP_JumpBack: - case opcode::OP_DevblockBegin: - case opcode::OP_DevblockEnd: - return 3; - case opcode::OP_GetInteger: - case opcode::OP_GetFloat: - case opcode::OP_GetAnimation: - case opcode::OP_GetFunction: - case opcode::OP_Switch: - case opcode::OP_EndSwitch: - case opcode::OP_GetHash: - return 5; - case opcode::OP_CallBuiltin: - case opcode::OP_CallBuiltinMethod: - case opcode::OP_ScriptFunctionCall: - case opcode::OP_ScriptMethodCall: - case opcode::OP_ScriptThreadCall: - case opcode::OP_ScriptMethodThreadCall: - return 6; - case opcode::OP_GetVector: - return 13; - default: - throw error("couldn't resolve instruction size for " + std::to_string(id)); - } -} - -} // namespace xsk::arc::t6 diff --git a/src/tool/main.cpp b/src/tool/main.cpp index 2dae11a9..02c8f37b 100644 --- a/src/tool/main.cpp +++ b/src/tool/main.cpp @@ -23,11 +23,13 @@ #include "xsk/gsc/engine/s4.hpp" #include "xsk/gsc/engine/h1.hpp" #include "xsk/gsc/engine/h2.hpp" -#include "xsk/t6/t6.hpp" -// #include "xsk/arc/engine/t6.hpp" -// #include "xsk/arc/engine/t7.hpp" -// #include "xsk/arc/engine/t8.hpp" -// #include "xsk/arc/engine/t9.hpp" +#include "xsk/arc/engine/t6_pc.hpp" +#include "xsk/arc/engine/t6_ps3.hpp" +#include "xsk/arc/engine/t6_xb2.hpp" +#include "xsk/arc/engine/t6_wiiu.hpp" +#include "xsk/arc/engine/t7.hpp" +#include "xsk/arc/engine/t8.hpp" +#include "xsk/arc/engine/t9.hpp" namespace fs = std::filesystem; @@ -36,7 +38,8 @@ namespace xsk enum class encd { _, source, assembly, binary }; enum class mode { _, assemble, disassemble, compile, decompile, parse, rename }; -enum class game { _, iw5ps, iw5xb, iw6ps, iw6xb, s1ps, s1xb, iw5, iw6, iw7, iw8, iw9, s1, s2, s4, h1, h2, t6, t7, t8, t9 }; +enum class game { _, iw5, iw6, iw7, iw8, iw9, s1, s2, s4, h1, h2, t6, t7, t8, t9 }; +enum class mach { _, pc, ps3, ps4, ps5, xb2, xb3, xb4, wiiu }; std::unordered_map const exts = { @@ -58,12 +61,6 @@ std::unordered_map const modes = std::unordered_map const games = { - { "iw5ps", game::iw5ps }, - { "iw5xb", game::iw5xb }, - { "iw6ps", game::iw6ps }, - { "iw6xb", game::iw6xb }, - { "s1ps", game::s1ps }, - { "s1xb", game::s1xb }, { "iw5", game::iw5 }, { "iw6", game::iw6 }, { "iw7", game::iw7 }, @@ -82,12 +79,6 @@ std::unordered_map const games = std::map const games_rev = { - { game::iw5ps, "iw5ps", }, - { game::iw5xb, "iw5xb" }, - { game::iw6ps, "iw6ps" }, - { game::iw6xb, "iw6xb" }, - { game::s1ps, "s1ps" }, - { game::s1xb, "s1xb" }, { game::iw5, "iw5" }, { game::iw6, "iw6" }, { game::iw7, "iw7" }, @@ -104,9 +95,21 @@ std::map const games_rev = { game::t9, "t9" }, }; +std::unordered_map const machs = +{ + { "pc", mach::pc }, + { "ps3", mach::ps3 }, + { "ps4", mach::ps4 }, + { "ps5", mach::ps5 }, + { "xb2", mach::xb2 }, + { "xb3", mach::xb3 }, + { "xb4", mach::xb4 }, + { "wiiu", mach::wiiu }, +}; + std::map const encds = { - { mode::assemble , encd::assembly }, + { mode::assemble, encd::assembly }, { mode::disassemble, encd::binary }, { mode::compile, encd::source }, { mode::decompile, encd::binary }, @@ -141,44 +144,11 @@ auto overwrite_prompt(std::string const& file) -> bool namespace gsc { -std::map> contexts; -std::map> funcs; +std::map>> contexts; +std::map> funcs; bool zonetool = false; -/*auto choose_resolver_file_name(uint32_t id, game& game) -> std::string -{ - switch (game) - { - // case game::iw5c: - // return iw5c::resolver::token_name(static_cast(id)); - // case game::iw6c: - // return iw6c::resolver::token_name(static_cast(id)); - // case game::s1c: - // return s1c::resolver::token_name(static_cast(id)); - // case game::iw5: - // return iw5::resolver::token_name(static_cast(id)); - // case game::iw6: - // return iw6::resolver::token_name(static_cast(id)); - // case game::iw7: - // return iw7::resolver::token_name(id); - // case game::iw8: - // return iw8::resolver::token_name(id); - // case game::s1: - // return s1::resolver::token_name(static_cast(id)); - // case game::s2: - // return s2::resolver::token_name(static_cast(id)); - // case game::s4: - // return s4::resolver::token_name(id); - // case game::h1: - // return h1::resolver::token_name(static_cast(id)); - // case game::h2: - // return h2::resolver::token_name(static_cast(id)); - default: - return ""; - } -}*/ - -auto assemble_file(game game, fs::path file, fs::path rel) -> void +auto assemble_file(game game, mach mach, fs::path file, fs::path rel) -> void { try { @@ -188,8 +158,8 @@ auto assemble_file(game game, fs::path file, fs::path rel) -> void rel = fs::path{ games_rev.at(game) } / rel / file.filename().replace_extension((zonetool ? ".cgsc" : ".gscbin")); auto data = utils::file::read(file); - auto outasm = contexts[game]->source().parse_assembly(data); - auto outbin = contexts[game]->assembler().assemble(*outasm); + auto outasm = contexts[game][mach]->source().parse_assembly(data); + auto outbin = contexts[game][mach]->assembler().assemble(*outasm); if (true/*overwrite_prompt(file + (zonetool ? ".cgsc" : ".gscbin"))*/) { @@ -228,7 +198,7 @@ auto assemble_file(game game, fs::path file, fs::path rel) -> void } } -auto disassemble_file(game game, fs::path file, fs::path rel) -> void +auto disassemble_file(game game, mach mach, fs::path file, fs::path rel) -> void { try { @@ -262,8 +232,8 @@ auto disassemble_file(game game, fs::path file, fs::path rel) -> void stack = utils::zlib::decompress(asset.buffer, asset.len); } - auto outasm = contexts[game]->disassembler().disassemble(script, stack); - auto outsrc = contexts[game]->source().dump(*outasm); + auto outasm = contexts[game][mach]->disassembler().disassemble(script, stack); + auto outsrc = contexts[game][mach]->source().dump(*outasm); utils::file::save(fs::path{ "disassembled" } / rel, outsrc); std::cout << fmt::format("disassembled {}\n", rel.generic_string()); @@ -274,7 +244,7 @@ auto disassemble_file(game game, fs::path file, fs::path rel) -> void } } -auto compile_file(game game, fs::path file, fs::path rel) -> void +auto compile_file(game game, mach mach, fs::path file, fs::path rel) -> void { try { @@ -284,8 +254,8 @@ auto compile_file(game game, fs::path file, fs::path rel) -> void rel = fs::path{ games_rev.at(game) } / rel / file.filename().replace_extension((zonetool ? ".cgsc" : ".gscbin")); auto data = utils::file::read(file); - auto outasm = contexts[game]->compiler().compile(file.string(), data); - auto outbin = contexts[game]->assembler().assemble(*outasm); + auto outasm = contexts[game][mach]->compiler().compile(file.string(), data); + auto outbin = contexts[game][mach]->assembler().assemble(*outasm); if (true/*overwrite_prompt(file + (zonetool ? ".cgsc" : ".gscbin"))*/) { @@ -324,7 +294,7 @@ auto compile_file(game game, fs::path file, fs::path rel) -> void } } -auto decompile_file(game game, fs::path file, fs::path rel) -> void +auto decompile_file(game game, mach mach, fs::path file, fs::path rel) -> void { try { @@ -358,9 +328,9 @@ auto decompile_file(game game, fs::path file, fs::path rel) -> void stack = utils::zlib::decompress(asset.buffer, asset.len); } - auto outasm = contexts[game]->disassembler().disassemble(script, stack); - auto outast = contexts[game]->decompiler().decompile(*outasm); - auto outsrc = contexts[game]->source().dump(*outast); + auto outasm = contexts[game][mach]->disassembler().disassemble(script, stack); + auto outast = contexts[game][mach]->decompiler().decompile(*outasm); + auto outsrc = contexts[game][mach]->source().dump(*outast); utils::file::save(fs::path{ "decompiled" } / rel, outsrc); std::cout << fmt::format("decompiled {}\n", rel.generic_string()); @@ -371,7 +341,7 @@ auto decompile_file(game game, fs::path file, fs::path rel) -> void } } -auto parse_file(game game, fs::path file, fs::path rel) -> void +auto parse_file(game game, mach mach, fs::path file, fs::path rel) -> void { try { @@ -382,8 +352,8 @@ auto parse_file(game game, fs::path file, fs::path rel) -> void auto data = utils::file::read(file); - auto prog = contexts[game]->source().parse_program(file.string(), data); - utils::file::save(fs::path{ "parsed" } / rel, contexts[game]->source().dump(*prog)); + auto prog = contexts[game][mach]->source().parse_program(file.string(), data); + utils::file::save(fs::path{ "parsed" } / rel, contexts[game][mach]->source().dump(*prog)); std::cout << fmt::format("parsed {}\n", rel.generic_string()); } catch (std::exception const& e) @@ -392,7 +362,7 @@ auto parse_file(game game, fs::path file, fs::path rel) -> void } } -auto rename_file(game game, fs::path file, fs::path rel) -> void +auto rename_file(game game, mach mach, fs::path file, fs::path rel) -> void { try { @@ -412,11 +382,11 @@ auto rename_file(game game, fs::path file, fs::path rel) -> void if (utils::string::is_number(name)) { - name = contexts[game]->token_name(std::stoul(name)); + name = contexts[game][mach]->token_name(std::stoul(name)); } else if (utils::string::is_hex_number(name)) { - name = contexts[game]->token_name(std::stoul(name, nullptr, 16)); + name = contexts[game][mach]->token_name(std::stoul(name, nullptr, 16)); } if (!name.starts_with("_id_")) @@ -449,7 +419,7 @@ auto rename_file(game game, fs::path file, fs::path rel) -> void std::unordered_map> files; -auto fs_callback(std::string const& name) -> std::pair> +auto fs_read(std::string const& name) -> std::pair> { auto data = utils::file::read(fs::path{ name }); @@ -473,151 +443,213 @@ auto fs_callback(std::string const& name) -> std::pair> throw std::runtime_error("file read error"); } -auto init_iw5() -> void +auto init_iw5(mach mach) -> void { - if (!contexts.contains(game::iw5)) + if (contexts[game::iw5].contains(mach)) return; + + switch (mach) { - contexts[game::iw5] = std::make_unique(); - contexts[game::iw5]->init(build::prod, fs_callback); + case mach::pc: + { + contexts[game::iw5][mach] = std::make_unique(); + contexts[game::iw5][mach]->init(build::prod, fs_read); + break; + } + case mach::ps3: + { + contexts[game::iw5][mach] = std::make_unique(); + contexts[game::iw5][mach]->init(build::prod, fs_read); + break; + } + case mach::xb2: + { + contexts[game::iw5][mach] = std::make_unique(); + contexts[game::iw5][mach]->init(build::prod, fs_read); + break; + } + default: + throw std::runtime_error("not implemented"); } } -auto init_iw5_ps() -> void +auto init_iw6(mach mach) -> void { - if (!contexts.contains(game::iw5ps)) + if (contexts[game::iw6].contains(mach)) return; + + switch (mach) { - contexts[game::iw5ps] = std::make_unique(); - contexts[game::iw5ps]->init(build::prod, fs_callback); + case mach::pc: + { + contexts[game::iw6][mach] = std::make_unique(); + contexts[game::iw6][mach]->init(build::prod, fs_read); + break; + } + case mach::ps3: + { + contexts[game::iw6][mach] = std::make_unique(); + contexts[game::iw6][mach]->init(build::prod, fs_read); + break; + } + case mach::xb2: + { + contexts[game::iw6][mach] = std::make_unique(); + contexts[game::iw6][mach]->init(build::prod, fs_read); + break; + } + default: + throw std::runtime_error("not implemented"); } } -auto init_iw5_xb() -> void +auto init_iw7(mach mach) -> void { - if (!contexts.contains(game::iw5xb)) + if (contexts[game::iw7].contains(mach)) return; + + switch (mach) { - contexts[game::iw5xb] = std::make_unique(); - contexts[game::iw5xb]->init(build::prod, fs_callback); + case mach::pc: + { + contexts[game::iw7][mach] = std::make_unique(); + contexts[game::iw7][mach]->init(build::prod, fs_read); + break; + } + default: + throw std::runtime_error("not implemented"); } } -auto init_iw6() -> void +auto init_iw8(mach mach) -> void { - if (!contexts.contains(game::iw6)) + if (contexts[game::iw8].contains(mach)) return; + + switch (mach) { - contexts[game::iw6] = std::make_unique(); - contexts[game::iw6]->init(build::prod, fs_callback); + case mach::pc: + { + contexts[game::iw8][mach] = std::make_unique(); + contexts[game::iw8][mach]->init(build::prod, fs_read); + break; + } + default: + throw std::runtime_error("not implemented"); } } -auto init_iw6_ps() -> void +auto init_iw9(mach mach) -> void { - if (!contexts.contains(game::iw6ps)) + if (contexts[game::iw9].contains(mach)) return; + + switch (mach) { - contexts[game::iw6ps] = std::make_unique(); - contexts[game::iw6ps]->init(build::prod, fs_callback); + case mach::pc: + { + contexts[game::iw9][mach] = std::make_unique(); + contexts[game::iw9][mach]->init(build::prod, fs_read); + break; + } + default: + throw std::runtime_error("not implemented"); } } -auto init_iw6_xb() -> void +auto init_s1(mach mach) -> void { - if (!contexts.contains(game::iw6xb)) + if (contexts[game::s1].contains(mach)) return; + + switch (mach) { - contexts[game::iw6xb] = std::make_unique(); - contexts[game::iw6xb]->init(build::prod, fs_callback); + case mach::pc: + { + contexts[game::s1][mach] = std::make_unique(); + contexts[game::s1][mach]->init(build::prod, fs_read); + break; + } + case mach::ps3: + { + contexts[game::s1][mach] = std::make_unique(); + contexts[game::s1][mach]->init(build::prod, fs_read); + break; + } + case mach::xb2: + { + contexts[game::s1][mach] = std::make_unique(); + contexts[game::s1][mach]->init(build::prod, fs_read); + break; + } + default: + throw std::runtime_error("not implemented"); } } -auto init_iw7() -> void +auto init_s2(mach mach) -> void { - if (!contexts.contains(game::iw7)) + if (contexts[game::s2].contains(mach)) return; + + switch (mach) { - contexts[game::iw7] = std::make_unique(); - contexts[game::iw7]->init(build::prod, fs_callback); + case mach::pc: + { + contexts[game::s2][mach] = std::make_unique(); + contexts[game::s2][mach]->init(build::prod, fs_read); + break; + } + default: + throw std::runtime_error("not implemented"); } } -auto init_iw8() -> void +auto init_s4(mach mach) -> void { - if (!contexts.contains(game::iw8)) + if (contexts[game::s4].contains(mach)) return; + + switch (mach) { - contexts[game::iw8] = std::make_unique(); - contexts[game::iw8]->init(build::prod, fs_callback); + case mach::pc: + { + contexts[game::s4][mach] = std::make_unique(); + contexts[game::s4][mach]->init(build::prod, fs_read); + break; + } + default: + throw std::runtime_error("not implemented"); } } -auto init_iw9() -> void +auto init_h1(mach mach) -> void { - if (!contexts.contains(game::iw9)) + if (contexts[game::h1].contains(mach)) return; + + switch (mach) { - contexts[game::iw9] = std::make_unique(); - contexts[game::iw9]->init(build::prod, fs_callback); + case mach::pc: + { + contexts[game::h1][mach] = std::make_unique(); + contexts[game::h1][mach]->init(build::prod, fs_read); + break; + } + default: + throw std::runtime_error("not implemented"); } } -auto init_s1() -> void +auto init_h2(mach mach) -> void { - if (!contexts.contains(game::s1)) + if (contexts[game::h2].contains(mach)) return; + + switch (mach) { - contexts[game::s1] = std::make_unique(); - contexts[game::s1]->init(build::prod, fs_callback); + case mach::pc: + { + contexts[game::h2][mach] = std::make_unique(); + contexts[game::h2][mach]->init(build::prod, fs_read); + break; + } + default: + throw std::runtime_error("not implemented"); } } -auto init_s1_ps() -> void -{ - if (!contexts.contains(game::s1ps)) - { - contexts[game::s1ps] = std::make_unique(); - contexts[game::s1ps]->init(build::prod, fs_callback); - } -} - -auto init_s1_xb() -> void -{ - if (!contexts.contains(game::s1xb)) - { - contexts[game::s1xb] = std::make_unique(); - contexts[game::s1xb]->init(build::prod, fs_callback); - } -} - -auto init_s2() -> void -{ - if (!contexts.contains(game::s2)) - { - contexts[game::s2] = std::make_unique(); - contexts[game::s2]->init(build::prod, fs_callback); - } -} - -auto init_s4() -> void -{ - if (!contexts.contains(game::s4)) - { - contexts[game::s4] = std::make_unique(); - contexts[game::s4]->init(build::prod, fs_callback); - } -} - -auto init_h1() -> void -{ - if (!contexts.contains(game::h1)) - { - contexts[game::h1] = std::make_unique(); - contexts[game::h1]->init(build::prod, fs_callback); - } -} - -auto init_h2() -> void -{ - if (!contexts.contains(game::h2)) - { - contexts[game::h2] = std::make_unique(); - contexts[game::h2]->init(build::prod, fs_callback); - } -} - -auto init(game game) -> void +auto init(game game, mach mach) -> void { funcs[mode::assemble] = assemble_file; funcs[mode::disassemble] = disassemble_file; @@ -626,24 +658,23 @@ auto init(game game) -> void funcs[mode::parse] = parse_file; funcs[mode::rename] = rename_file; + if (!contexts.contains(game)) + { + contexts.insert({ game, std::map>() }); + } + switch (game) { - case game::iw5: init_iw5(); break; - case game::iw5ps: init_iw5_ps(); break; - case game::iw5xb: init_iw5_xb(); break; - case game::iw6: init_iw6(); break; - case game::iw6ps: init_iw6_ps(); break; - case game::iw6xb: init_iw6_xb(); break; - case game::iw7: init_iw7(); break; - case game::iw8: init_iw8(); break; - case game::iw9: init_iw9(); break; - case game::s1: init_s1(); break; - case game::s1ps: init_s1_ps(); break; - case game::s1xb: init_s1_xb(); break; - case game::s2: init_s2(); break; - case game::s4: init_s4(); break; - case game::h1: init_h1(); break; - case game::h2: init_h2(); break; + case game::iw5: init_iw5(mach); break; + case game::iw6: init_iw6(mach); break; + case game::iw7: init_iw7(mach); break; + case game::iw8: init_iw8(mach); break; + case game::iw9: init_iw9(mach); break; + case game::s1: init_s1(mach); break; + case game::s2: init_s2(mach); break; + case game::s4: init_s4(mach); break; + case game::h1: init_h1(mach); break; + case game::h2: init_h2(mach); break; default: break; } } @@ -653,24 +684,26 @@ auto init(game game) -> void namespace arc { -std::map> contexts; -std::map> funcs; +std::map>> contexts; +std::map> funcs; -void assemble_file(game game, fs::path const& file, fs::path rel) +void assemble_file(game game, mach mach, fs::path const& file, fs::path rel) { try { + if (game != game::t6) + throw std::runtime_error("not implemented"); + if (file.extension() != ".gscasm" && file.extension() != ".cscasm") throw std::runtime_error("expected .gscasm or .cscasm file"); rel = fs::path{ games_rev.at(game) } / rel / file.filename().replace_extension((file.extension() == ".gscasm" ? ".gsc" : ".csc")); - auto& assembler = contexts[game]->assembler(); - auto data = utils::file::read(file); - assembler.assemble(file.string(), data); + auto outasm = contexts[game][mach]->source().parse_assembly(data); + auto outbin = contexts[game][mach]->assembler().assemble(*outasm); - utils::file::save(fs::path{ "assembled" } / rel, assembler.output()); + utils::file::save(fs::path{ "assembled" } / rel, outbin.data, outbin.size); std::cout << fmt::format("assembled {}\n", rel.generic_string()); } catch (std::exception const& e) @@ -679,68 +712,45 @@ void assemble_file(game game, fs::path const& file, fs::path rel) } } -void disassemble_file(game game, fs::path const& file, fs::path rel) +void disassemble_file(game game, mach mach, fs::path const& file, fs::path rel) { try { - if (file.extension() != ".gsc" && file.extension() != ".csc") + if (file.extension() != ".gsc" && file.extension() != ".csc" && file.extension() != ".gscc" && file.extension() != ".cscc") throw std::runtime_error("expected .gsc or .csc file"); rel = fs::path{ games_rev.at(game) } / rel / file.filename().replace_extension((file.extension() == ".gsc" ? ".gscasm" : ".cscasm")); - auto& disassembler = contexts[game]->disassembler(); - auto data = utils::file::read(file.string()); - disassembler.disassemble(file.string(), data); + auto outasm = contexts[game][mach]->disassembler().disassemble(data); + auto outsrc = contexts[game][mach]->source().dump(*outasm); - utils::file::save(fs::path{ "disassembled" } / rel, disassembler.output_raw()); + utils::file::save(fs::path{ "disassembled" } / rel, outsrc); std::cout << fmt::format("disassembled {}\n", rel.generic_string()); } catch (std::exception const& e) { std::cerr << fmt::format("{} at {}\n", e.what(), file.generic_string()); } - //try - // { - // if (file.extension() != ".gsc" && file.extension() != ".csc" && file.extension() != ".gscc" && file.extension() != ".cscc") - // throw std::runtime_error("expected .gsc or .csc file"); - - // rel = fs::path{ games_rev.at(game) } / rel / file.filename().replace_extension((file.extension() == ".gsc" ? ".gscasm" : ".cscasm")); - - // auto data = utils::file::read(file.string()); - // auto outasm = contexts[game]->disassembler().disassemble(data); - // auto outsrc = contexts[game]->source().dump(*outasm); - - // utils::file::save(fs::path{ "disassembled" } / rel, outsrc); - // std::cout << fmt::format("disassembled {}\n", rel.generic_string()); - // } - // catch (std::exception const& e) - // { - // std::cerr << fmt::format("{} at {}\n", e.what(), file.generic_string()); - // } } -void compile_file(game game, fs::path const& file, fs::path rel) +void compile_file(game game, mach mach, fs::path const& file, fs::path rel) { try { + if (game != game::t6) + throw std::runtime_error("not implemented"); + if (file.extension() != ".gsc" && file.extension() != ".csc") throw std::runtime_error("expected .gsc or .csc file"); rel = fs::path{ games_rev.at(game) } / rel / file.filename(); - auto& assembler = contexts[game]->assembler(); - auto& compiler = contexts[game]->compiler(); - auto data = utils::file::read(file); + auto outasm = contexts[game][mach]->compiler().compile(file.string(), data); + auto outbin = contexts[game][mach]->assembler().assemble(*outasm); - compiler.compile(file.string(), data); - - auto assembly = compiler.output(); - - assembler.assemble(file.string(), assembly); - - utils::file::save(fs::path{ "compiled" } / rel, assembler.output()); + utils::file::save(fs::path{ "compiled" } / rel, outbin.data, outbin.size); std::cout << fmt::format("compiled {}\n", rel.generic_string()); } catch (std::exception const& e) @@ -749,102 +759,136 @@ void compile_file(game game, fs::path const& file, fs::path rel) } } -void decompile_file(game game, fs::path const& file, fs::path rel) +void decompile_file(game game, mach mach, fs::path const& file, fs::path rel) { try { - if (file.extension() != ".gsc" && file.extension() != ".csc") + if (file.extension() != ".gsc" && file.extension() != ".csc" && file.extension() != ".gscc" && file.extension() != ".cscc") throw std::runtime_error("expected .gsc or .csc file"); rel = fs::path{ games_rev.at(game) } / rel / file.filename(); - auto& disassembler = contexts[game]->disassembler(); - auto& decompiler = contexts[game]->decompiler(); - auto data = utils::file::read(file); - disassembler.disassemble(file.string(), data); + auto outasm = contexts[game][mach]->disassembler().disassemble(data); + auto outsrc = contexts[game][mach]->decompiler().decompile(*outasm); + auto output = contexts[game][mach]->source().dump(*outsrc); - auto output = disassembler.output(); - - decompiler.decompile(file.string(), output); - - utils::file::save(fs::path{ "decompiled" } / rel, decompiler.output()); + utils::file::save(fs::path{ "decompiled" } / rel, output); std::cout << fmt::format("decompiled {}\n", rel.generic_string()); } catch (std::exception const& e) { std::cerr << fmt::format("{} at {}\n", e.what(), file.generic_string()); } - // try - // { - // if (file.extension() != ".gsc" && file.extension() != ".csc" && file.extension() != ".gscc" && file.extension() != ".cscc") - // throw std::runtime_error("expected .gsc or .csc file"); - - // rel = fs::path{ games_rev.at(game) } / rel / file.filename(); - - // auto data = utils::file::read(file); - - // auto outasm = contexts[game]->disassembler().disassemble(data); - // auto outsrc = contexts[game]->decompiler().decompile(*outasm); - // auto output = contexts[game]->source().dump(*outsrc); - - // utils::file::save(fs::path{ "decompiled" } / rel, output); - // std::cout << fmt::format("decompiled {}\n", rel.generic_string()); - // } - // catch (std::exception const& e) - // { - // std::cerr << fmt::format("{} at {}\n", e.what(), file.generic_string()); - // } } -void parse_file(game, fs::path const&, fs::path) +void parse_file(game, mach, fs::path const&, fs::path) { - std::cerr << fmt::format("not implemented for t6\n"); + std::cerr << fmt::format("not implemented for treyarch\n"); } -void rename_file(game, fs::path const&, fs::path) +void rename_file(game, mach, fs::path const&, fs::path) { - std::cerr << fmt::format("not implemented for t6\n"); + std::cerr << fmt::format("not implemented for treyarch\n"); } -auto init_t6() -> void +auto fs_read(std::string const& name) -> std::vector { - if (!contexts.contains(game::t6)) + return utils::file::read(fs::path{ name }); +} + +auto init_t6(mach mach) -> void +{ + if (contexts[game::t6].contains(mach)) return; + + switch (mach) { - contexts[game::t6] = std::make_unique(); - contexts[game::t6]->init(build::prod, nullptr/*utils::file::read*/); + case mach::pc: + { + contexts[game::t6][mach] = std::make_unique(); + contexts[game::t6][mach]->init(build::prod, fs_read); + break; + } + case mach::ps3: + { + contexts[game::t6][mach] = std::make_unique(); + contexts[game::t6][mach]->init(build::prod, fs_read); + break; + } + case mach::xb2: + { + contexts[game::t6][mach] = std::make_unique(); + contexts[game::t6][mach]->init(build::prod, fs_read); + break; + } + case mach::wiiu: + { + contexts[game::t6][mach] = std::make_unique(); + contexts[game::t6][mach]->init(build::prod, fs_read); + break; + } + default: + throw std::runtime_error("not implemented"); } } -auto init_t7() -> void +auto init_t7(mach mach) -> void { - // if (!contexts.contains(game::t7)) + if (contexts[game::t7].contains(mach)) return; + + switch (mach) + { + case mach::pc: + { + contexts[game::t7][mach] = std::make_unique(); + contexts[game::t7][mach]->init(build::prod, fs_read); + break; + } + default: + throw std::runtime_error("not implemented"); + } +} + +auto init_t8(mach /*mach*/) -> void +{ + throw std::runtime_error("not implemented"); + + // if (contexts[game::t8].contains(mach)) return; + + // switch (mach) // { - // contexts[game::t7] = std::make_unique(); - // contexts[game::t7]->init(build::prod, nullptr); + // case mach::pc: + // { + // contexts[game::t8][mach] = std::make_unique(); + // contexts[game::t8][mach]->init(build::prod, fs_read); + // break; + // } + // default: + // throw std::runtime_error("not implemented"); // } } -auto init_t8() -> void +auto init_t9(mach /*mach*/) -> void { - // if (!contexts.contains(game::t8)) + throw std::runtime_error("not implemented"); + + // if (contexts[game::t9].contains(mach)) return; + + // switch (mach) // { - // contexts[game::t8] = std::make_unique(); - // contexts[game::t8]->init(build::prod, nullptr/*utils::file::read*/); + // case mach::pc: + // { + // contexts[game::t9][mach] = std::make_unique(); + // contexts[game::t9][mach]->init(build::prod, fs_read); + // break; + // } + // default: + // throw std::runtime_error("not implemented"); // } } -auto init_t9() -> void -{ - // if (!contexts.contains(game::t9)) - // { - // contexts[game::t9] = std::make_unique(); - // contexts[game::t9]->init(build::prod, nullptr/*utils::file::read*/); - // } -} - -auto init(game game) -> void +auto init(game game, mach mach) -> void { funcs[mode::assemble] = assemble_file; funcs[mode::disassemble] = disassemble_file; @@ -853,22 +897,27 @@ auto init(game game) -> void funcs[mode::parse] = parse_file; funcs[mode::rename] = rename_file; + if (!contexts.contains(game)) + { + contexts.insert({ game, std::map>() }); + } + switch (game) { - case game::t6: init_t6(); break; - case game::t7: init_t7(); break; - case game::t8: init_t8(); break; - case game::t9: init_t9(); break; + case game::t6: init_t6(mach); break; + case game::t7: init_t7(mach); break; + case game::t8: init_t8(mach); break; + case game::t9: init_t9(mach); break; default: break; } } } // namespace xsk::arc -auto execute(mode mode, game game, fs::path const& path) -> void +auto execute(mode mode, game game, mach mach, fs::path const& path) -> void { - gsc::init(game); - arc::init(game); + gsc::init(game, mach); + arc::init(game, mach); if (fs::is_directory(path)) { @@ -879,18 +928,18 @@ auto execute(mode mode, game game, fs::path const& path) -> void auto rel = fs::relative(entry, path).remove_filename(); if (game < game::t6) - gsc::funcs[mode](game, entry.path().generic_string(), rel); + gsc::funcs[mode](game, mach, entry.path().generic_string(), rel); else - arc::funcs[mode](game, fs::path{ entry.path().generic_string(), fs::path::format::generic_format }, rel); + arc::funcs[mode](game, mach, fs::path{ entry.path().generic_string(), fs::path::format::generic_format }, rel); } } } else if (fs::is_regular_file(path)) { if (game < game::t6) - gsc::funcs[mode](game, path, fs::path{}); + gsc::funcs[mode](game, mach, path, fs::path{}); else - arc::funcs[mode](game, fs::path(path, fs::path::format::generic_format), fs::path{}); + arc::funcs[mode](game, mach, fs::path(path, fs::path::format::generic_format), fs::path{}); } else { @@ -898,9 +947,9 @@ auto execute(mode mode, game game, fs::path const& path) -> void } } -auto parse_flags(u32 argc, char** argv, game& game, mode& mode, fs::path& path) -> bool +auto parse_flags(u32 argc, char** argv, mode& mode, game& game, mach& mach, fs::path& path) -> bool { - if (argc != 4) return false; + if (argc != 5) return false; auto arg = utils::string::to_lower(argv[1]); @@ -910,11 +959,11 @@ auto parse_flags(u32 argc, char** argv, game& game, mode& mode, fs::path& path) gsc::zonetool = true; } - auto const it = modes.find(arg); + auto const it1 = modes.find(arg); - if (it != modes.end()) + if (it1 != modes.end()) { - mode = it->second; + mode = it1->second; } else { @@ -924,11 +973,11 @@ auto parse_flags(u32 argc, char** argv, game& game, mode& mode, fs::path& path) arg = utils::string::to_lower(argv[2]); - auto const itr = games.find(arg); + auto const it2 = games.find(arg); - if (itr != games.end()) + if (it2 != games.end()) { - game = itr->second; + game = it2->second; } else { @@ -936,17 +985,35 @@ auto parse_flags(u32 argc, char** argv, game& game, mode& mode, fs::path& path) return false; } - path = fs::path{ utils::string::fordslash(argv[3]), fs::path::format::generic_format }; + arg = utils::string::to_lower(argv[3]); + + auto const it3 = machs.find(arg); + + if (it3 != machs.end()) + { + mach = it3->second; + + if (mach == mach::ps4 || mach == mach::ps5 || mach == mach::xb3 || mach == mach::xb4) + mach = mach::pc; + } + else + { + std::cout << "[ERROR] unknown system '" << argv[3] << "'.\n\n"; + return false; + } + + path = fs::path{ utils::string::fordslash(argv[4]), fs::path::format::generic_format }; return true; } auto print_usage() -> void { - std::cout << "usage: gsc-tool \n"; - std::cout << "\t* modes: asm, disasm, comp, decomp, parse\n"; - std::cout << "\t* games: iw5ps, iw5xb, iw6ps, iw6xb, s1ps, s1xb, iw5, iw6, iw7, iw8, iw9, s1, s2, s4, h1, h2, t6\n"; - std::cout << "\t* paths: file or directory (recursive)\n"; + std::cout << "usage: gsc-tool \n"; + std::cout << "\t* mode: asm, disasm, comp, decomp, parse, rename\n"; + std::cout << "\t* game: iw5, iw6, iw7, iw8, iw9, s1, s2, s4, h1, h2, t6, t7, t8, t9\n"; + std::cout << "\t* system: pc, ps3, ps4, ps5, xb2 (360), xb3 (One), xb4 (Series X|S), wiiu\n"; + std::cout << "\t* path: file or directory (recursive)\n"; std::cin.get(); } @@ -955,13 +1022,14 @@ auto main(u32 argc, char** argv) -> void auto path = fs::path{}; auto mode = mode::_; auto game = game::_; + auto mach = mach::_; - if (!parse_flags(argc, argv, game, mode, path)) + if (!parse_flags(argc, argv, mode, game, mach, path)) { return print_usage(); } - execute(mode, game, path); + execute(mode, game, mach, path); } } // namespace xsk