From 2f402a10cc8ad4e47aeaec44729df2450d890865 Mon Sep 17 00:00:00 2001 From: xensik Date: Fri, 18 Feb 2022 19:07:37 +0100 Subject: [PATCH] blackops2 implementation --- .gitignore | 1 + README.md | 4 +- gen/t6/Makefile | 9 + gen/t6/parser.ypp | 968 +++ premake5.lua | 22 +- src/t6/stdafx.cpp | 6 + src/t6/stdafx.hpp | 39 + src/t6/xsk/assembler.cpp | 886 +++ src/t6/xsk/assembler.hpp | 48 + src/t6/xsk/compiler.cpp | 2473 +++++++ src/t6/xsk/compiler.hpp | 172 + src/t6/xsk/decompiler.cpp | 2657 +++++++ src/t6/xsk/decompiler.hpp | 98 + src/t6/xsk/disassembler.cpp | 644 ++ src/t6/xsk/disassembler.hpp | 48 + src/t6/xsk/lexer.cpp | 890 +++ src/t6/xsk/lexer.hpp | 72 + src/t6/xsk/parser.cpp | 5178 ++++++++++++++ src/t6/xsk/parser.hpp | 6277 +++++++++++++++++ src/t6/xsk/resolver.cpp | 3577 ++++++++++ src/t6/xsk/resolver.hpp | 23 + src/t6/xsk/t6.cpp | 153 + src/t6/xsk/t6.hpp | 154 + src/utils/xsk/arc/block.hpp | 24 + src/utils/xsk/arc/interfaces/assembler.hpp | 22 + src/utils/xsk/arc/interfaces/compiler.hpp | 23 + src/utils/xsk/arc/interfaces/decompiler.hpp | 21 + src/utils/xsk/arc/interfaces/disassembler.hpp | 22 + src/utils/xsk/arc/interfaces/exception.hpp | 46 + src/utils/xsk/arc/location.hpp | 229 + src/utils/xsk/arc/nodetree.cpp | 1917 +++++ src/utils/xsk/arc/nodetree.hpp | 1924 +++++ src/utils/xsk/arc/types.hpp | 179 + src/utils/xsk/gsc/nodetree.cpp | 2 +- src/utils/xsk/utils.hpp | 13 + 35 files changed, 28817 insertions(+), 4 deletions(-) create mode 100644 gen/t6/Makefile create mode 100644 gen/t6/parser.ypp create mode 100644 src/t6/stdafx.cpp create mode 100644 src/t6/stdafx.hpp create mode 100644 src/t6/xsk/assembler.cpp create mode 100644 src/t6/xsk/assembler.hpp create mode 100644 src/t6/xsk/compiler.cpp create mode 100644 src/t6/xsk/compiler.hpp create mode 100644 src/t6/xsk/decompiler.cpp create mode 100644 src/t6/xsk/decompiler.hpp create mode 100644 src/t6/xsk/disassembler.cpp create mode 100644 src/t6/xsk/disassembler.hpp create mode 100644 src/t6/xsk/lexer.cpp create mode 100644 src/t6/xsk/lexer.hpp create mode 100644 src/t6/xsk/parser.cpp create mode 100644 src/t6/xsk/parser.hpp create mode 100644 src/t6/xsk/resolver.cpp create mode 100644 src/t6/xsk/resolver.hpp create mode 100644 src/t6/xsk/t6.cpp create mode 100644 src/t6/xsk/t6.hpp create mode 100644 src/utils/xsk/arc/block.hpp create mode 100644 src/utils/xsk/arc/interfaces/assembler.hpp create mode 100644 src/utils/xsk/arc/interfaces/compiler.hpp create mode 100644 src/utils/xsk/arc/interfaces/decompiler.hpp create mode 100644 src/utils/xsk/arc/interfaces/disassembler.hpp create mode 100644 src/utils/xsk/arc/interfaces/exception.hpp create mode 100644 src/utils/xsk/arc/location.hpp create mode 100644 src/utils/xsk/arc/nodetree.cpp create mode 100644 src/utils/xsk/arc/nodetree.hpp create mode 100644 src/utils/xsk/arc/types.hpp diff --git a/.gitignore b/.gitignore index 20c8ebb5..df966942 100644 --- a/.gitignore +++ b/.gitignore @@ -158,3 +158,4 @@ data/h2/ data/s1/ data/s2/ data/s4/ +data/t6/ diff --git a/README.md b/README.md index c17c4f50..e61d5415 100644 --- a/README.md +++ b/README.md @@ -16,13 +16,13 @@ A utility to compile & decompile IW engine game scripts. - **H2** *(Call of Duty: Modern Warfare 2 Campaign Remastered)* - **T4** *(Call of Duty: World at War)* ***\*WIP\**** - **T5** *(Call of Duty: Black Ops)* ***\*WIP\**** -- **T6** *(Call of Duty: Black Ops II)* ***\*WIP\**** +- **T6** *(Call of Duty: Black Ops II)* ## Usage ``./gsc-tool.exe `` **modes**: `asm`, `disasm`, `comp`, `decomp` -**games**: `iw5`, `iw6`, `iw7`, `iw8`, `s1`, `s2`, `s4`, `h1`, `h2` +**games**: `iw5`, `iw6`, `iw7`, `iw8`, `s1`, `s2`, `s4`, `h1`, `h2`, `t6` **paths**: `file`, `directory` (recursive process all files with mode extension) diff --git a/gen/t6/Makefile b/gen/t6/Makefile new file mode 100644 index 00000000..89a4e28b --- /dev/null +++ b/gen/t6/Makefile @@ -0,0 +1,9 @@ +generate: T6 + +clean: + rm -rf ./parser.hpp + rm -rf ./parser.cpp + +T6: parser.ypp + bison parser.ypp -Wcounterexamples + mv parser.hpp parser.cpp ../../src/t6/xsk/ diff --git a/gen/t6/parser.ypp b/gen/t6/parser.ypp new file mode 100644 index 00000000..938b3130 --- /dev/null +++ b/gen/t6/parser.ypp @@ -0,0 +1,968 @@ +/* Copyright 2022 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 {T6} +%define api.namespace {xsk::arc::t6} +%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::t6::lexer& lexer } +%parse-param { xsk::arc::t6::lexer& lexer } +%parse-param { xsk::arc::ast::program::ptr& ast } + +%code requires +{ +#include "t6.hpp" +namespace xsk::arc::t6 { class lexer; } +} + +%code top +{ +#include "stdafx.hpp" +#include "parser.hpp" +#include "lexer.hpp" +using namespace xsk::arc; +xsk::arc::t6::parser::symbol_type T6lex(xsk::arc::t6::lexer& lexer); +} + +%token SH_DEFINE "#define" +%token SH_UNDEF "#undef" +%token SH_IFDEF "#ifdef" +%token SH_IFNDEF "#ifndef" +%token SH_IF "#if" +%token SH_ELIF "#elif" +%token SH_ELSE "#else" +%token SH_ENDIF "#endif" +%token DEVBEGIN "/#" +%token DEVEND "#/" +%token INLINE "#inline" +%token INCLUDE "#include" +%token USINGTREE "#using_animtree" +%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 BREAKPOINT "breakpoint" +%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 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 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 FIELD "field" +%token PATH "path" +%token IDENTIFIER "identifier" +%token STRING "string literal" +%token ISTRING "localized string" +%token HASH "hash" +%token FLOAT "float" +%token INTEGER "integer" + +%type program +%type include +%type declaration +%type decl_usingtree +%type decl_constant +%type decl_thread +%type stmt +%type stmt_or_dev +%type stmt_list +%type stmt_or_dev_list +%type stmt_dev +%type stmt_block +%type stmt_expr +%type stmt_call +%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_breakpoint +%type stmt_prof_begin +%type stmt_prof_end +%type expr +%type expr_or_empty +%type expr_assign +%type expr_increment +%type expr_decrement +%type expr_ternary +%type expr_binary +%type expr_primitive +%type expr_complement +%type expr_not +%type expr_call +%type expr_method +%type expr_function +%type expr_pointer +%type expr_parameters +%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_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 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 = std::make_unique(@$); } + ; + +program + : 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)); } + | inline + { $$ = std::make_unique(@$); } + | include + { $$ = std::make_unique(@$); $$->includes.push_back(std::move($1)); } + | declaration + { $$ = std::make_unique(@$); $$->declarations.push_back(std::move($1)); } + ; + +inline + : INLINE expr_path SEMICOLON { lexer.push_header($2->value); } + ; + +include + : INCLUDE expr_path SEMICOLON + { $$ = std::make_unique(@$, std::move($2)); } + ; + +declaration + : DEVBEGIN { $$.as_dev_begin = std::make_unique(@$); } + | DEVEND { $$.as_dev_end = std::make_unique(@$); } + | decl_usingtree { $$.as_usingtree = std::move($1); } + | decl_constant { $$.as_constant = std::move($1); } + | decl_thread { $$.as_thread = std::move($1); } + ; + +decl_usingtree + : USINGTREE LPAREN expr_string RPAREN SEMICOLON + { lexer.ban_header(@$); $$ = std::make_unique(@$, std::move($3)); } + ; + +decl_constant + : expr_identifier ASSIGN expr SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +decl_thread + : expr_identifier LPAREN expr_parameters RPAREN stmt_block + { lexer.ban_header(@$); $$ = std::make_unique(@$, std::move($1), std::move($3), std::move($5)); } + ; + +stmt + : stmt_block { $$.as_list = std::move($1); } + | stmt_call { $$.as_call = std::move($1); } + | stmt_assign { $$.as_assign = std::move($1); } + | stmt_endon { $$.as_endon = std::move($1); } + | stmt_notify { $$.as_notify = std::move($1); } + | stmt_wait { $$.as_wait = std::move($1); } + | stmt_waittill { $$.as_waittill = std::move($1); } + | stmt_waittillmatch { $$.as_waittillmatch = std::move($1); } + | stmt_waittillframeend { $$.as_waittillframeend = std::move($1); } + | stmt_if { $$.as_if = std::move($1); } + | stmt_ifelse { $$.as_ifelse = std::move($1); } + | stmt_while { $$.as_while = std::move($1); } + | stmt_dowhile { $$.as_dowhile = std::move($1); } + | stmt_for { $$.as_for = std::move($1); } + | stmt_foreach { $$.as_foreach = std::move($1); } + | stmt_switch { $$.as_switch = std::move($1); } + | stmt_case { $$.as_case = std::move($1); } + | stmt_default { $$.as_default = std::move($1); } + | stmt_break { $$.as_break = std::move($1); } + | stmt_continue { $$.as_continue = std::move($1); } + | stmt_return { $$.as_return = std::move($1); } + | stmt_breakpoint { $$.as_breakpoint = std::move($1); } + | stmt_prof_begin { $$.as_prof_begin = std::move($1); } + | stmt_prof_end { $$.as_prof_end = std::move($1); } + ; + +stmt_or_dev + : stmt { $$ = std::move($1); } + | stmt_dev { $$.as_dev = std::move($1); } + ; + +stmt_list + : stmt_list stmt + { $$ = std::move($1); $$->list.push_back(std::move($2)); } + | stmt + { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } + ; + +stmt_or_dev_list + : stmt_or_dev_list stmt_or_dev + { $$ = std::move($1); $$->list.push_back(std::move($2)); } + | stmt_or_dev + { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } + ; + +stmt_dev + : DEVBEGIN stmt_list DEVEND { $$ = std::make_unique(@$, std::move($2)); } + | DEVBEGIN DEVEND { $$ = std::make_unique(@$, std::make_unique(@$)); } + ; + +stmt_block + : LBRACE stmt_or_dev_list RBRACE { $$ = std::move($2); } + | LBRACE RBRACE { $$ = std::make_unique(@$); } + ; + +stmt_expr + : expr_assign + { $$ = std::make_unique(@$, std::move($1)); } + | expr_increment + { $$ = std::make_unique(@$, std::move($1)); } + | expr_decrement + { $$ = std::make_unique(@$, std::move($1)); } + | + { $$ = std::make_unique(@$, std::make_unique(@$)); } + ; + +stmt_call + : expr_call SEMICOLON + { $$ = std::make_unique(@$, ast::expr(std::move($1))); } + | expr_method SEMICOLON + { $$ = std::make_unique(@$, ast::expr(std::move($1))); } + ; + +stmt_assign + : expr_assign SEMICOLON + { $$ = std::make_unique(@$, std::move($1)); } + | expr_increment SEMICOLON + { $$ = std::make_unique(@$, std::move($1)); } + | expr_decrement SEMICOLON + { $$ = std::make_unique(@$, std::move($1)); } + ; + +stmt_endon + : expr_object ENDON LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4)); } + ; + +stmt_notify + : expr_object NOTIFY LPAREN expr COMMA expr_arguments_no_empty RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::move($6)); } + | expr_object NOTIFY LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::make_unique(@$)); } + ; + +stmt_wait + : WAIT expr SEMICOLON + { $$ = std::make_unique(@$, std::move($2)); } + ; + +stmt_waittill + : expr_object WAITTILL LPAREN expr COMMA expr_arguments_no_empty RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::move($6)); } + | expr_object WAITTILL LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::make_unique(@$)); } + ; + +stmt_waittillmatch + : expr_object WAITTILLMATCH LPAREN expr COMMA expr_arguments_no_empty RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::move($6)); } + | expr_object WAITTILLMATCH LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($1), std::move($4), std::make_unique(@$)); } + ; + +stmt_waittillframeend + : WAITTILLFRAMEEND SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_if + : IF LPAREN expr RPAREN stmt %prec THEN + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +stmt_ifelse + : IF LPAREN expr RPAREN stmt ELSE stmt + { $$ = std::make_unique(@$, std::move($3), std::move($5), std::move($7)); } + ; + +stmt_while + : WHILE LPAREN expr RPAREN stmt + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +stmt_dowhile + : DO stmt WHILE LPAREN expr RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($5), std::move($2)); } + ; + +stmt_for + : FOR LPAREN stmt_expr SEMICOLON expr_or_empty SEMICOLON stmt_expr RPAREN stmt + { $$ = std::make_unique(@$, ast::stmt(std::move($3)), std::move($5), ast::stmt(std::move($7)), std::move($9)); } + ; + +stmt_foreach + : FOREACH LPAREN expr_identifier IN expr RPAREN stmt + { $$ = std::make_unique(@$, ast::expr(std::move($3)), std::move($5), std::move($7)); } + | FOREACH LPAREN expr_identifier COMMA expr_identifier IN expr RPAREN stmt + { $$ = std::make_unique(@$, ast::expr(std::move($3)), ast::expr(std::move($5)), std::move($7), std::move($9)); } + ; + +stmt_switch + : SWITCH LPAREN expr RPAREN stmt_block + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +stmt_case + : CASE expr_integer COLON + { $$ = std::make_unique(@$, ast::expr(std::move($2)), std::make_unique(@$)); } + | CASE expr_string COLON + { $$ = std::make_unique(@$, ast::expr(std::move($2)), std::make_unique(@$)); } + ; + +stmt_default + : DEFAULT COLON + { $$ = std::make_unique(@$, std::make_unique(@$)); } + ; + +stmt_break + : BREAK SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_continue + : CONTINUE SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_return + : RETURN expr SEMICOLON + { $$ = std::make_unique(@$, std::move($2)); } + | RETURN SEMICOLON + { $$ = std::make_unique(@$, std::make_unique(@$)); } + ; + +stmt_breakpoint + : BREAKPOINT SEMICOLON + { $$ = std::make_unique(@$); } + ; + +stmt_prof_begin + : PROFBEGIN LPAREN expr_arguments RPAREN SEMICOLON + { $$ = std::make_unique(@$, std::move($3)); } + ; + +stmt_prof_end + : PROFEND LPAREN expr_arguments RPAREN SEMICOLON + { $$ = std::make_unique(@$, 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); } + | { $$.as_node = std::make_unique(@$); } + ; + +expr_assign + : expr_object ASSIGN expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr_object ASSIGN_BW_OR expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr_object ASSIGN_BW_AND expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr_object ASSIGN_BW_EXOR expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr_object ASSIGN_LSHIFT expr + { $$.as_node = std::make_unique(@$, std::move($1),std::move( $3)); } + | expr_object ASSIGN_RSHIFT expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr_object ASSIGN_ADD expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr_object ASSIGN_SUB expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr_object ASSIGN_MUL expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr_object ASSIGN_DIV expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr_object ASSIGN_MOD expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_increment + : INCREMENT expr_object %prec PREINC + { $$.as_node = std::make_unique(@$, std::move($2), true); } + | expr_object INCREMENT %prec POSTINC + { $$.as_node = std::make_unique(@$, std::move($1), false); } + ; + +expr_decrement + : DECREMENT expr_object %prec PREDEC + { $$.as_node = std::make_unique(@$, std::move($2), true); } + | expr_object DECREMENT %prec POSTDEC + { $$.as_node = std::make_unique(@$, std::move($1), false); } + ; + +expr_ternary + : expr QMARK expr COLON expr %prec TERN + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3), std::move($5)); } + ; + +expr_binary + : expr OR expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr AND expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr EQUALITY expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr INEQUALITY expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr LESS_EQUAL expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr GREATER_EQUAL expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr LESS expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr GREATER expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr BITWISE_OR expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr BITWISE_AND expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr BITWISE_EXOR expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr LSHIFT expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr RSHIFT expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr ADD expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr SUB expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr MUL expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr DIV expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + | expr MOD expr + { $$.as_node = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_primitive + : expr_complement { $$.as_node = std::move($1); } + | expr_not { $$.as_node = std::move($1); } + | expr_call { $$.as_node = std::move($1); } + | expr_method { $$.as_node = std::move($1); } + | expr_getnextarraykey { $$.as_node = std::move($1); } + | expr_getfirstarraykey { $$.as_node = std::move($1); } + | expr_getdvarcoloralpha { $$.as_node = std::move($1); } + | expr_getdvarcolorblue { $$.as_node = std::move($1); } + | expr_getdvarcolorgreen { $$.as_node = std::move($1); } + | expr_getdvarcolorred { $$.as_node = std::move($1); } + | expr_getdvarvector { $$.as_node = std::move($1); } + | expr_getdvarfloat { $$.as_node = std::move($1); } + | expr_getdvarint { $$.as_node = std::move($1); } + | expr_getdvar { $$.as_node = std::move($1); } + | expr_gettime { $$.as_node = std::move($1); } + | expr_abs { $$.as_node = std::move($1); } + | expr_vectortoangles { $$.as_node = std::move($1); } + | expr_angleclamp180 { $$.as_node = std::move($1); } + | expr_anglestoforward { $$.as_node = std::move($1); } + | expr_anglestoright { $$.as_node = std::move($1); } + | expr_anglestoup { $$.as_node = std::move($1); } + | expr_vectorscale { $$.as_node = std::move($1); } + | expr_isdefined { $$.as_node = std::move($1); } + | expr_reference { $$.as_node = std::move($1); } + | expr_array { $$.as_node = std::move($1); } + | expr_field { $$.as_node = std::move($1); } + | expr_size { $$.as_node = std::move($1); } + | expr_paren { $$.as_node = std::move($1); } + | expr_empty_array { $$.as_node = std::move($1); } + | expr_undefined { $$.as_node = std::move($1); } + | expr_game { $$.as_node = std::move($1); } + | expr_self { $$.as_node = std::move($1); } + | expr_anim { $$.as_node = std::move($1); } + | expr_level { $$.as_node = std::move($1); } + | expr_animation { $$.as_node = std::move($1); } + | expr_identifier { $$.as_node = std::move($1); } + | expr_istring { $$.as_node = std::move($1); } + | expr_string { $$.as_node = std::move($1); } + | expr_vector { $$.as_node = std::move($1); } + | expr_hash { $$.as_node = std::move($1); } + | expr_float { $$.as_node = std::move($1); } + | expr_integer { $$.as_node = std::move($1); } + | expr_false { $$.as_node = std::move($1); } + | expr_true { $$.as_node = std::move($1); } + ; + +expr_complement + : COMPLEMENT expr + { $$ = std::make_unique(@$, std::move($2)); } + ; + +expr_not + : NOT expr + { $$ = std::make_unique(@$, std::move($2)); } + ; + +expr_call + : expr_function { $$ = std::make_unique(@$, std::move($1)); } + | expr_pointer { $$ = std::make_unique(@$, std::move($1)); } + ; +expr_method + : expr_object expr_function { $$ = std::make_unique(@$, std::move($1), std::move($2)); } + | expr_object expr_pointer { $$ = std::make_unique(@$, std::move($1), std::move($2)); } + ; + +expr_function + : expr_identifier LPAREN expr_arguments RPAREN + { $$.as_function = std::make_unique(@$, std::make_unique(@$), std::move($1), std::move($3), ast::call::mode::normal); } + | expr_path DOUBLECOLON expr_identifier LPAREN expr_arguments RPAREN + { $$.as_function = std::make_unique(@$, std::move($1), std::move($3), std::move($5), ast::call::mode::normal); } + | THREAD expr_identifier LPAREN expr_arguments RPAREN + { $$.as_function = std::make_unique(@$, std::make_unique(@$), std::move($2), std::move($4), ast::call::mode::thread); } + | THREAD expr_path DOUBLECOLON expr_identifier LPAREN expr_arguments RPAREN + { $$.as_function = std::make_unique(@$, std::move($2), std::move($4), std::move($6), ast::call::mode::thread); } + ; + +expr_pointer + : LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN + { $$.as_pointer = std::make_unique(@$, std::move($3), std::move($7), ast::call::mode::normal); } + | THREAD LBRACKET LBRACKET expr RBRACKET RBRACKET LPAREN expr_arguments RPAREN + { $$.as_pointer = std::make_unique(@$, std::move($4), std::move($8), ast::call::mode::thread); } + ; + +expr_parameters + : expr_parameters COMMA expr_identifier + { $$ = std::move($1); $$->list.push_back(std::move($3)); } + | expr_identifier + { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } + | + { $$ = std::make_unique(@$); } + ; + +expr_arguments + : expr_arguments_no_empty + { $$ = std::move($1); } + | + { $$ = std::make_unique(@$); } + ; + +expr_arguments_no_empty + : expr_arguments COMMA expr + { $$ = std::move($1); $$->list.push_back(std::move($3)); } + | expr + { $$ = std::make_unique(@$); $$->list.push_back(std::move($1)); } + ; + +expr_getnextarraykey + : GETNEXTARRAYKEY LPAREN expr COMMA expr RPAREN + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +expr_getfirstarraykey + : GETFIRSTARRAYKEY LPAREN expr RPAREN + { $$ = std::make_unique(@$, std::move($3)); } + ; + +expr_getdvarcoloralpha + : GETDVARCOLORALPHA LPAREN expr RPAREN + { $$ = std::make_unique(@$, std::move($3)); } + ; + +expr_getdvarcolorblue + : GETDVARCOLORBLUE LPAREN expr RPAREN + { $$ = std::make_unique(@$, std::move($3)); } + ; + +expr_getdvarcolorgreen + : GETDVARCOLORGREEN LPAREN expr RPAREN + { $$ = std::make_unique(@$, std::move($3)); } + ; + +expr_getdvarcolorred + : GETDVARCOLORRED LPAREN expr RPAREN + { $$ = std::make_unique(@$, std::move($3)); } + ; + +expr_getdvarvector + : GETDVARVECTOR LPAREN expr RPAREN + { $$ = std::make_unique(@$, std::move($3)); } + ; + +expr_getdvarfloat + : GETDVARFLOAT LPAREN expr RPAREN + { $$ = std::make_unique(@$, std::move($3)); } + ; + +expr_getdvarint + : GETDVARINT LPAREN expr RPAREN + { $$ = std::make_unique(@$, std::move($3)); } + ; + +expr_getdvar + : GETDVAR LPAREN expr RPAREN + { $$ = std::make_unique(@$, std::move($3)); } + ; + +expr_gettime + : GETTIME LPAREN RPAREN + { $$ = std::make_unique(@$); } + ; + +expr_abs + : ABS LPAREN expr RPAREN + { $$ = std::make_unique(@$, std::move($3)); } + ; + +expr_vectortoangles + : VECTORTOANGLES LPAREN expr RPAREN + { $$ = std::make_unique(@$, std::move($3)); } + ; + +expr_angleclamp180 + : ANGLECLAMP180 LPAREN expr RPAREN + { $$ = std::make_unique(@$, std::move($3)); } + ; + +expr_anglestoforward + : ANGLESTOFORWARD LPAREN expr RPAREN + { $$ = std::make_unique(@$, std::move($3)); } + ; + +expr_anglestoright + : ANGLESTORIGHT LPAREN expr RPAREN + { $$ = std::make_unique(@$, std::move($3)); } + ; + +expr_anglestoup + : ANGLESTOUP LPAREN expr RPAREN + { $$ = std::make_unique(@$, std::move($3)); } + ; + +expr_vectorscale + : VECTORSCALE LPAREN expr COMMA expr RPAREN + { $$ = std::make_unique(@$, std::move($3), std::move($5)); } + ; + +expr_isdefined + : ISDEFINED LPAREN expr RPAREN + { $$ = std::make_unique(@$, std::move($3)); } + ; + +expr_reference + : DOUBLECOLON expr_identifier + { $$ = std::make_unique(@$, std::make_unique(@$), std::move($2)); } + | expr_path DOUBLECOLON expr_identifier + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_array + : expr_object LBRACKET expr RBRACKET + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + ; + +expr_field + : expr_object DOT expr_identifier + { $$ = std::make_unique(@$, std::move($1), std::move($3)); } + | expr_object FIELD + { $$ = std::make_unique(@$, std::move($1), std::make_unique(@$, $2)); } + ; + +expr_size + : expr_object SIZE + { $$ = std::make_unique(@$, std::move($1)); } + ; + +expr_paren + : LPAREN expr RPAREN + { $$ = std::make_unique(@$, std::move($2)); } + ; + +expr_object + : expr_call { $$.as_node = std::move($1); } + | expr_method { $$.as_node = std::move($1); } + | expr_array { $$.as_node = std::move($1); } + | expr_field { $$.as_node = std::move($1); } + | expr_game { $$.as_node = std::move($1); } + | expr_self { $$.as_node = std::move($1); } + | expr_anim { $$.as_node = std::move($1); } + | expr_level { $$.as_node = std::move($1); } + | expr_identifier { $$.as_node = std::move($1); } + ; + +expr_empty_array + : LBRACKET RBRACKET + { $$ = std::make_unique(@$); }; + ; + +expr_undefined + : UNDEFINED + { $$ = std::make_unique(@$); }; + ; + +expr_game + : GAME + { $$ = std::make_unique(@$); }; + ; + +expr_self + : SELF + { $$ = std::make_unique(@$); }; + ; + +expr_anim + : ANIM + { $$ = std::make_unique(@$); }; + ; + +expr_level + : LEVEL + { $$ = std::make_unique(@$); }; + ; + +expr_animation + : MOD IDENTIFIER %prec ANIMREF + { $$ = std::make_unique(@$, $2); }; + ; + +expr_identifier + : IDENTIFIER + { $$ = std::make_unique(@$, $1); }; + ; + +expr_path + : PATH + { $$ = std::make_unique(@$, $1); }; + | expr_identifier + { $$ = std::make_unique(@$, $1->value); }; + ; + +expr_istring + : ISTRING + { $$ = std::make_unique(@$, $1); }; + ; + +expr_string + : STRING + { $$ = std::make_unique(@$, $1); }; + ; + +expr_vector + : LPAREN expr COMMA expr COMMA expr RPAREN + { $$ = std::make_unique(@$, std::move($2), std::move($4), std::move($6)); }; + ; + +expr_hash + : HASH + { $$ = std::make_unique(@$, $1); }; + ; + +expr_float + : SUB FLOAT %prec NEG + { $$ = std::make_unique(@$, "-" + $2); }; + | FLOAT + { $$ = std::make_unique(@$, $1); }; + ; + +expr_integer + : SUB INTEGER %prec NEG + { $$ = std::make_unique(@$, "-" + $2); }; + | INTEGER + { $$ = std::make_unique(@$, $1); }; + ; + +expr_false + : FALSE + { $$ = std::make_unique(@$); }; + ; + +expr_true + : TRUE + { $$ = std::make_unique(@$); }; + ; + +%% + +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/premake5.lua b/premake5.lua index b09e3df7..155061bd 100644 --- a/premake5.lua +++ b/premake5.lua @@ -58,6 +58,7 @@ project "xsk-gsc-tool" dependson "xsk-gsc-s4" dependson "xsk-gsc-h1" dependson "xsk-gsc-h2" + dependson "xsk-arc-t6" pchheader "stdafx.hpp" pchsource "src/tool/stdafx.cpp" @@ -78,7 +79,8 @@ project "xsk-gsc-tool" "xsk-gsc-s2", "xsk-gsc-s4", "xsk-gsc-h1", - "xsk-gsc-h2" + "xsk-gsc-h2", + "xsk-arc-t6" } includedirs { @@ -270,5 +272,23 @@ project "xsk-gsc-h2" "./src" } +project "xsk-arc-t6" + kind "StaticLib" + language "C++" + + pchheader "stdafx.hpp" + pchsource "src/t6/stdafx.cpp" + + files { + "./src/t6/**.h", + "./src/t6/**.hpp", + "./src/t6/**.cpp" + } + + includedirs { + "./src/t6", + "./src" + } + group "Dependencies" zlib:project() diff --git a/src/t6/stdafx.cpp b/src/t6/stdafx.cpp new file mode 100644 index 00000000..1f373bf1 --- /dev/null +++ b/src/t6/stdafx.cpp @@ -0,0 +1,6 @@ +// Copyright 2022 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 "stdafx.hpp" diff --git a/src/t6/stdafx.hpp b/src/t6/stdafx.hpp new file mode 100644 index 00000000..083feb9d --- /dev/null +++ b/src/t6/stdafx.hpp @@ -0,0 +1,39 @@ +// Copyright 2022 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 + +// Warnings +#ifdef _WIN32 +#pragma warning(disable:4244) +#pragma warning(disable:4267) +#pragma warning(disable:4005) +#pragma warning(disable:4065) +#define _CRT_SECURE_NO_WARNINGS +#endif + +// C/C++ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Ext +using namespace std::literals; + +#include "xsk/t6.hpp" diff --git a/src/t6/xsk/assembler.cpp b/src/t6/xsk/assembler.cpp new file mode 100644 index 00000000..0f623c97 --- /dev/null +++ b/src/t6/xsk/assembler.cpp @@ -0,0 +1,886 @@ +// Copyright 2022 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 "stdafx.hpp" +#include "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_->buffer().data(), output.size()); + + return output; +} + +void assembler::assemble(const std::string& file, std::vector& data) +{ + throw error("assemble from source unimplemented!"); +} + +void assembler::assemble(const std::string& file, assembly::ptr& data) +{ + script_ = std::make_unique(0x100000); + filename_ = file; + assembly_ = std::move(data); + stringlist_.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 = 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; // calcule_crc(); + + // assemble exports + header_.exports_offset = script_->pos(); + header_.exports_count = 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 = imports_.size(); + + for (const auto& entry : imports_) + { + script_->write(string_offset(entry.name)); + script_->write(string_offset(entry.space)); + script_->write(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 = animtrees_.size(); + + for (const auto& entry : animtrees_) + { + script_->write(string_offset(entry.name)); + script_->write(entry.refs.size()); + script_->write(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 = stringtables_.size(); + + for (const auto& entry : stringtables_) + { + script_->write(string_offset(entry.name)); + script_->write(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; + + 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; + + 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 != labels_.end()) + { + labels_.insert({ inst->index, itr->second }); + } + } + + script_->pos(func->index); + + for (const auto& inst : func->instructions) + { + assemble_instruction(inst); + } + + export_ref obj; + obj.checksum = 0; // calculate_checksum(); + obj.offset = func->index; + obj.name = func->name; + obj.params = func->params; + obj.flags = func->flags; + exports_.push_back(obj); +} + +void assembler::assemble_instruction(const instruction::ptr& inst) +{ + switch (opcode(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_RemoveLocalVariables: + case opcode::OP_EvalArray: + case opcode::OP_EvalLocalArrayRefCached: + 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: + script_->write(static_cast(inst->opcode)); + break; + case opcode::OP_GetByte: + case opcode::OP_GetNegByte: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetUnsignedShort: + case opcode::OP_GetNegUnsignedShort: + script_->write(static_cast(inst->opcode)); + script_->align(2); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetInteger: + script_->write(static_cast(inst->opcode)); + script_->align(4); + script_->write(std::stoi(inst->data[0])); + break; + case opcode::OP_GetFloat: + script_->write(static_cast(inst->opcode)); + script_->align(4); + script_->write(std::stof(inst->data[0])); + break; + case opcode::OP_GetVector: + script_->write(static_cast(inst->opcode)); + 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_->write(static_cast(inst->opcode)); + script_->align(2); + script_->write(0); + break; + case opcode::OP_GetAnimation: + script_->write(static_cast(inst->opcode)); + script_->align(4); + script_->write(0); + break; + case opcode::OP_WaitTillMatch: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_VectorConstant: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetHash: + script_->write(static_cast(inst->opcode)); + 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_EvalLocalVariableCached: + case opcode::OP_SafeSetWaittillVariableFieldCached: + case opcode::OP_EvalLocalVariableRefCached: + script_->write(static_cast(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_EvalFieldVariable: + case opcode::OP_EvalFieldVariableRef: + case opcode::OP_ClearFieldVariable: + script_->write(static_cast(inst->opcode)); + 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(inst->opcode)); + script_->write(static_cast(std::stoi(inst->data[0]))); + break; + case opcode::OP_GetFunction: + script_->write(static_cast(inst->opcode)); + 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(static_cast(inst->opcode)); + 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: + assemble_jump(inst); + break; + case opcode::OP_Switch: + assemble_switch(inst); + break; + case opcode::OP_EndSwitch: + assemble_end_switch(inst); + break; + case opcode::OP_DevblockBegin: + case opcode::OP_DevblockEnd: + assemble_devblock(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->opcode)); + script_->write(static_cast(inst->data.size())); + + for (const auto& entry : inst->data) + { + script_->align(2); + script_->write(0); + } +} + +void assembler::assemble_jump(const instruction::ptr& inst) +{ + script_->write(static_cast(inst->opcode)); + + const std::int16_t addr = resolve_label(inst->data[0]) - inst->index - inst->size; + + script_->align(2); + script_->write(addr); +} + +void assembler::assemble_switch(const instruction::ptr& inst) +{ + script_->write(static_cast(inst->opcode)); + + 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) +{ + script_->write(static_cast(inst->opcode)); + + const auto count = std::stoul(inst->data[0]); + + script_->align(4); + script_->write(count); + + std::uint32_t index = inst->index + 3; + + for (auto i = 0u; i < count; i++) + { + if (inst->data[1 + (3 * i)] == "case") + { + if (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); + } + } +} + +void assembler::assemble_devblock(const instruction::ptr& inst) +{ + script_->write(static_cast(inst->opcode)); + + const std::int16_t addr = resolve_label(inst->data[0]) - inst->index - inst->size; + + script_->align(2); + script_->write(addr); +} + +void assembler::align_instruction(const instruction::ptr& inst) +{ + inst->size = opcode_size(inst->opcode); + script_->seek(1); + + switch (opcode(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_RemoveLocalVariables: + case opcode::OP_EvalArray: + case opcode::OP_EvalLocalArrayRefCached: + 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); + 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 = 0; 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_EvalLocalVariableCached: + 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: + 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]); + + for (auto i = 0u; i < count; i++) + { + if (inst->data[1 + (3 * i)] == "case") + { + if (!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; + case opcode::OP_DevblockBegin: + case opcode::OP_DevblockEnd: + inst->size += script_->align(2); + script_->seek(2); + 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 = script_->pos(); + script_->write_c_string(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 (opcode(inst->opcode)) + { + 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]); + + for (auto i = 0u; i < count; i++) + { + if (inst->data[1 + (3 * i)] == "case") + { + if (!utils::string::is_number(inst->data[1 + (3 * i) + 1])) + { + process_string(utils::string::unquote(inst->data[1 + (3 * i) + 1])); + } + } + } + } + break; + default: + break; + } +} + +auto assembler::resolve_label(const std::string& name) -> std::int32_t +{ + for (const auto& func : labels_) + { + if (func.second == name) + { + return func.first; + } + } + + throw asm_error("Couldn't resolve label address of '" + name + "'!"); +} + +auto assembler::string_offset(const std::string& name) -> std::uint32_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 == std::uint8_t(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.params == std::stoi(data[3])) + { + entry.refs.push_back(ref); + return; + } + } + + import_ref n; + n.space = data[0]; + n.name = data[1]; + n.params = std::stoi(data[2]); + n.flags = std::stoi(data[3]); + n.refs.push_back(ref); + imports_.push_back(std::move(n)); +} + +void assembler::add_anim_reference(const std::vector& data, std::uint32_t ref) +{ + for (auto& entry : animtrees_) + { + if (entry.name == data[0]) + { + entry.anims.push_back({ data[1], ref }); + return; + } + } + + animtree_ref n; + n.name = data[0]; + n.anims.push_back({ data[1], ref }); + animtrees_.push_back(std::move(n)); +} + +} // namespace xsk::arc::t6 diff --git a/src/t6/xsk/assembler.hpp b/src/t6/xsk/assembler.hpp new file mode 100644 index 00000000..f797b89d --- /dev/null +++ b/src/t6/xsk/assembler.hpp @@ -0,0 +1,48 @@ +// Copyright 2022 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::byte_buffer::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 assemble_devblock(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::uint32_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/src/t6/xsk/compiler.cpp b/src/t6/xsk/compiler.cpp new file mode 100644 index 00000000..5cad5fe9 --- /dev/null +++ b/src/t6/xsk/compiler.cpp @@ -0,0 +1,2473 @@ +// Copyright 2022 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 "stdafx.hpp" +#include "t6.hpp" +#include "parser.hpp" +#include "lexer.hpp" + +namespace xsk::arc::t6 +{ + +auto compiler::output() -> assembly::ptr +{ + return std::move(assembly_); +} + +auto compiler::output_data() -> std::vector +{ + output_ = std::make_unique(0x100000); + + 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()); + memcpy(output.data(), output_->buffer().data(), output.size()); + + return output; +} + +void compiler::compile(const std::string& file, std::vector& data) +{ + filename_ = file; + + auto prog = parse_buffer(filename_, data); + + compile_program(prog); +} + +void compiler::read_callback(std::function(const std::string&)> func) +{ + read_callback_ = func; +} + +auto compiler::parse_buffer(const std::string& file, std::vector& data) -> ast::program::ptr +{ + ast::program::ptr result(nullptr); + + resolver::set_reader(read_callback_); + + lexer lexer(mode_, file, reinterpret_cast(data.data()), 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 buffer = read_callback_(file); + auto result = parse_buffer(file, buffer); + + return result; +} + +void compiler::compile_program(const ast::program::ptr& program) +{ + assembly_ = std::make_unique(); + includes_.clear(); + animtrees_.clear(); + constants_.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); + } +} + +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(), "error duplicated include file '" + path + "'."); + } + } + + assembly_->includes.push_back(path); + + /*for (const auto& inc : includes_) + { + if (inc.name == path) + { + throw comp_error(include->loc(), "error duplicated include file '" + path + "'."); + } + } + + if (map_known_includes(path)) return; + + try + { + auto program = parse_file(path); + + std::vector funcs; + + for (const auto& decl : program->declarations) + { + if (decl == ast::kind::decl_thread) + { + funcs.push_back(decl.as_thread->name->value); + } + } + + if (funcs.size() == 0) + { + throw comp_error(include->loc(), "error empty include file '" + path + "'."); + } + + includes_.push_back(include_t(path, funcs)); + } + catch(const std::exception& e) + { + throw comp_error(include->loc(), "error parsing include file '" + path + "': " + e.what()); + }*/ +} + +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_constant: + emit_decl_constant(decl.as_constant); + 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 /# ... #/ comment"); + } + + animtrees_.push_back({ animtree->name->value, false }); +} + +void compiler::emit_decl_constant(const ast::decl_constant::ptr& constant) +{ + if (constants_.contains(constant->name->value)) + { + throw comp_error(constant->loc(), "duplicated constant definition"); + } + + constants_.insert({ constant->name->value, std::move(constant->value) }); +} + +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 = thread->params->list.size(); + function_->flags = 0; + + stack_idx_ = 0; + label_idx_ = 0; + can_break_ = false; + can_continue_ = false; + local_stack_.clear(); + break_loc_ = ""; + continue_loc_ = ""; + abort_ = abort_t::abort_none; + + process_thread(thread); + + emit_expr_parameters(thread->params); + emit_stmt_list(thread->stmt); + + if (abort_ == abort_t::abort_none) + emit_opcode(opcode::OP_End); + + 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_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_breakpoint: + emit_stmt_breakpoint(stmt.as_breakpoint); + 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); + else if (stmt->expr == ast::kind::expr_method) + emit_expr_method(stmt->expr.as_method); + else + throw comp_error(stmt->loc(), "unknown call statement expression"); + + emit_opcode(opcode::OP_DecTop); +} + +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); + } + + emit_stmt(stmt->stmt); + + 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); + } + + emit_stmt(stmt->stmt_if); + + emit_opcode(opcode::OP_Jump, end_loc); + + insert_label(else_loc); + + emit_stmt(stmt->stmt_else); + + insert_label(end_loc); +} + +void compiler::emit_stmt_while(const ast::stmt_while::ptr& stmt) +{ + auto old_abort = abort_; + auto old_break_loc = break_loc_; + auto old_continue_loc = continue_loc_; + auto old_break = can_break_; + auto old_continue = can_continue_; + + can_break_ = true; + can_continue_ = true; + break_loc_ = create_label(); + continue_loc_ = insert_label(); + + auto begin_loc = continue_loc_; + + 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_); + } + + emit_stmt(stmt->stmt); + emit_opcode(opcode::OP_Jump, begin_loc); + insert_label(break_loc_); + + can_break_ = old_break; + can_continue_ = old_continue; + break_loc_ = old_break_loc; + continue_loc_ = old_continue_loc; + abort_ = old_abort; +} + +void compiler::emit_stmt_dowhile(const ast::stmt_dowhile::ptr& stmt) +{ + auto old_abort = abort_; + auto old_break_loc = break_loc_; + auto old_continue_loc = continue_loc_; + auto old_break = can_break_; + auto old_continue = can_continue_; + + can_break_ = true; + can_continue_ = true; + break_loc_ = create_label(); + continue_loc_ = create_label(); + + auto begin_loc = insert_label(); + + emit_stmt(stmt->stmt); + + insert_label(continue_loc_); + + 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_); + } + + emit_opcode(opcode::OP_Jump, begin_loc); + insert_label(break_loc_); + + can_break_ = old_break; + can_continue_ = old_continue; + break_loc_ = old_break_loc; + continue_loc_ = old_continue_loc; + abort_ = old_abort; +} + +void compiler::emit_stmt_for(const ast::stmt_for::ptr& stmt) +{ + auto old_abort = abort_; + auto old_break_loc = break_loc_; + auto old_continue_loc = continue_loc_; + auto old_break = can_break_; + auto old_continue = can_continue_; + + emit_stmt(stmt->init); + + break_loc_ = create_label(); + 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; + + emit_stmt(stmt->stmt); + + 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; + break_loc_ = old_break_loc; + continue_loc_ = old_continue_loc; + abort_ = old_abort; +} + +void compiler::emit_stmt_foreach(const ast::stmt_foreach::ptr& stmt) +{ + auto old_abort = abort_; + auto old_break_loc = break_loc_; + auto old_continue_loc = continue_loc_; + 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); + + break_loc_ = create_label(); + 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); + emit_stmt(stmt->stmt); + + 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; + break_loc_ = old_break_loc; + continue_loc_ = old_continue_loc; + abort_ = old_abort; +} + +void compiler::emit_stmt_switch(const ast::stmt_switch::ptr& stmt) +{ + auto old_abort = abort_; + auto old_break_loc = break_loc_; + auto old_break = can_break_; + + can_break_ = false; + + auto jmptable_loc = create_label(); + + break_loc_ = create_label(); + + emit_expr(stmt->test); + emit_opcode(opcode::OP_Switch, jmptable_loc); + + can_break_ = true; + + std::vector data; + data.push_back(utils::string::va("%d", stmt->stmt->list.size())); + + bool has_default = false; + + for (auto i = 0; 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) + { + 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"); + } + + emit_stmt_list(case_->stmt); + } + else if (entry == ast::kind::stmt_default) + { + auto loc = insert_label(); + data.push_back("default"); + data.push_back(loc); + has_default = true; + emit_stmt_list(entry.as_default->stmt); + } + else + { + throw comp_error(entry.loc(), "missing case statement"); + } + } + + insert_label(jmptable_loc); + emit_opcode(opcode::OP_EndSwitch, data); + insert_label(break_loc_); + + can_break_ = old_break; + break_loc_ = old_break_loc; + abort_ = old_abort; +} + +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_ || abort_ != abort_t::abort_none || break_loc_ == "") + throw comp_error(stmt->loc(), "illegal break statement"); + + abort_ = abort_t::abort_break; + emit_opcode(opcode::OP_Jump, break_loc_); +} + +void compiler::emit_stmt_continue(const ast::stmt_continue::ptr& stmt) +{ + if (!can_continue_ || abort_ != abort_t::abort_none || continue_loc_ == "") + throw comp_error(stmt->loc(), "illegal continue statement"); + + abort_ = abort_t::abort_continue; + emit_opcode(opcode::OP_Jump, continue_loc_); +} + +void compiler::emit_stmt_return(const ast::stmt_return::ptr& stmt) +{ + if (abort_ == abort_t::abort_none) + 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_breakpoint(const ast::stmt_breakpoint::ptr& stmt) +{ + // TODO: +} + +void compiler::emit_stmt_prof_begin(const ast::stmt_prof_begin::ptr& stmt) +{ + // TODO: +} + +void compiler::emit_stmt_prof_end(const ast::stmt_prof_end::ptr& stmt) +{ + // 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_not: + emit_expr_not(expr.as_not); + break; + case ast::kind::expr_call: + emit_expr_call(expr.as_call); + break; + case ast::kind::expr_method: + emit_expr_method(expr.as_method); + 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_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 fromstmt) +{ + if (fromstmt) + { + 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 fromstmt) +{ + if (fromstmt) + { + 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_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) +{ + if (expr->call == ast::kind::expr_pointer) + emit_expr_call_pointer(expr->call.as_pointer); + else if (expr->call == ast::kind::expr_function) + emit_expr_call_function(expr->call.as_function); + else + throw comp_error(expr->loc(), "unknown function call expression"); +} + +void compiler::emit_expr_call_pointer(const ast::expr_pointer::ptr& expr) +{ + 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; + } +} + +void compiler::emit_expr_call_function(const ast::expr_function::ptr& expr) +{ + bool found = false; + + if(expr->path->value != "") + { + 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 + + emit_opcode(opcode::OP_PreScriptCall); + emit_expr_arguments(expr->args); + + auto argcount = utils::string::va("%d", expr->args->list.size()); + auto flags = developer_thread_ ? std::uint8_t(import_flags::developer) : 0; + + switch (expr->mode) + { + case ast::call::mode::normal: + flags |= std::uint8_t(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 |= std::uint8_t(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; + } +} + +void compiler::emit_expr_method(const ast::expr_method::ptr& expr) +{ + if (expr->call == ast::kind::expr_pointer) + emit_expr_method_pointer(expr->call.as_pointer, expr->obj); + else if (expr->call == ast::kind::expr_function) + emit_expr_method_function(expr->call.as_function, expr->obj); + 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) +{ + 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; + } +} + +void compiler::emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj) +{ + bool found = false; + + if(expr->path->value != "") + { + 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 + + 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_ ? std::uint8_t(import_flags::developer) : 0; + + switch (expr->mode) + { + case ast::call::mode::normal: + flags |= std::uint8_t(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 |= std::uint8_t(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; + } +} + +void compiler::emit_expr_parameters(const ast::expr_parameters::ptr& expr) +{ + if (local_stack_.size() == 0) + { + emit_opcode( opcode::OP_CheckClearParams); + } + else + { + std::vector data; + + for (const auto& entry : local_stack_) + { + data.push_back(entry); + } + + emit_opcode(opcode::OP_SafeCreateLocalVariables, data); + } +} + +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& expr) +{ + 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) +{ + bool found = false; + + if(expr->path->value != "") + { + 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_ ? std::uint8_t(import_flags::developer) : 0; + + flags |= std::uint8_t(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_variable(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: + emit_expr_variable_ref(expr->obj, false); + emit_opcode(opcode::OP_EvalArrayRef); + if (set) emit_opcode(opcode::OP_SetVariableField); + break; + case ast::kind::expr_identifier: + emit_opcode(opcode::OP_EvalLocalArrayRefCached, variable_access(expr->obj.as_identifier)); + 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_EvalLocalVariableRefCached, 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); + 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); + 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); + emit_opcode(opcode::OP_CastFieldObject); + emit_opcode(opcode::OP_EvalFieldVariable, field); + break; + case ast::kind::expr_method: + emit_expr_method(expr->obj.as_method); + 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()) + { + const auto& value = itr->second; + emit_expr(value); + return; + } + + // is local var + 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); + emit_opcode(opcode::OP_CastFieldObject); + break; + case ast::kind::expr_method: + emit_expr_method(expr.as_method); + 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 isexpr = false; + bool isconst = true; + + if (expr->x == ast::kind::expr_integer) + data.push_back(expr->x.as_integer->value); + else if (expr->x == ast::kind::expr_float) + data.push_back(expr->x.as_float->value); + else isexpr = true; + + if (expr->y == ast::kind::expr_integer) + data.push_back(expr->y.as_integer->value); + else if (expr->y == ast::kind::expr_float) + data.push_back(expr->y.as_float->value); + else isexpr = true; + + if (expr->z == ast::kind::expr_integer) + data.push_back(expr->z.as_integer->value); + else if (expr->z == ast::kind::expr_float) + data.push_back(expr->z.as_float->value); + else isexpr = true; + + if (!isexpr) + { + emit_opcode(opcode::OP_GetVector, data); + } + else + { + 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"); + } + + auto& tree = animtrees_.back(); + + emit_opcode(opcode::OP_GetAnimation, { tree.name, expr->value }); +} + +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_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_breakpoint: + 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 = 0; 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 = 0; 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) + { + variable_register(entry->value); + } +} + +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::resolve_function_type(const ast::expr_function::ptr& expr) -> ast::call::type +{ + if (expr->path->value != "") + return ast::call::type::far; + + auto& name = expr->name->value; + + //if (resolver::find_function(name) || resolver::find_method(name)) + // return ast::call::type::builtin; + + for (const auto& entry : local_functions_) + { + if (entry == name) + return ast::call::type::local; + } + + for (const auto& inc : includes_) + { + for (const auto& fun : inc.funcs) + { + if (name == fun) + { + expr->path->value = inc.name; + return ast::call::type::far; + } + } + } + + throw comp_error(expr->loc(), "couldn't determine function type"); +} + +auto compiler::resolve_reference_type(const ast::expr_reference::ptr& expr, bool& method) -> ast::call::type +{ + if (expr->path->value != "") + return ast::call::type::far; + + auto& name = expr->name->value; + + //if (resolver::find_function(name)) + // { + // method = false; + // return ast::call::type::builtin; + // } + + // if (resolver::find_method(name)) + // { + // method = true; + // return ast::call::type::builtin; + // } + + for (const auto& entry : local_functions_) + { + if (entry == name) + return ast::call::type::local; + } + + for (const auto& inc : includes_) + { + for (const auto& fun : inc.funcs) + { + if (name == fun) + { + expr->path->value = inc.name; + return ast::call::type::far; + } + } + } + + throw comp_error(expr->loc(), "couldn't determine function reference type"); +} +*/ +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_++; + auto name = utils::string::va("loc_%d", label_idx_); + return name; +} + +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 (opcode(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: + 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& include) -> 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 (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) +{ + switch (opcode(inst->opcode)) + { + /*case opcode::OP_endswitch: + output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); + output_->write_string(utils::string::va(" %s\n", inst->data[0].data())); + { + std::uint32_t totalcase = std::stoul(inst->data[0]); + auto index = 0; + for (auto casenum = 0u; casenum < totalcase; casenum++) + { + if (inst->data[1 + index] == "case") + { + output_->write_string(utils::string::va("\t\t\t%s %s %s", 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("\t\t\t%s %s", inst->data[1 + index].data(), inst->data[1 + index + 1].data())); + index += 2; + } + output_->write_string("\n"); + } + } + break;*/ + default: + output_->write_string(utils::string::va("\t\t%s", resolver::opcode_name(inst->opcode).data())); + + for (auto& d : inst->data) + { + output_->write_string(utils::string::va(" %s", d.data())); + } + + output_->write_string("\n"); + break; + } +} + +} // namespace xsk::arc::t6 diff --git a/src/t6/xsk/compiler.hpp b/src/t6/xsk/compiler.hpp new file mode 100644 index 00000000..c159b84f --- /dev/null +++ b/src/t6/xsk/compiler.hpp @@ -0,0 +1,172 @@ +// Copyright 2022 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 +{ + build mode_; + 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::function(const std::string&)> read_callback_; + abort_t abort_; + std::string break_loc_; + std::string continue_loc_; + bool can_break_; + bool can_continue_; + bool developer_thread_; + +public: + compiler(build mode) : mode_(mode) {} + auto output() -> assembly::ptr; + auto output_data() -> std::vector; + void compile(const std::string& file, std::vector& data); + void read_callback(std::function(const std::string&)> func); + +private: + auto parse_buffer(const std::string& file, std::vector& data) -> 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_constant(const ast::decl_constant::ptr& constant); + 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_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_breakpoint(const ast::stmt_breakpoint::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 stmt); + void emit_expr_decrement(const ast::expr_decrement::ptr& expr, bool 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_not(const ast::expr_not::ptr& expr); + void emit_expr_call(const ast::expr_call::ptr& expr); + void emit_expr_call_pointer(const ast::expr_pointer::ptr& expr); + void emit_expr_call_function(const ast::expr_function::ptr& expr); + void emit_expr_method(const ast::expr_method::ptr& expr); + void emit_expr_method_pointer(const ast::expr_pointer::ptr& expr, const ast::expr& obj); + void emit_expr_method_function(const ast::expr_function::ptr& expr, const ast::expr& obj); + 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_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 resolve_function_type(const ast::expr_function::ptr& expr) -> ast::call::type; + //auto resolve_reference_type(const ast::expr_reference::ptr& expr, bool& method) -> ast::call::type; + 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; + + + utils::byte_buffer::ptr output_; + void print_function(const function::ptr& func); + void print_instruction(const instruction::ptr& inst); +}; + +} // namespace xsk::arc::t6 diff --git a/src/t6/xsk/decompiler.cpp b/src/t6/xsk/decompiler.cpp new file mode 100644 index 00000000..ce63e630 --- /dev/null +++ b/src/t6/xsk/decompiler.cpp @@ -0,0 +1,2657 @@ +// Copyright 2022 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 "stdafx.hpp" +#include "t6.hpp" + +namespace xsk::arc::t6 +{ + +auto decompiler::output() -> std::vector +{ + std::vector output; + + auto data = std::make_unique(0x100000); + 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->buffer().data(), output.size()); + + return output; +} + +void decompiler::decompile(const std::string& file, const assembly::ptr& data) +{ + filename_ = file; + program_ = std::make_unique(); + + for (const auto& func : data->functions) + { + auto name = std::make_unique(func->name); + auto params = std::make_unique(); + auto block = std::make_unique(); + func_ = std::make_unique(std::move(name), std::move(params), std::move(block)); + + 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(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 emty 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 (opcode(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: + case opcode::OP_GetInteger: + { + 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_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: + { + auto value = utils::string::unquote(inst->data[0]); + + if (value != "") + { + 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, utils::string::unquote(inst->data[1])); + stack_.push(std::move(node)); + } + break; + case opcode::OP_GetFunction: + { + if (inst->data.size() == 1) + { + auto path = std::make_unique(loc); + auto name = std::make_unique(loc, inst->data[0]); + auto node = std::make_unique(loc, std::move(path), std::move(name)); + stack_.push(std::move(node)); + } + else + { + 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_CreateLocalVariable: + throw decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); + break; + case opcode::OP_SafeCreateLocalVariables: + { + for (const auto& entry : inst->data) + { + locals_.insert(locals_.begin(), entry); + } + } + break; + case opcode::OP_RemoveLocalVariables: + throw decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); + 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 field = std::make_unique(loc, inst->data[0]); + auto expr = ast::expr(std::make_unique(loc, std::move(obj), std::move(field))); + auto undef = ast::expr(std::make_unique(loc)); + auto e = ast::expr(std::make_unique(loc, std::move(expr), std::move(undef))); + func_->stmt->list.push_back(ast::stmt(std::make_unique(loc, std::move(e)))); + } + break; + case opcode::OP_SafeSetVariableFieldCached: + throw decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); + 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_CheckClearParams: + 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 e = ast::expr(std::make_unique(loc, std::move(lvalue), std::move(rvalue))); + auto stmt = std::make_unique(loc, std::move(e)); + func_->stmt->list.push_back(ast::stmt(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 = std::make_unique(expr.loc(), std::move(expr)); + func_->stmt->list.push_back(ast::stmt(std::move(stmt))); + } + break; + case opcode::OP_CastFieldObject: + case opcode::OP_CastBool: + 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(); + auto e_not = ast::expr(std::make_unique(loc, std::move(lvalue))); + auto expr = std::make_unique(loc, std::move(e_not), inst->data[0]); + func_->stmt->list.push_back(ast::stmt(std::move(expr))); + } + break; + case opcode::OP_JumpOnFalse: + { + 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]); + func_->stmt->list.push_back(ast::stmt(std::move(expr))); + } + 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 expr = std::make_unique(loc, inst->data[0]); + func_->stmt->list.push_back(ast::stmt(std::move(expr))); + if (stack_.size() != 0) tern_labels_.push_back(inst->data[0]); + } + break; + case opcode::OP_JumpBack: + { + auto expr = std::make_unique(loc, inst->data[0]); + func_->stmt->list.push_back(ast::stmt(std::move(expr))); + } + 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 = std::make_unique(loc, std::move(node)); + func_->stmt->list.push_back(ast::stmt(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 = std::make_unique(loc, std::move(node)); + func_->stmt->list.push_back(ast::stmt(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 = std::make_unique(loc, std::move(obj), std::move(expr), std::move(args)); + func_->stmt->list.push_back(ast::stmt(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 = std::make_unique(loc, std::move(obj), std::move(event), std::move(args)); + func_->stmt->list.push_back(ast::stmt(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 = std::make_unique(loc, std::move(obj) , std::move(event)); + func_->stmt->list.push_back(ast::stmt(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 sw = std::make_unique(loc, std::move(expr), inst->data[0]); + func_->stmt->list.push_back(ast::stmt(std::move(sw))); + } + break; + case opcode::OP_EndSwitch: + { + auto count = inst->data[0]; + inst->data.erase(inst->data.begin()); + auto data = inst->data; + auto end = std::make_unique(loc, data, count); + func_->stmt->list.push_back(ast::stmt(std::move(end))); + } + 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_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: + throw decomp_error("unhandled opcode " + resolver::opcode_name(inst->opcode)); + 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_DevblockEnd: + case opcode::OP_Breakpoint: + 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 (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 (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) +{ + for (int 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 (i > 0 && 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_infinite(stmt, start, i); + i = start; + } + else if (stmt->list.at(start).as_cond->value != break_loc) + { + decompile_infinite(stmt, start, i); + i = start; + } + else if (stmt->list.at(start).as_cond->value == break_loc) + { + decompile_loop(stmt, start, i); + i = stmt->list.size() - 1; + } + } + } +} + +void decompiler::decompile_loops(const ast::stmt_list::ptr& stmt) +{ + for (auto i = 0; 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() - 1) : (find_location_index(stmt, entry.as_cond->value) - 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 (j == i + 1 && (stmt->list.at(j).as_jump->value != blocks_.back().loc_continue)) + { + decompile_dowhile(stmt, i, j); + i = 0; + } + else 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 = 0; 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 = 0; 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() - 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) + { + decompile_if(stmt, i, j); + /*if (stmt->list.at(j).as_jump->loc().begin.line < std::stol(stmt->list.at(j).as_jump->value.substr(4), 0, 16)) + decompile_ifelse(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 = 0; 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_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 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)); + } + } + } +} + +void decompiler::decompile_devblocks(const ast::stmt_list::ptr& stmt) +{ + for (auto i = 0; 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(); + + 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::uint32_t begin, std::uint32_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::uint32_t begin, std::uint32_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_infinite(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_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::uint32_t start, std::uint32_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 ref = stmt->list.at(end).loc().label(); + auto ref2 = stmt->list.at(start).loc().label(); + + if (find_location_reference(stmt, start, end, ref)) + { + // continue is at jumpback, 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::uint32_t begin, std::uint32_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::uint32_t begin, std::uint32_t end) +{ + block blk; + blk.loc_break = stmt->list.at(begin).as_cond->value; + blk.loc_end = stmt->list.at(begin).loc().label(); + blk.loc_continue = stmt->list.at(begin).loc().label(); + + auto test = std::move(stmt->list.at(begin).as_cond->expr); + begin = find_location_index(stmt, stmt->list.at(end).as_jump->value); + auto loc = stmt->list.at(begin).loc(); + + end--; + stmt->list.erase(stmt->list.begin() + end); // remove 'test' + stmt->list.erase(stmt->list.begin() + end); // remove 'jumpback' + + 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::uint32_t begin, std::uint32_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::uint32_t begin, std::uint32_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::uint32_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 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 = 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) - 1; // update 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 = 0; 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::uint32_t begin, std::uint32_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::uint32_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::uint32_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; +} + +void decompiler::process_thread(const ast::decl_thread::ptr& thread) +{ + process_stmt_list(thread->stmt); +} + +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& vec) +{ + process_expr(vec->z); + process_expr(vec->y); + process_expr(vec->x); +} + +} // namespace xsk::arc::t6 diff --git a/src/t6/xsk/decompiler.hpp b/src/t6/xsk/decompiler.hpp new file mode 100644 index 00000000..afb31c70 --- /dev/null +++ b/src/t6/xsk/decompiler.hpp @@ -0,0 +1,98 @@ +// Copyright 2022 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::uint32_t begin, std::uint32_t end); + void decompile_ifelse(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); + void decompile_infinite(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); + void decompile_loop(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); + void decompile_while(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); + void decompile_dowhile(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); + void decompile_for(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); + void decompile_foreach(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end); + void decompile_switch(const ast::stmt_list::ptr& stmt, std::uint32_t begin); + auto find_location_reference(const ast::stmt_list::ptr& stmt, std::uint32_t begin, std::uint32_t end, const std::string& location) -> bool; + auto find_location_index(const ast::stmt_list::ptr& stmt, const std::string& location) -> std::uint32_t; + auto last_location_index(const ast::stmt_list::ptr& stmt, std::uint32_t index) -> bool; + auto lvalues_match(const ast::stmt_assign::ptr& stmt1, const ast::stmt_assign::ptr& stmt2) -> bool; + 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& vec); +}; + +} // namespace xsk::arc::t6 diff --git a/src/t6/xsk/disassembler.cpp b/src/t6/xsk/disassembler.cpp new file mode 100644 index 00000000..65355a62 --- /dev/null +++ b/src/t6/xsk/disassembler.cpp @@ -0,0 +1,644 @@ +// Copyright 2022 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 "stdafx.hpp" +#include "t6.hpp" + +namespace xsk::arc::t6 +{ + +auto disassembler::output() -> assembly::ptr +{ + return std::move(assembly_); +} + +auto disassembler::output_data() -> std::vector +{ + output_ = std::make_unique(0x100000); + + 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()); + memcpy(output.data(), output_->buffer().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(); + + std::memset(&header_, 0 ,sizeof(header_)); + exports_.clear(); + imports_.clear(); + strings_.clear(); + animtrees_.clear(); + stringlist_.clear(); + string_refs_.clear(); + anim_refs_.clear(); + import_refs_.clear(); + labels_.clear(); + + // 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) + { + std::uint16_t pos = script_->pos(); + stringlist_.insert({ pos, script_->read_c_string() }); + } + + // 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++) + { + entry->refs.push_back(script_->read()); + } + + 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 = 0; i < exports_.size(); i++) + { + auto& entry = exports_[i]; + auto size = 0; + + if (i < exports_.size() - 1) + { + entry->size = (exports_[i+1]->offset - entry->offset) - 4; + + auto end_pos = entry->offset + entry->size; + + for (auto j = 1; j < 4; j++) + { + script_->pos(end_pos - j); + auto op = script_->read(); + + if (op == '\x00' || op == '\x01') + break; + else + 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(); + } + + // fixup list ... + // profile list ... +} + +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); + + this->disassemble_instruction(inst); + size -= inst->size; + } +} + +void disassembler::disassemble_instruction(const instruction::ptr& inst) +{ + switch (opcode(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_RemoveLocalVariables: + case opcode::OP_EvalArray: + case opcode::OP_EvalLocalArrayRefCached: + 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); + inst->data.push_back(utils::string::va("%i", script_->read())); + break; + case opcode::OP_GetFloat: + { + inst->size += script_->align(4); + auto val = script_->read(); + inst->data.push_back(utils::string::va("%g%s", val, val == int(val) ? ".0" : "")); + } + break; + case opcode::OP_GetVector: + inst->size += script_->align(4); + inst->data.push_back(utils::string::va("%g", script_->read())); + inst->data.push_back(utils::string::va("%g", script_->read())); + inst->data.push_back(utils::string::va("%g", 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_EvalLocalVariableCached: + 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: + disassemble_jump(inst); + break; + case opcode::OP_Switch: + disassemble_switch(inst); + break; + case opcode::OP_EndSwitch: + disassemble_end_switch(inst); + break; + case opcode::OP_DevblockBegin: + disassemble_devblock(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_.at(script_->pos()); + + inst->data.push_back(entry->type ? entry->name : utils::string::to_literal(entry->name)); + script_->seek(2); +} + +void disassembler::disassemble_animation(const instruction::ptr& inst) +{ + inst->size += script_->align(4); + + const auto ref = script_->pos(); + const auto& entry = anim_refs_.at(ref); + + inst->data.push_back(entry->name); + + for (const auto& anim : entry->anims) + { + if (anim.ref == ref) + { + inst->data.push_back(anim.name); + break; + } + } + + script_->seek(4); +} + +void disassembler::disassemble_localvars(const instruction::ptr& inst) +{ + const auto count = script_->read(); + + for (auto i = 0; 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_.at(inst->index); + + inst->data.push_back(entry->space); + inst->data.push_back(entry->name); +} + +void disassembler::disassemble_jump(const instruction::ptr& inst) +{ + inst->size += script_->align(2); + + const auto addr = inst->index + inst->size + script_->read(); + 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; + } + } + } + } + + const auto count = script_->read(); + inst->data.push_back(utils::string::va("%i", count)); + + for (auto i = 0; 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(utils::string::quote(entry->name, false)); + } + else if (value == 0) + { + inst->data.push_back("default"); + } + else + { + 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; + } +} + +void disassembler::disassemble_devblock(const instruction::ptr& inst) +{ + inst->size += script_->align(2); + + const auto addr = inst->index + inst->size + script_->read(); + const auto label = utils::string::va("loc_%X", addr); + + inst->data.push_back(label); + labels_.insert({ addr, label }); +} + +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 (opcode(inst->opcode)) + { + case opcode::OP_EndSwitch: + output_->write_string(utils::string::va(" %s\n", inst->data[0].data())); + { + std::uint32_t totalcase = std::stoul(inst->data[0]); + auto index = 0; + for (auto casenum = 0u; casenum < totalcase; casenum++) + { + if (inst->data[1 + index] == "case") + { + output_->write_string(utils::string::va("\t\t\t%s %s %s", 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("\t\t\t%s %s", inst->data[1 + index].data(), inst->data[1 + index + 1].data())); + index += 2; + } + output_->write_string("\n"); + } + } + break; + default: + for (const auto& d : inst->data) + { + output_->write_string(utils::string::va(" %s", d.data())); + } + + output_->write_string("\n"); + break; + } +} + +} // namespace xsk::arc::t6 diff --git a/src/t6/xsk/disassembler.hpp b/src/t6/xsk/disassembler.hpp new file mode 100644 index 00000000..1d973d02 --- /dev/null +++ b/src/t6/xsk/disassembler.hpp @@ -0,0 +1,48 @@ +// Copyright 2022 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::byte_buffer::ptr script_; + utils::byte_buffer::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_data() -> 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_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 disassemble_devblock(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/src/t6/xsk/lexer.cpp b/src/t6/xsk/lexer.cpp new file mode 100644 index 00000000..407a3626 --- /dev/null +++ b/src/t6/xsk/lexer.cpp @@ -0,0 +1,890 @@ +// Copyright 2022 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 "stdafx.hpp" +#include "t6.hpp" +#include "parser.hpp" +#include "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 }, + { "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 }, + { "breakpoint", parser::token::BREAKPOINT }, + { "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 }, + { "game", parser::token::GAME }, + { "self", parser::token::SELF }, + { "anim", parser::token::ANIM }, + { "level", parser::token::LEVEL }, + { "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() : state(reader::end), buffer_pos(0), bytes_remaining(0), + last_byte(0), current_byte(0) { } + +void reader::init(const char* data, size_t size) +{ + if (data && size) + { + state = reader::ok; + buffer_pos = data; + bytes_remaining = 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) : indev_(false), clean_(true), loc_(location(&name)), + mode_(mode), header_top_(0), locs_(std::stack()), readers_(std::stack()) +{ + 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; + loc_.step(); + + while (true) + { + const auto& state = reader_.state; + auto& last = reader_.last_byte; + auto& curr = reader_.current_byte; + auto path = false; + + 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 != '=') + 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 == '/') + { + reader_.advance(); + break; + } + + reader_.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 == '/') + { + reader_.advance(); + break; + } + + reader_.advance(); + } + } + else if (last == '/') + { + while (true) + { + if (state == reader::end) + break; + + if (last == '\\' && (curr == '\r' || curr == '\n')) + { + reader_.advance(); + + if (state == reader::end) + break; + + if (last == '\r') + { + if (curr != '\n') + throw comp_error(loc_, "invalid token ('\')"); + + reader_.advance(); + } + + loc_.lines(); + loc_.step(); + continue; + } + + if (curr == '\n') + break; + + reader_.advance(); + } + } + continue; + case '#': + if (curr == '/') + { + if (!indev_) + throw comp_error(loc_, "unmatched devblock end ('#/')"); + + indev_ = false; + advance(); + 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 '.': + advance(); + + if (state == reader::end) + throw comp_error(loc_, "unterminated field ('.')"); + + state_ = state::field; + goto lex_name_or_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: +lex_name_or_number: + 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::field) + { + if (path) + throw comp_error(loc_, "invalid field token '\\'"); + + if (std::string_view(buffer_.data, buffer_.length) == "size") + { + return parser::make_SIZE(loc_); + } + + return parser::make_FIELD(std::string(buffer_.data, buffer_.length), loc_); + } + else if (state_ == state::preprocessor) + { + if (path) + throw comp_error(loc_, "invalid preprocessor directive"); + + 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(token); + state_ = state::start; + continue; + } + else + { + for (auto i = 0; 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 (state_ == state::field) + buffer_.push('.'); + + if (state_ == state::field || last == '.' || last != '0' || (last == '0' && (curr != 'o' && curr != 'b' && curr != 'x'))) + { + buffer_.push(last); + + auto dot = 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 (state_ == state::field && dot || dot > 1 || flt > 1 || flt && buffer_.data[buffer_.length - 1] != 'f') + throw comp_error(loc_, "invalid number literal"); + + if (state_ == state::field || 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(xsk::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(xsk::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(xsk::utils::string::hex_to_dec(buffer_.data), loc_); + } + // cant get here! + } +} + +void lexer::advance() +{ + reader_.advance(); + + // dont wrap comment marks '/\/' '/\*' outside strings + if (state_ == state::start && reader_.last_byte == '/') + return; + + 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(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/xsk/lexer.hpp b/src/t6/xsk/lexer.hpp new file mode 100644 index 00000000..f283989c --- /dev/null +++ b/src/t6/xsk/lexer.hpp @@ -0,0 +1,72 @@ +// Copyright 2022 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; + int 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& operator=(const reader& r) + { + std::memcpy(this, &r, 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, field, 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(parser::token::token_kind_type token); +}; + +} // namespace xsk::arc::t6 diff --git a/src/t6/xsk/parser.cpp b/src/t6/xsk/parser.cpp new file mode 100644 index 00000000..7821bbd9 --- /dev/null +++ b/src/t6/xsk/parser.cpp @@ -0,0 +1,5178 @@ +// A Bison parser, made by GNU Bison 3.7.5. + +// 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 34 "parser.ypp" + +#include "stdafx.hpp" +#include "parser.hpp" +#include "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 + + + +#include "parser.hpp" + + + + +#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 kinds. | + `---------------*/ + + + + // 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_constant: // decl_constant + value.YY_MOVE_OR_COPY< ast::decl_constant::ptr > (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_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_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: // 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_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_breakpoint: // stmt_breakpoint + value.YY_MOVE_OR_COPY< ast::stmt_breakpoint::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_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_FIELD: // "field" + 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_constant: // decl_constant + value.move< ast::decl_constant::ptr > (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_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_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: // 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_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_breakpoint: // stmt_breakpoint + value.move< ast::stmt_breakpoint::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_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_FIELD: // "field" + 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_constant: // decl_constant + value.copy< ast::decl_constant::ptr > (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_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_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: // 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_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_breakpoint: // stmt_breakpoint + value.copy< ast::stmt_breakpoint::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_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_FIELD: // "field" + 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_constant: // decl_constant + value.move< ast::decl_constant::ptr > (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_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_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: // 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_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_breakpoint: // stmt_breakpoint + value.move< ast::stmt_breakpoint::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_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_FIELD: // "field" + 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) + { + 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) + { + return yyvalue == yypact_ninf_; + } + + bool + parser::yy_table_value_is_error_ (int yyvalue) + { + 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_constant: // decl_constant + yylhs.value.emplace< ast::decl_constant::ptr > (); + 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_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_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: // 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_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_breakpoint: // stmt_breakpoint + yylhs.value.emplace< ast::stmt_breakpoint::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_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_FIELD: // "field" + 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 284 "parser.ypp" + { ast = std::move(yystack_[0].value.as < ast::program::ptr > ()); } +#line 2315 "parser.cpp" + break; + + case 3: // root: %empty +#line 285 "parser.ypp" + { ast = std::make_unique(yylhs.location); } +#line 2321 "parser.cpp" + break; + + case 4: // program: program inline +#line 290 "parser.ypp" + { yylhs.value.as < ast::program::ptr > () = std::move(yystack_[1].value.as < ast::program::ptr > ()); } +#line 2327 "parser.cpp" + break; + + case 5: // program: program include +#line 292 "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 2333 "parser.cpp" + break; + + case 6: // program: program declaration +#line 294 "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 2339 "parser.cpp" + break; + + case 7: // program: inline +#line 296 "parser.ypp" + { yylhs.value.as < ast::program::ptr > () = std::make_unique(yylhs.location); } +#line 2345 "parser.cpp" + break; + + case 8: // program: include +#line 298 "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 2351 "parser.cpp" + break; + + case 9: // program: declaration +#line 300 "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 2357 "parser.cpp" + break; + + case 10: // inline: "#inline" expr_path ";" +#line 304 "parser.ypp" + { lexer.push_header(yystack_[1].value.as < ast::expr_path::ptr > ()->value); } +#line 2363 "parser.cpp" + break; + + case 11: // include: "#include" expr_path ";" +#line 309 "parser.ypp" + { yylhs.value.as < ast::include::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr_path::ptr > ())); } +#line 2369 "parser.cpp" + break; + + case 12: // declaration: "/#" +#line 313 "parser.ypp" + { yylhs.value.as < ast::decl > ().as_dev_begin = std::make_unique(yylhs.location); } +#line 2375 "parser.cpp" + break; + + case 13: // declaration: "#/" +#line 314 "parser.ypp" + { yylhs.value.as < ast::decl > ().as_dev_end = std::make_unique(yylhs.location); } +#line 2381 "parser.cpp" + break; + + case 14: // declaration: decl_usingtree +#line 315 "parser.ypp" + { yylhs.value.as < ast::decl > ().as_usingtree = std::move(yystack_[0].value.as < ast::decl_usingtree::ptr > ()); } +#line 2387 "parser.cpp" + break; + + case 15: // declaration: decl_constant +#line 316 "parser.ypp" + { yylhs.value.as < ast::decl > ().as_constant = std::move(yystack_[0].value.as < ast::decl_constant::ptr > ()); } +#line 2393 "parser.cpp" + break; + + case 16: // declaration: decl_thread +#line 317 "parser.ypp" + { yylhs.value.as < ast::decl > ().as_thread = std::move(yystack_[0].value.as < ast::decl_thread::ptr > ()); } +#line 2399 "parser.cpp" + break; + + case 17: // decl_usingtree: "#using_animtree" "(" expr_string ")" ";" +#line 322 "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 2405 "parser.cpp" + break; + + case 18: // decl_constant: expr_identifier "=" expr ";" +#line 327 "parser.ypp" + { yylhs.value.as < ast::decl_constant::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 2411 "parser.cpp" + break; + + case 19: // decl_thread: expr_identifier "(" expr_parameters ")" stmt_block +#line 332 "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 > ())); } +#line 2417 "parser.cpp" + break; + + case 20: // stmt: stmt_block +#line 336 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_list = std::move(yystack_[0].value.as < ast::stmt_list::ptr > ()); } +#line 2423 "parser.cpp" + break; + + case 21: // stmt: stmt_call +#line 337 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_call = std::move(yystack_[0].value.as < ast::stmt_call::ptr > ()); } +#line 2429 "parser.cpp" + break; + + case 22: // stmt: stmt_assign +#line 338 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_assign = std::move(yystack_[0].value.as < ast::stmt_assign::ptr > ()); } +#line 2435 "parser.cpp" + break; + + case 23: // stmt: stmt_endon +#line 339 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_endon = std::move(yystack_[0].value.as < ast::stmt_endon::ptr > ()); } +#line 2441 "parser.cpp" + break; + + case 24: // stmt: stmt_notify +#line 340 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_notify = std::move(yystack_[0].value.as < ast::stmt_notify::ptr > ()); } +#line 2447 "parser.cpp" + break; + + case 25: // stmt: stmt_wait +#line 341 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_wait = std::move(yystack_[0].value.as < ast::stmt_wait::ptr > ()); } +#line 2453 "parser.cpp" + break; + + case 26: // stmt: stmt_waittill +#line 342 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_waittill = std::move(yystack_[0].value.as < ast::stmt_waittill::ptr > ()); } +#line 2459 "parser.cpp" + break; + + case 27: // stmt: stmt_waittillmatch +#line 343 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_waittillmatch = std::move(yystack_[0].value.as < ast::stmt_waittillmatch::ptr > ()); } +#line 2465 "parser.cpp" + break; + + case 28: // stmt: stmt_waittillframeend +#line 344 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_waittillframeend = std::move(yystack_[0].value.as < ast::stmt_waittillframeend::ptr > ()); } +#line 2471 "parser.cpp" + break; + + case 29: // stmt: stmt_if +#line 345 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_if = std::move(yystack_[0].value.as < ast::stmt_if::ptr > ()); } +#line 2477 "parser.cpp" + break; + + case 30: // stmt: stmt_ifelse +#line 346 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_ifelse = std::move(yystack_[0].value.as < ast::stmt_ifelse::ptr > ()); } +#line 2483 "parser.cpp" + break; + + case 31: // stmt: stmt_while +#line 347 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_while = std::move(yystack_[0].value.as < ast::stmt_while::ptr > ()); } +#line 2489 "parser.cpp" + break; + + case 32: // stmt: stmt_dowhile +#line 348 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_dowhile = std::move(yystack_[0].value.as < ast::stmt_dowhile::ptr > ()); } +#line 2495 "parser.cpp" + break; + + case 33: // stmt: stmt_for +#line 349 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_for = std::move(yystack_[0].value.as < ast::stmt_for::ptr > ()); } +#line 2501 "parser.cpp" + break; + + case 34: // stmt: stmt_foreach +#line 350 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_foreach = std::move(yystack_[0].value.as < ast::stmt_foreach::ptr > ()); } +#line 2507 "parser.cpp" + break; + + case 35: // stmt: stmt_switch +#line 351 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_switch = std::move(yystack_[0].value.as < ast::stmt_switch::ptr > ()); } +#line 2513 "parser.cpp" + break; + + case 36: // stmt: stmt_case +#line 352 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_case = std::move(yystack_[0].value.as < ast::stmt_case::ptr > ()); } +#line 2519 "parser.cpp" + break; + + case 37: // stmt: stmt_default +#line 353 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_default = std::move(yystack_[0].value.as < ast::stmt_default::ptr > ()); } +#line 2525 "parser.cpp" + break; + + case 38: // stmt: stmt_break +#line 354 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_break = std::move(yystack_[0].value.as < ast::stmt_break::ptr > ()); } +#line 2531 "parser.cpp" + break; + + case 39: // stmt: stmt_continue +#line 355 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_continue = std::move(yystack_[0].value.as < ast::stmt_continue::ptr > ()); } +#line 2537 "parser.cpp" + break; + + case 40: // stmt: stmt_return +#line 356 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_return = std::move(yystack_[0].value.as < ast::stmt_return::ptr > ()); } +#line 2543 "parser.cpp" + break; + + case 41: // stmt: stmt_breakpoint +#line 357 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_breakpoint = std::move(yystack_[0].value.as < ast::stmt_breakpoint::ptr > ()); } +#line 2549 "parser.cpp" + break; + + case 42: // stmt: stmt_prof_begin +#line 358 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_prof_begin = std::move(yystack_[0].value.as < ast::stmt_prof_begin::ptr > ()); } +#line 2555 "parser.cpp" + break; + + case 43: // stmt: stmt_prof_end +#line 359 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_prof_end = std::move(yystack_[0].value.as < ast::stmt_prof_end::ptr > ()); } +#line 2561 "parser.cpp" + break; + + case 44: // stmt_or_dev: stmt +#line 363 "parser.ypp" + { yylhs.value.as < ast::stmt > () = std::move(yystack_[0].value.as < ast::stmt > ()); } +#line 2567 "parser.cpp" + break; + + case 45: // stmt_or_dev: stmt_dev +#line 364 "parser.ypp" + { yylhs.value.as < ast::stmt > ().as_dev = std::move(yystack_[0].value.as < ast::stmt_dev::ptr > ()); } +#line 2573 "parser.cpp" + break; + + case 46: // stmt_list: stmt_list stmt +#line 369 "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 2579 "parser.cpp" + break; + + case 47: // stmt_list: stmt +#line 371 "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 2585 "parser.cpp" + break; + + case 48: // stmt_or_dev_list: stmt_or_dev_list stmt_or_dev +#line 376 "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 2591 "parser.cpp" + break; + + case 49: // stmt_or_dev_list: stmt_or_dev +#line 378 "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 2597 "parser.cpp" + break; + + case 50: // stmt_dev: "/#" stmt_list "#/" +#line 382 "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 2603 "parser.cpp" + break; + + case 51: // stmt_dev: "/#" "#/" +#line 383 "parser.ypp" + { yylhs.value.as < ast::stmt_dev::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } +#line 2609 "parser.cpp" + break; + + case 52: // stmt_block: "{" stmt_or_dev_list "}" +#line 387 "parser.ypp" + { yylhs.value.as < ast::stmt_list::ptr > () = std::move(yystack_[1].value.as < ast::stmt_list::ptr > ()); } +#line 2615 "parser.cpp" + break; + + case 53: // stmt_block: "{" "}" +#line 388 "parser.ypp" + { yylhs.value.as < ast::stmt_list::ptr > () = std::make_unique(yylhs.location); } +#line 2621 "parser.cpp" + break; + + case 54: // stmt_expr: expr_assign +#line 393 "parser.ypp" + { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } +#line 2627 "parser.cpp" + break; + + case 55: // stmt_expr: expr_increment +#line 395 "parser.ypp" + { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } +#line 2633 "parser.cpp" + break; + + case 56: // stmt_expr: expr_decrement +#line 397 "parser.ypp" + { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } +#line 2639 "parser.cpp" + break; + + case 57: // stmt_expr: %empty +#line 399 "parser.ypp" + { yylhs.value.as < ast::stmt_expr::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } +#line 2645 "parser.cpp" + break; + + case 58: // stmt_call: expr_call ";" +#line 404 "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 2651 "parser.cpp" + break; + + case 59: // stmt_call: expr_method ";" +#line 406 "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 2657 "parser.cpp" + break; + + case 60: // stmt_assign: expr_assign ";" +#line 411 "parser.ypp" + { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } +#line 2663 "parser.cpp" + break; + + case 61: // stmt_assign: expr_increment ";" +#line 413 "parser.ypp" + { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } +#line 2669 "parser.cpp" + break; + + case 62: // stmt_assign: expr_decrement ";" +#line 415 "parser.ypp" + { yylhs.value.as < ast::stmt_assign::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } +#line 2675 "parser.cpp" + break; + + case 63: // stmt_endon: expr_object "endon" "(" expr ")" ";" +#line 420 "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 2681 "parser.cpp" + break; + + case 64: // stmt_notify: expr_object "notify" "(" expr "," expr_arguments_no_empty ")" ";" +#line 425 "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 2687 "parser.cpp" + break; + + case 65: // stmt_notify: expr_object "notify" "(" expr ")" ";" +#line 427 "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 2693 "parser.cpp" + break; + + case 66: // stmt_wait: "wait" expr ";" +#line 432 "parser.ypp" + { yylhs.value.as < ast::stmt_wait::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } +#line 2699 "parser.cpp" + break; + + case 67: // stmt_waittill: expr_object "waittill" "(" expr "," expr_arguments_no_empty ")" ";" +#line 437 "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 2705 "parser.cpp" + break; + + case 68: // stmt_waittill: expr_object "waittill" "(" expr ")" ";" +#line 439 "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 2711 "parser.cpp" + break; + + case 69: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr "," expr_arguments_no_empty ")" ";" +#line 444 "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 2717 "parser.cpp" + break; + + case 70: // stmt_waittillmatch: expr_object "waittillmatch" "(" expr ")" ";" +#line 446 "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 2723 "parser.cpp" + break; + + case 71: // stmt_waittillframeend: "waittillframeend" ";" +#line 451 "parser.ypp" + { yylhs.value.as < ast::stmt_waittillframeend::ptr > () = std::make_unique(yylhs.location); } +#line 2729 "parser.cpp" + break; + + case 72: // stmt_if: "if" "(" expr ")" stmt +#line 456 "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 2735 "parser.cpp" + break; + + case 73: // stmt_ifelse: "if" "(" expr ")" stmt "else" stmt +#line 461 "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 2741 "parser.cpp" + break; + + case 74: // stmt_while: "while" "(" expr ")" stmt +#line 466 "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 2747 "parser.cpp" + break; + + case 75: // stmt_dowhile: "do" stmt "while" "(" expr ")" ";" +#line 471 "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 2753 "parser.cpp" + break; + + case 76: // stmt_for: "for" "(" stmt_expr ";" expr_or_empty ";" stmt_expr ")" stmt +#line 476 "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 2759 "parser.cpp" + break; + + case 77: // stmt_foreach: "foreach" "(" expr_identifier "in" expr ")" stmt +#line 481 "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 2765 "parser.cpp" + break; + + case 78: // stmt_foreach: "foreach" "(" expr_identifier "," expr_identifier "in" expr ")" stmt +#line 483 "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 2771 "parser.cpp" + break; + + case 79: // stmt_switch: "switch" "(" expr ")" stmt_block +#line 488 "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 2777 "parser.cpp" + break; + + case 80: // stmt_case: "case" expr_integer ":" +#line 493 "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 2783 "parser.cpp" + break; + + case 81: // stmt_case: "case" expr_string ":" +#line 495 "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 2789 "parser.cpp" + break; + + case 82: // stmt_default: "default" ":" +#line 500 "parser.ypp" + { yylhs.value.as < ast::stmt_default::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } +#line 2795 "parser.cpp" + break; + + case 83: // stmt_break: "break" ";" +#line 505 "parser.ypp" + { yylhs.value.as < ast::stmt_break::ptr > () = std::make_unique(yylhs.location); } +#line 2801 "parser.cpp" + break; + + case 84: // stmt_continue: "continue" ";" +#line 510 "parser.ypp" + { yylhs.value.as < ast::stmt_continue::ptr > () = std::make_unique(yylhs.location); } +#line 2807 "parser.cpp" + break; + + case 85: // stmt_return: "return" expr ";" +#line 515 "parser.ypp" + { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } +#line 2813 "parser.cpp" + break; + + case 86: // stmt_return: "return" ";" +#line 517 "parser.ypp" + { yylhs.value.as < ast::stmt_return::ptr > () = std::make_unique(yylhs.location, std::make_unique(yylhs.location)); } +#line 2819 "parser.cpp" + break; + + case 87: // stmt_breakpoint: "breakpoint" ";" +#line 522 "parser.ypp" + { yylhs.value.as < ast::stmt_breakpoint::ptr > () = std::make_unique(yylhs.location); } +#line 2825 "parser.cpp" + break; + + case 88: // stmt_prof_begin: "prof_begin" "(" expr_arguments ")" ";" +#line 527 "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 2831 "parser.cpp" + break; + + case 89: // stmt_prof_end: "prof_end" "(" expr_arguments ")" ";" +#line 532 "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 2837 "parser.cpp" + break; + + case 90: // expr: expr_ternary +#line 536 "parser.ypp" + { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } +#line 2843 "parser.cpp" + break; + + case 91: // expr: expr_binary +#line 537 "parser.ypp" + { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } +#line 2849 "parser.cpp" + break; + + case 92: // expr: expr_primitive +#line 538 "parser.ypp" + { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } +#line 2855 "parser.cpp" + break; + + case 93: // expr_or_empty: expr +#line 542 "parser.ypp" + { yylhs.value.as < ast::expr > () = std::move(yystack_[0].value.as < ast::expr > ()); } +#line 2861 "parser.cpp" + break; + + case 94: // expr_or_empty: %empty +#line 543 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location); } +#line 2867 "parser.cpp" + break; + + case 95: // expr_assign: expr_object "=" expr +#line 548 "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 2873 "parser.cpp" + break; + + case 96: // expr_assign: expr_object "|=" expr +#line 550 "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 2879 "parser.cpp" + break; + + case 97: // expr_assign: expr_object "&=" expr +#line 552 "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 2885 "parser.cpp" + break; + + case 98: // expr_assign: expr_object "^=" expr +#line 554 "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 2891 "parser.cpp" + break; + + case 99: // expr_assign: expr_object "<<=" expr +#line 556 "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 2897 "parser.cpp" + break; + + case 100: // expr_assign: expr_object ">>=" expr +#line 558 "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 2903 "parser.cpp" + break; + + case 101: // expr_assign: expr_object "+=" expr +#line 560 "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 2909 "parser.cpp" + break; + + case 102: // expr_assign: expr_object "-=" expr +#line 562 "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 2915 "parser.cpp" + break; + + case 103: // expr_assign: expr_object "*=" expr +#line 564 "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 2921 "parser.cpp" + break; + + case 104: // expr_assign: expr_object "/=" expr +#line 566 "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 2927 "parser.cpp" + break; + + case 105: // expr_assign: expr_object "%=" expr +#line 568 "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 2933 "parser.cpp" + break; + + case 106: // expr_increment: "++" expr_object +#line 573 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } +#line 2939 "parser.cpp" + break; + + case 107: // expr_increment: expr_object "++" +#line 575 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } +#line 2945 "parser.cpp" + break; + + case 108: // expr_decrement: "--" expr_object +#line 580 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ()), true); } +#line 2951 "parser.cpp" + break; + + case 109: // expr_decrement: expr_object "--" +#line 582 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), false); } +#line 2957 "parser.cpp" + break; + + case 110: // expr_ternary: expr "?" expr ":" expr +#line 587 "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 2963 "parser.cpp" + break; + + case 111: // expr_binary: expr "||" expr +#line 592 "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 2969 "parser.cpp" + break; + + case 112: // expr_binary: expr "&&" expr +#line 594 "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 2975 "parser.cpp" + break; + + case 113: // expr_binary: expr "==" expr +#line 596 "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 2981 "parser.cpp" + break; + + case 114: // expr_binary: expr "!=" expr +#line 598 "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 2987 "parser.cpp" + break; + + case 115: // expr_binary: expr "<=" expr +#line 600 "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 2993 "parser.cpp" + break; + + case 116: // expr_binary: expr ">=" expr +#line 602 "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 2999 "parser.cpp" + break; + + case 117: // expr_binary: expr "<" expr +#line 604 "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 3005 "parser.cpp" + break; + + case 118: // expr_binary: expr ">" expr +#line 606 "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 3011 "parser.cpp" + break; + + case 119: // expr_binary: expr "|" expr +#line 608 "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 3017 "parser.cpp" + break; + + case 120: // expr_binary: expr "&" expr +#line 610 "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 3023 "parser.cpp" + break; + + case 121: // expr_binary: expr "^" expr +#line 612 "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 3029 "parser.cpp" + break; + + case 122: // expr_binary: expr "<<" expr +#line 614 "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 3035 "parser.cpp" + break; + + case 123: // expr_binary: expr ">>" expr +#line 616 "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 3041 "parser.cpp" + break; + + case 124: // expr_binary: expr "+" expr +#line 618 "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 3047 "parser.cpp" + break; + + case 125: // expr_binary: expr "-" expr +#line 620 "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 3053 "parser.cpp" + break; + + case 126: // expr_binary: expr "*" expr +#line 622 "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 3059 "parser.cpp" + break; + + case 127: // expr_binary: expr "/" expr +#line 624 "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 3065 "parser.cpp" + break; + + case 128: // expr_binary: expr "%" expr +#line 626 "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 3071 "parser.cpp" + break; + + case 129: // expr_primitive: expr_complement +#line 630 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_complement::ptr > ()); } +#line 3077 "parser.cpp" + break; + + case 130: // expr_primitive: expr_not +#line 631 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_not::ptr > ()); } +#line 3083 "parser.cpp" + break; + + case 131: // expr_primitive: expr_call +#line 632 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } +#line 3089 "parser.cpp" + break; + + case 132: // expr_primitive: expr_method +#line 633 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } +#line 3095 "parser.cpp" + break; + + case 133: // expr_primitive: expr_getnextarraykey +#line 634 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getnextarraykey::ptr > ()); } +#line 3101 "parser.cpp" + break; + + case 134: // expr_primitive: expr_getfirstarraykey +#line 635 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getfirstarraykey::ptr > ()); } +#line 3107 "parser.cpp" + break; + + case 135: // expr_primitive: expr_getdvarcoloralpha +#line 636 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarcoloralpha::ptr > ()); } +#line 3113 "parser.cpp" + break; + + case 136: // expr_primitive: expr_getdvarcolorblue +#line 637 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarcolorblue::ptr > ()); } +#line 3119 "parser.cpp" + break; + + case 137: // expr_primitive: expr_getdvarcolorgreen +#line 638 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarcolorgreen::ptr > ()); } +#line 3125 "parser.cpp" + break; + + case 138: // expr_primitive: expr_getdvarcolorred +#line 639 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarcolorred::ptr > ()); } +#line 3131 "parser.cpp" + break; + + case 139: // expr_primitive: expr_getdvarvector +#line 640 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarvector::ptr > ()); } +#line 3137 "parser.cpp" + break; + + case 140: // expr_primitive: expr_getdvarfloat +#line 641 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarfloat::ptr > ()); } +#line 3143 "parser.cpp" + break; + + case 141: // expr_primitive: expr_getdvarint +#line 642 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvarint::ptr > ()); } +#line 3149 "parser.cpp" + break; + + case 142: // expr_primitive: expr_getdvar +#line 643 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_getdvar::ptr > ()); } +#line 3155 "parser.cpp" + break; + + case 143: // expr_primitive: expr_gettime +#line 644 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_gettime::ptr > ()); } +#line 3161 "parser.cpp" + break; + + case 144: // expr_primitive: expr_abs +#line 645 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_abs::ptr > ()); } +#line 3167 "parser.cpp" + break; + + case 145: // expr_primitive: expr_vectortoangles +#line 646 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vectortoangles::ptr > ()); } +#line 3173 "parser.cpp" + break; + + case 146: // expr_primitive: expr_angleclamp180 +#line 647 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_angleclamp180::ptr > ()); } +#line 3179 "parser.cpp" + break; + + case 147: // expr_primitive: expr_anglestoforward +#line 648 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anglestoforward::ptr > ()); } +#line 3185 "parser.cpp" + break; + + case 148: // expr_primitive: expr_anglestoright +#line 649 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anglestoright::ptr > ()); } +#line 3191 "parser.cpp" + break; + + case 149: // expr_primitive: expr_anglestoup +#line 650 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anglestoup::ptr > ()); } +#line 3197 "parser.cpp" + break; + + case 150: // expr_primitive: expr_vectorscale +#line 651 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vectorscale::ptr > ()); } +#line 3203 "parser.cpp" + break; + + case 151: // expr_primitive: expr_isdefined +#line 652 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_isdefined::ptr > ()); } +#line 3209 "parser.cpp" + break; + + case 152: // expr_primitive: expr_reference +#line 653 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_reference::ptr > ()); } +#line 3215 "parser.cpp" + break; + + case 153: // expr_primitive: expr_array +#line 654 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } +#line 3221 "parser.cpp" + break; + + case 154: // expr_primitive: expr_field +#line 655 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } +#line 3227 "parser.cpp" + break; + + case 155: // expr_primitive: expr_size +#line 656 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_size::ptr > ()); } +#line 3233 "parser.cpp" + break; + + case 156: // expr_primitive: expr_paren +#line 657 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_paren::ptr > ()); } +#line 3239 "parser.cpp" + break; + + case 157: // expr_primitive: expr_empty_array +#line 658 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_empty_array::ptr > ()); } +#line 3245 "parser.cpp" + break; + + case 158: // expr_primitive: expr_undefined +#line 659 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_undefined::ptr > ()); } +#line 3251 "parser.cpp" + break; + + case 159: // expr_primitive: expr_game +#line 660 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } +#line 3257 "parser.cpp" + break; + + case 160: // expr_primitive: expr_self +#line 661 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } +#line 3263 "parser.cpp" + break; + + case 161: // expr_primitive: expr_anim +#line 662 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } +#line 3269 "parser.cpp" + break; + + case 162: // expr_primitive: expr_level +#line 663 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } +#line 3275 "parser.cpp" + break; + + case 163: // expr_primitive: expr_animation +#line 664 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_animation::ptr > ()); } +#line 3281 "parser.cpp" + break; + + case 164: // expr_primitive: expr_identifier +#line 665 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } +#line 3287 "parser.cpp" + break; + + case 165: // expr_primitive: expr_istring +#line 666 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_istring::ptr > ()); } +#line 3293 "parser.cpp" + break; + + case 166: // expr_primitive: expr_string +#line 667 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_string::ptr > ()); } +#line 3299 "parser.cpp" + break; + + case 167: // expr_primitive: expr_vector +#line 668 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_vector::ptr > ()); } +#line 3305 "parser.cpp" + break; + + case 168: // expr_primitive: expr_hash +#line 669 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_hash::ptr > ()); } +#line 3311 "parser.cpp" + break; + + case 169: // expr_primitive: expr_float +#line 670 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_float::ptr > ()); } +#line 3317 "parser.cpp" + break; + + case 170: // expr_primitive: expr_integer +#line 671 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_integer::ptr > ()); } +#line 3323 "parser.cpp" + break; + + case 171: // expr_primitive: expr_false +#line 672 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_false::ptr > ()); } +#line 3329 "parser.cpp" + break; + + case 172: // expr_primitive: expr_true +#line 673 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_true::ptr > ()); } +#line 3335 "parser.cpp" + break; + + case 173: // expr_complement: "~" expr +#line 678 "parser.ypp" + { yylhs.value.as < ast::expr_complement::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } +#line 3341 "parser.cpp" + break; + + case 174: // expr_not: "!" expr +#line 683 "parser.ypp" + { yylhs.value.as < ast::expr_not::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::expr > ())); } +#line 3347 "parser.cpp" + break; + + case 175: // expr_call: expr_function +#line 687 "parser.ypp" + { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } +#line 3353 "parser.cpp" + break; + + case 176: // expr_call: expr_pointer +#line 688 "parser.ypp" + { yylhs.value.as < ast::expr_call::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[0].value.as < ast::call > ())); } +#line 3359 "parser.cpp" + break; + + case 177: // expr_method: expr_object expr_function +#line 691 "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 3365 "parser.cpp" + break; + + case 178: // expr_method: expr_object expr_pointer +#line 692 "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 3371 "parser.cpp" + break; + + case 179: // expr_function: expr_identifier "(" expr_arguments ")" +#line 697 "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 3377 "parser.cpp" + break; + + case 180: // expr_function: expr_path "::" expr_identifier "(" expr_arguments ")" +#line 699 "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 3383 "parser.cpp" + break; + + case 181: // expr_function: "thread" expr_identifier "(" expr_arguments ")" +#line 701 "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 3389 "parser.cpp" + break; + + case 182: // expr_function: "thread" expr_path "::" expr_identifier "(" expr_arguments ")" +#line 703 "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 3395 "parser.cpp" + break; + + case 183: // expr_pointer: "[" "[" expr "]" "]" "(" expr_arguments ")" +#line 708 "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 3401 "parser.cpp" + break; + + case 184: // expr_pointer: "thread" "[" "[" expr "]" "]" "(" expr_arguments ")" +#line 710 "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 3407 "parser.cpp" + break; + + case 185: // expr_parameters: expr_parameters "," expr_identifier +#line 715 "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_identifier::ptr > ())); } +#line 3413 "parser.cpp" + break; + + case 186: // expr_parameters: expr_identifier +#line 717 "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_identifier::ptr > ())); } +#line 3419 "parser.cpp" + break; + + case 187: // expr_parameters: %empty +#line 719 "parser.ypp" + { yylhs.value.as < ast::expr_parameters::ptr > () = std::make_unique(yylhs.location); } +#line 3425 "parser.cpp" + break; + + case 188: // expr_arguments: expr_arguments_no_empty +#line 724 "parser.ypp" + { yylhs.value.as < ast::expr_arguments::ptr > () = std::move(yystack_[0].value.as < ast::expr_arguments::ptr > ()); } +#line 3431 "parser.cpp" + break; + + case 189: // expr_arguments: %empty +#line 726 "parser.ypp" + { yylhs.value.as < ast::expr_arguments::ptr > () = std::make_unique(yylhs.location); } +#line 3437 "parser.cpp" + break; + + case 190: // expr_arguments_no_empty: expr_arguments "," expr +#line 731 "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 3443 "parser.cpp" + break; + + case 191: // expr_arguments_no_empty: expr +#line 733 "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 3449 "parser.cpp" + break; + + case 192: // expr_getnextarraykey: "getnextarraykey" "(" expr "," expr ")" +#line 738 "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 3455 "parser.cpp" + break; + + case 193: // expr_getfirstarraykey: "getfirstarraykey" "(" expr ")" +#line 743 "parser.ypp" + { yylhs.value.as < ast::expr_getfirstarraykey::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } +#line 3461 "parser.cpp" + break; + + case 194: // expr_getdvarcoloralpha: "getdvarcoloralpha" "(" expr ")" +#line 748 "parser.ypp" + { yylhs.value.as < ast::expr_getdvarcoloralpha::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } +#line 3467 "parser.cpp" + break; + + case 195: // expr_getdvarcolorblue: "getdvarcolorblue" "(" expr ")" +#line 753 "parser.ypp" + { yylhs.value.as < ast::expr_getdvarcolorblue::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } +#line 3473 "parser.cpp" + break; + + case 196: // expr_getdvarcolorgreen: "getdvarcolorgreen" "(" expr ")" +#line 758 "parser.ypp" + { yylhs.value.as < ast::expr_getdvarcolorgreen::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } +#line 3479 "parser.cpp" + break; + + case 197: // expr_getdvarcolorred: "getdvarcolorred" "(" expr ")" +#line 763 "parser.ypp" + { yylhs.value.as < ast::expr_getdvarcolorred::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } +#line 3485 "parser.cpp" + break; + + case 198: // expr_getdvarvector: "getdvarvector" "(" expr ")" +#line 768 "parser.ypp" + { yylhs.value.as < ast::expr_getdvarvector::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } +#line 3491 "parser.cpp" + break; + + case 199: // expr_getdvarfloat: "getdvarfloat" "(" expr ")" +#line 773 "parser.ypp" + { yylhs.value.as < ast::expr_getdvarfloat::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } +#line 3497 "parser.cpp" + break; + + case 200: // expr_getdvarint: "getdvarint" "(" expr ")" +#line 778 "parser.ypp" + { yylhs.value.as < ast::expr_getdvarint::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } +#line 3503 "parser.cpp" + break; + + case 201: // expr_getdvar: "getdvar" "(" expr ")" +#line 783 "parser.ypp" + { yylhs.value.as < ast::expr_getdvar::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } +#line 3509 "parser.cpp" + break; + + case 202: // expr_gettime: "gettime" "(" ")" +#line 788 "parser.ypp" + { yylhs.value.as < ast::expr_gettime::ptr > () = std::make_unique(yylhs.location); } +#line 3515 "parser.cpp" + break; + + case 203: // expr_abs: "abs" "(" expr ")" +#line 793 "parser.ypp" + { yylhs.value.as < ast::expr_abs::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } +#line 3521 "parser.cpp" + break; + + case 204: // expr_vectortoangles: "vectortoangles" "(" expr ")" +#line 798 "parser.ypp" + { yylhs.value.as < ast::expr_vectortoangles::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } +#line 3527 "parser.cpp" + break; + + case 205: // expr_angleclamp180: "angleclamp180" "(" expr ")" +#line 803 "parser.ypp" + { yylhs.value.as < ast::expr_angleclamp180::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } +#line 3533 "parser.cpp" + break; + + case 206: // expr_anglestoforward: "anglestoforward" "(" expr ")" +#line 808 "parser.ypp" + { yylhs.value.as < ast::expr_anglestoforward::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } +#line 3539 "parser.cpp" + break; + + case 207: // expr_anglestoright: "anglestoright" "(" expr ")" +#line 813 "parser.ypp" + { yylhs.value.as < ast::expr_anglestoright::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } +#line 3545 "parser.cpp" + break; + + case 208: // expr_anglestoup: "anglestoup" "(" expr ")" +#line 818 "parser.ypp" + { yylhs.value.as < ast::expr_anglestoup::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } +#line 3551 "parser.cpp" + break; + + case 209: // expr_vectorscale: "vectorscale" "(" expr "," expr ")" +#line 823 "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 3557 "parser.cpp" + break; + + case 210: // expr_isdefined: "isdefined" "(" expr ")" +#line 828 "parser.ypp" + { yylhs.value.as < ast::expr_isdefined::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } +#line 3563 "parser.cpp" + break; + + case 211: // expr_reference: "::" expr_identifier +#line 833 "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 3569 "parser.cpp" + break; + + case 212: // expr_reference: expr_path "::" expr_identifier +#line 835 "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 3575 "parser.cpp" + break; + + case 213: // expr_array: expr_object "[" expr "]" +#line 840 "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 3581 "parser.cpp" + break; + + case 214: // expr_field: expr_object "." expr_identifier +#line 845 "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 3587 "parser.cpp" + break; + + case 215: // expr_field: expr_object "field" +#line 847 "parser.ypp" + { yylhs.value.as < ast::expr_field::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ()), std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ())); } +#line 3593 "parser.cpp" + break; + + case 216: // expr_size: expr_object ".size" +#line 852 "parser.ypp" + { yylhs.value.as < ast::expr_size::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } +#line 3599 "parser.cpp" + break; + + case 217: // expr_paren: "(" expr ")" +#line 857 "parser.ypp" + { yylhs.value.as < ast::expr_paren::ptr > () = std::make_unique(yylhs.location, std::move(yystack_[1].value.as < ast::expr > ())); } +#line 3605 "parser.cpp" + break; + + case 218: // expr_object: expr_call +#line 861 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_call::ptr > ()); } +#line 3611 "parser.cpp" + break; + + case 219: // expr_object: expr_method +#line 862 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_method::ptr > ()); } +#line 3617 "parser.cpp" + break; + + case 220: // expr_object: expr_array +#line 863 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_array::ptr > ()); } +#line 3623 "parser.cpp" + break; + + case 221: // expr_object: expr_field +#line 864 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_field::ptr > ()); } +#line 3629 "parser.cpp" + break; + + case 222: // expr_object: expr_game +#line 865 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_game::ptr > ()); } +#line 3635 "parser.cpp" + break; + + case 223: // expr_object: expr_self +#line 866 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_self::ptr > ()); } +#line 3641 "parser.cpp" + break; + + case 224: // expr_object: expr_anim +#line 867 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_anim::ptr > ()); } +#line 3647 "parser.cpp" + break; + + case 225: // expr_object: expr_level +#line 868 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_level::ptr > ()); } +#line 3653 "parser.cpp" + break; + + case 226: // expr_object: expr_identifier +#line 869 "parser.ypp" + { yylhs.value.as < ast::expr > ().as_node = std::move(yystack_[0].value.as < ast::expr_identifier::ptr > ()); } +#line 3659 "parser.cpp" + break; + + case 227: // expr_empty_array: "[" "]" +#line 874 "parser.ypp" + { yylhs.value.as < ast::expr_empty_array::ptr > () = std::make_unique(yylhs.location); } +#line 3665 "parser.cpp" + break; + + case 228: // expr_undefined: "undefined" +#line 879 "parser.ypp" + { yylhs.value.as < ast::expr_undefined::ptr > () = std::make_unique(yylhs.location); } +#line 3671 "parser.cpp" + break; + + case 229: // expr_game: "game" +#line 884 "parser.ypp" + { yylhs.value.as < ast::expr_game::ptr > () = std::make_unique(yylhs.location); } +#line 3677 "parser.cpp" + break; + + case 230: // expr_self: "self" +#line 889 "parser.ypp" + { yylhs.value.as < ast::expr_self::ptr > () = std::make_unique(yylhs.location); } +#line 3683 "parser.cpp" + break; + + case 231: // expr_anim: "anim" +#line 894 "parser.ypp" + { yylhs.value.as < ast::expr_anim::ptr > () = std::make_unique(yylhs.location); } +#line 3689 "parser.cpp" + break; + + case 232: // expr_level: "level" +#line 899 "parser.ypp" + { yylhs.value.as < ast::expr_level::ptr > () = std::make_unique(yylhs.location); } +#line 3695 "parser.cpp" + break; + + case 233: // expr_animation: "%" "identifier" +#line 904 "parser.ypp" + { yylhs.value.as < ast::expr_animation::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3701 "parser.cpp" + break; + + case 234: // expr_identifier: "identifier" +#line 909 "parser.ypp" + { yylhs.value.as < ast::expr_identifier::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3707 "parser.cpp" + break; + + case 235: // expr_path: "path" +#line 914 "parser.ypp" + { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3713 "parser.cpp" + break; + + case 236: // expr_path: expr_identifier +#line 916 "parser.ypp" + { yylhs.value.as < ast::expr_path::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < ast::expr_identifier::ptr > ()->value); } +#line 3719 "parser.cpp" + break; + + case 237: // expr_istring: "localized string" +#line 921 "parser.ypp" + { yylhs.value.as < ast::expr_istring::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3725 "parser.cpp" + break; + + case 238: // expr_string: "string literal" +#line 926 "parser.ypp" + { yylhs.value.as < ast::expr_string::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3731 "parser.cpp" + break; + + case 239: // expr_vector: "(" expr "," expr "," expr ")" +#line 931 "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 3737 "parser.cpp" + break; + + case 240: // expr_hash: "hash" +#line 936 "parser.ypp" + { yylhs.value.as < ast::expr_hash::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3743 "parser.cpp" + break; + + case 241: // expr_float: "-" "float" +#line 941 "parser.ypp" + { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } +#line 3749 "parser.cpp" + break; + + case 242: // expr_float: "float" +#line 943 "parser.ypp" + { yylhs.value.as < ast::expr_float::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3755 "parser.cpp" + break; + + case 243: // expr_integer: "-" "integer" +#line 948 "parser.ypp" + { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, "-" + yystack_[0].value.as < std::string > ()); } +#line 3761 "parser.cpp" + break; + + case 244: // expr_integer: "integer" +#line 950 "parser.ypp" + { yylhs.value.as < ast::expr_integer::ptr > () = std::make_unique(yylhs.location, yystack_[0].value.as < std::string > ()); } +#line 3767 "parser.cpp" + break; + + case 245: // expr_false: "false" +#line 955 "parser.ypp" + { yylhs.value.as < ast::expr_false::ptr > () = std::make_unique(yylhs.location); } +#line 3773 "parser.cpp" + break; + + case 246: // expr_true: "true" +#line 960 "parser.ypp" + { yylhs.value.as < ast::expr_true::ptr > () = std::make_unique(yylhs.location); } +#line 3779 "parser.cpp" + break; + + +#line 3783 "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", "endon", "notify", "wait", "waittill", + "waittillmatch", "waittillframeend", "if", "else", "do", "while", "for", + "foreach", "in", "switch", "case", "default", "break", "continue", + "return", "breakpoint", "prof_begin", "prof_end", "thread", "true", + "false", "undefined", ".size", "game", "self", "anim", "level", + "getnextarraykey", "getfirstarraykey", "getdvarcoloralpha", + "getdvarcolorblue", "getdvarcolorgreen", "getdvarcolorred", + "getdvarvector", "getdvarfloat", "getdvarint", "getdvar", "gettime", + "abs", "vectortoangles", "angleclamp180", "anglestoforward", + "anglestoright", "anglestoup", "vectorscale", "isdefined", "(", ")", "{", + "}", "[", "]", ",", ".", "::", ":", ";", "?", "++", "--", "<<", ">>", + "||", "&&", "==", "!=", "<=", ">=", "<", ">", "!", "~", "=", "+=", "-=", + "*=", "/=", "%=", "|=", "&=", "^=", ">>=", "<<=", "|", "&", "^", "+", + "-", "*", "/", "%", "field", "path", "identifier", "string literal", + "localized string", "hash", "float", "integer", "THEN", "TERN", "NEG", + "ANIMREF", "PREINC", "PREDEC", "POSTINC", "POSTDEC", "$accept", "root", + "program", "inline", "include", "declaration", "decl_usingtree", + "decl_constant", "decl_thread", "stmt", "stmt_or_dev", "stmt_list", + "stmt_or_dev_list", "stmt_dev", "stmt_block", "stmt_expr", "stmt_call", + "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_breakpoint", "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_not", "expr_call", "expr_method", + "expr_function", "expr_pointer", "expr_parameters", "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_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_) + { +#if T6DEBUG + YYCDEBUG << "LAC: initial context established for " + << symbol_name (yytoken) << '\n'; +#endif + yy_lac_established_ = true; + return yy_lac_check_ (yytoken); + } + return true; + } + + // Discard any previous initial lookahead context. + void + parser::yy_lac_discard_ (const char* evt) + { + /* 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 " + << evt << '\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_ = -446; + + const short parser::yytable_ninf_ = -237; + + const short + parser::yypact_[] = + { + 15, -446, -446, -65, -65, -49, -446, 21, 15, -446, + -446, -446, -446, -446, -446, -50, -446, -446, -42, -32, + -58, -446, -446, -446, -446, -37, 1203, -446, -446, -446, + 12, -12, -446, -27, -446, -446, -446, -446, -446, -446, + -446, 16, 22, 24, 33, 34, 43, 51, 70, 73, + 80, 81, 87, 89, 93, 96, 100, 104, 106, 114, + 1203, -2, -37, 1203, 1203, 46, 69, -446, -446, -446, + -446, 2544, -446, -446, -446, -446, -446, 45, 167, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, 336, 384, -446, -446, 391, -446, -446, 531, 537, + 731, 905, -446, 95, 38, -446, -446, -446, -446, -446, + -446, -446, -446, 105, 115, -37, 117, 119, 118, 1203, + 1203, 1203, 1203, 1203, 1203, 1203, 1203, 1203, 1203, 122, + 1203, 1203, 1203, 1203, 1203, 1203, 1203, 1203, 1300, 1203, + -446, -446, -446, -446, -446, -446, -446, -446, 1203, 1203, + 1203, 1203, 1203, 1203, 1203, 1203, 1203, 1203, 1203, 1203, + 1203, 1203, 1203, 1203, 1203, 1203, 1203, -446, 1284, -37, + -446, -446, -446, 125, 120, 1203, -37, -446, 750, -446, + -446, 1203, 1203, -37, 2395, 1466, 1500, 1534, 1568, 1602, + 1636, 1670, 1704, 1738, -446, 1772, 1806, 1840, 1874, 1908, + 1942, 2434, 1976, -446, 1203, 1037, 2509, 220, 220, 2658, + 966, 950, 950, 68, 68, 68, 68, 2668, 2709, 2699, + 42, 42, -446, -446, -446, 1041, 1199, -446, -37, 2627, + -9, -446, 129, 872, 1203, 123, 132, 965, 138, 144, + 145, 147, -83, 139, 140, 142, 1122, 146, 154, 157, + -446, 155, 7, 7, -446, -446, 843, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, 148, 151, 152, 153, 156, -446, -446, 567, + -446, -446, -446, -446, -20, 2356, -1, 165, 1203, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, 1203, -446, 2473, 162, 1203, -446, + 129, -446, 1203, 1203, -446, -446, 936, 2579, -446, 1203, + 210, 1203, -6, -37, 1203, 124, 166, 169, -446, -446, + -446, -446, 2614, -446, 1203, 1203, -446, -446, 19, 19, + -446, -446, -446, -446, -446, -446, -446, 182, 184, 187, + 190, -446, -446, 1203, 1203, 1203, 1203, 1203, 1203, 1203, + 1203, 1203, 1203, 1203, 186, -446, 1203, 2010, 2044, 1203, + 198, 2627, 2627, 3, -446, -446, -446, 2078, 202, 2112, + 193, -446, -446, -446, 633, -13, 2146, -446, -446, -446, + 29, 31, 1203, 1203, 1203, 1203, 2627, 2627, 2627, 2627, + 2627, 2627, 2627, 2627, 2627, 2627, 2627, 206, 49, -446, + -446, 2180, 1203, -446, 965, 1203, 965, 1203, 1203, -37, + 115, 197, 199, 2214, 1344, 1388, 1432, 1203, -446, -446, + 62, 258, 2248, -446, 2627, 207, 2282, 257, -446, -446, + -446, 211, 213, 1203, 216, 1203, 217, 1203, 71, -446, + 965, 218, -6, 965, 1203, -446, -446, 214, 229, -446, + 231, -446, 233, -446, -446, -446, 235, -446, 2316, 232, + 236, 240, 965, 965, -446, -446, -446, -446, -446 + }; + + const unsigned char + parser::yydefact_[] = + { + 3, 12, 13, 0, 0, 0, 234, 0, 2, 7, + 8, 9, 14, 15, 16, 0, 235, 236, 0, 0, + 0, 1, 4, 5, 6, 187, 0, 10, 11, 238, + 0, 0, 186, 0, 246, 245, 228, 229, 230, 231, + 232, 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, 237, 240, 242, + 244, 0, 90, 91, 92, 129, 130, 131, 132, 175, + 176, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 0, 157, 158, 159, 160, + 161, 162, 163, 164, 0, 165, 166, 167, 168, 169, + 170, 171, 172, 0, 0, 0, 0, 236, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 227, 211, 174, 173, 241, 243, 233, 18, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 216, 0, 0, + 215, 177, 178, 236, 0, 189, 0, 17, 0, 19, + 185, 0, 189, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 202, 0, 0, 0, 0, 0, + 0, 0, 0, 217, 0, 0, 0, 122, 123, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 124, 125, 126, 127, 128, 0, 0, 214, 0, 191, + 0, 188, 212, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 53, 0, 0, 0, 44, 49, 0, 45, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 0, 0, 0, 218, 219, 220, 221, 0, + 222, 223, 224, 225, 226, 0, 0, 0, 0, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 203, 204, + 205, 206, 207, 208, 0, 210, 0, 0, 0, 213, + 0, 179, 0, 189, 51, 47, 0, 0, 71, 0, + 0, 0, 57, 0, 0, 0, 0, 0, 82, 83, + 84, 86, 0, 87, 189, 189, 218, 219, 106, 108, + 52, 48, 60, 61, 62, 58, 59, 0, 0, 0, + 0, 107, 109, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 181, 189, 0, 0, 0, + 0, 110, 190, 0, 50, 46, 66, 0, 0, 0, + 0, 54, 55, 56, 0, 0, 0, 81, 80, 85, + 0, 0, 0, 0, 0, 0, 95, 101, 102, 103, + 104, 105, 96, 97, 98, 100, 99, 0, 0, 192, + 209, 0, 189, 180, 0, 0, 0, 94, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 189, 182, 239, + 0, 72, 0, 74, 93, 0, 0, 0, 79, 88, + 89, 0, 0, 189, 0, 189, 0, 189, 0, 183, + 0, 0, 57, 0, 0, 63, 65, 0, 188, 68, + 188, 70, 188, 184, 73, 75, 0, 77, 0, 0, + 0, 0, 0, 0, 64, 67, 69, 76, 78 + }; + + const short + parser::yypgoto_[] = + { + -446, -446, -446, 297, 301, 324, -446, -446, -446, -234, + 72, -446, -446, -446, -123, -137, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, 377, + -446, -337, -332, -328, -446, -446, -446, -446, -446, -182, + -169, -98, -82, -446, 27, -445, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -446, -446, -446, -446, + -446, -446, -446, -446, -446, -446, -152, -139, -446, -446, + -121, -446, -446, -17, 126, 222, 366, -446, 0, 8, + -446, -18, -446, -446, -446, 85, -446, -446 + }; + + const short + parser::yydefgoto_[] = + { + 0, 7, 8, 9, 10, 11, 12, 13, 14, 264, + 265, 336, 266, 267, 268, 400, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 239, + 455, 292, 293, 294, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 31, 477, 241, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122 + }; + + const short + parser::yytable_[] = + { + 15, 189, 30, 17, 17, 401, 295, 181, 15, 335, + 402, 18, 19, 340, 403, 438, 25, 20, 478, 296, + 480, 21, 482, 182, 345, 32, 1, 2, 3, 4, + 5, 29, 33, 127, 27, 70, 297, 37, 38, 39, + 40, 128, 26, 126, 28, 33, 185, 16, 6, 298, + 37, 38, 39, 40, -236, 124, 29, 33, 331, 439, + 125, 295, 151, 332, 261, 295, 385, 299, 149, 150, + 433, 332, 262, 263, 296, 332, 6, 261, 296, 123, + 356, 356, 129, -218, 295, 16, 6, -218, 130, 178, + 131, 297, 179, 357, 357, 297, 441, 296, 442, 132, + 133, 332, 395, 332, 298, 183, 16, 6, 298, 134, + 297, 297, 186, 184, 297, -218, 448, 135, -218, 16, + 6, 332, 299, 298, 298, 190, 299, 298, 6, 469, + 180, 16, 6, -226, 332, 401, 136, -226, 483, 137, + 402, 358, 359, 332, 403, 299, 138, 139, 159, 160, + 174, 175, 176, 140, 295, 141, -218, -218, -218, 142, + 356, 185, 143, 154, 155, -226, 144, 296, -226, -236, + 145, 300, 146, 357, 172, 173, 174, 175, 176, 237, + 147, 187, 156, 188, 297, 192, 242, 191, 304, 204, + 297, 185, 193, 307, 238, 333, 184, 298, 339, 338, + 451, 181, 453, 298, 341, -219, -226, -226, -226, -219, + 342, 343, 240, 344, 348, 299, 349, 182, 350, 306, + 354, 404, 353, 355, 362, 149, 300, 363, 364, 365, + 300, 386, 366, 390, 346, 398, 484, -219, 330, 487, + -219, 407, 155, 304, 408, 300, 300, 304, 412, 300, + 413, 184, 295, 414, 295, 184, 415, 427, 497, 498, + 181, 181, 304, 304, 432, 296, 304, 296, 435, 437, + 184, 184, 447, 459, 184, 460, 182, 182, -219, -219, + -219, 470, 297, 472, 297, 474, 332, 475, 295, 476, + 356, 295, 479, 481, 485, 298, 489, 298, 490, 183, + 491, 296, 492, 357, 296, 22, 181, 184, 494, 23, + 295, 295, 495, 299, 301, 299, 496, 458, 297, 300, + 297, 297, 182, 296, 296, 300, 172, 173, 174, 175, + 176, 298, 24, 298, 298, 486, 304, 347, 361, 0, + 297, 297, 304, 405, 184, 0, 0, 0, 0, 299, + 184, 404, 299, 298, 298, 0, 0, 0, 183, 183, + 393, 0, 0, 0, 0, 0, 184, 184, 0, 301, + 0, 299, 299, 301, -220, 0, 0, 0, -220, 0, + 0, 410, 411, 0, 0, 0, 0, 0, 301, 301, + 0, 0, 301, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 71, 183, 0, -220, 0, 0, -220, + 302, 0, 184, 428, 0, 0, 0, 300, 0, 300, + 0, 0, -221, 0, 0, 0, -221, 0, 0, 33, + 0, 0, 0, 177, 304, 0, 304, 148, 0, 457, + 152, 153, 184, 0, 184, 0, 0, -220, -220, -220, + 0, 0, 0, 300, -221, 300, 300, -221, 0, 450, + 0, 178, 301, 0, 179, 302, 0, 0, 301, 302, + 304, 0, 304, 304, 468, 300, 300, 0, 184, 0, + 184, 184, 0, 0, 302, 302, 0, 0, 302, 0, + 0, 0, 304, 304, 0, -221, -221, -221, 0, 0, + 184, 184, 180, 16, 6, 0, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 0, 205, 206, 207, + 208, 209, 210, 211, 212, 0, 215, 0, 0, 0, + 0, 0, 0, 0, 0, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 303, 236, 0, 0, 302, 0, + 301, 0, 301, 0, 302, 0, 0, 0, 305, -222, + 0, 0, 0, -222, 0, -223, 0, 0, 0, -223, + 0, 0, 0, 367, 368, 0, 369, 370, 0, 0, + 0, 326, 0, 0, 0, 0, 301, 0, 301, 301, + 0, -222, 0, 0, -222, 33, 0, -223, 0, 303, + -223, 0, 215, 303, 0, 0, 0, 0, 301, 301, + 0, 337, 0, 0, 0, 0, 0, 0, 303, 303, + 0, 0, 303, 352, 0, 0, 0, 178, 0, 0, + 179, 0, -222, -222, -222, 371, 372, 0, -223, -223, + -223, 0, 0, 0, 0, 0, 302, 0, 302, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, + 0, 33, 0, 0, 0, 0, 0, 0, 180, 16, + 6, 0, 0, 0, 0, 387, 0, 0, 0, 0, + 0, 0, 302, 0, 302, 302, 0, 0, 0, 0, + 0, 388, 303, 178, 0, 391, 179, 0, 303, 392, + 0, 371, 372, 0, 302, 302, 397, 0, 399, 0, + 0, 406, 0, 0, 0, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 0, 0, 0, 0, + 0, 0, 0, 0, 180, 16, 6, 0, 0, 0, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 243, 0, 0, 0, 0, 431, 0, 244, -224, + 0, 245, 246, -224, 247, 248, 249, 250, 0, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 33, 443, + 444, 445, 446, 37, 38, 39, 40, 0, 0, 0, + 303, -224, 303, 0, -224, 0, 0, 0, 0, 0, + 0, 0, 452, 0, 454, 456, 0, 0, 188, 260, + 261, 0, 0, 0, 0, 0, 0, 0, 262, 263, + 0, 0, 0, 0, 0, 0, 303, 0, 303, 303, + 0, 0, -224, -224, -224, 0, 0, 0, 0, 0, + 0, 488, 0, 0, 243, 0, 0, 0, 303, 303, + 0, 244, 16, 6, 245, 246, 0, 247, 248, 249, + 250, 0, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 33, 0, 0, 334, 0, 37, 38, 39, 40, + 244, 0, 0, 245, 246, 0, 247, 248, 249, 250, + 0, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 33, 188, 360, 261, 0, 37, 38, 39, 40, 0, + 0, 262, 263, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 188, 0, 261, -225, 0, 0, 0, -225, 394, 0, + 262, 263, 0, 0, 244, 16, 6, 245, 246, 0, + 247, 248, 249, 250, 0, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 33, -225, 0, 0, -225, 37, + 38, 39, 40, 244, 16, 6, 245, 246, 0, 247, + 248, 249, 250, 0, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 33, 188, 0, 261, 0, 37, 38, + 39, 40, 0, 0, 262, 263, -225, -225, -225, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 159, 160, 0, 188, 0, 261, 165, 166, 167, 168, + 0, 0, 0, 262, 263, 0, 159, 160, 16, 6, + 163, 164, 165, 166, 167, 168, 172, 173, 174, 175, + 176, 0, 0, 0, 0, 0, 0, 0, 0, 169, + 170, 171, 172, 173, 174, 175, 176, 16, 6, 33, + 34, 35, 36, 0, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 327, 0, + 0, 235, 150, 0, 158, 62, 0, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 0, 0, 0, + 0, 63, 64, 0, 0, 0, 0, 0, 0, 0, + 169, 170, 171, 172, 173, 174, 175, 176, 65, 0, + 0, 66, 0, 16, 6, 29, 67, 68, 69, 70, + 33, 34, 35, 36, 0, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 0, + 0, 0, 61, 0, 0, 0, 62, 0, 351, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 63, 64, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, + 0, 0, 66, 0, 16, 6, 29, 67, 68, 69, + 70, 33, 34, 35, 36, 0, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 329, 0, 0, 61, 0, 0, 158, 62, 0, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 0, + 0, 0, 0, 63, 64, 0, 0, 0, 0, 0, + 0, 0, 169, 170, 171, 172, 173, 174, 175, 176, + 65, 0, 0, 66, 0, 16, 6, 29, 67, 68, + 69, 70, 33, 34, 35, 36, 0, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 0, 0, 0, 235, 0, 0, 0, 62, 0, + 0, 0, 0, 0, 0, 0, 0, 213, 0, 0, + 0, 0, 214, 0, 63, 64, 0, 158, 0, 0, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 0, 65, 0, 0, 66, 0, 16, 6, 29, 67, + 68, 69, 70, 169, 170, 171, 172, 173, 174, 175, + 176, 462, 0, 0, 0, 0, 463, 0, 0, 0, + 0, 158, 0, 0, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 169, 170, 171, + 172, 173, 174, 175, 176, 464, 0, 0, 0, 0, + 465, 0, 0, 0, 0, 158, 0, 0, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 169, 170, 171, 172, 173, 174, 175, 176, 466, + 0, 0, 0, 0, 467, 0, 0, 0, 0, 158, + 0, 0, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 309, 0, 169, 170, 171, 172, 173, + 174, 175, 176, 158, 0, 0, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 310, 0, 169, + 170, 171, 172, 173, 174, 175, 176, 158, 0, 0, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 311, 0, 169, 170, 171, 172, 173, 174, 175, + 176, 158, 0, 0, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 312, 0, 169, 170, 171, + 172, 173, 174, 175, 176, 158, 0, 0, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 313, + 0, 169, 170, 171, 172, 173, 174, 175, 176, 158, + 0, 0, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 314, 0, 169, 170, 171, 172, 173, + 174, 175, 176, 158, 0, 0, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 315, 0, 169, + 170, 171, 172, 173, 174, 175, 176, 158, 0, 0, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 316, 0, 169, 170, 171, 172, 173, 174, 175, + 176, 158, 0, 0, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 317, 0, 169, 170, 171, + 172, 173, 174, 175, 176, 158, 0, 0, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 318, + 0, 169, 170, 171, 172, 173, 174, 175, 176, 158, + 0, 0, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 319, 0, 169, 170, 171, 172, 173, + 174, 175, 176, 158, 0, 0, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 320, 0, 169, + 170, 171, 172, 173, 174, 175, 176, 158, 0, 0, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 321, 0, 169, 170, 171, 172, 173, 174, 175, + 176, 158, 0, 0, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 322, 0, 169, 170, 171, + 172, 173, 174, 175, 176, 158, 0, 0, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 323, + 0, 169, 170, 171, 172, 173, 174, 175, 176, 158, + 0, 0, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 325, 0, 169, 170, 171, 172, 173, + 174, 175, 176, 158, 0, 0, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 429, 0, 169, + 170, 171, 172, 173, 174, 175, 176, 158, 0, 0, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 430, 0, 169, 170, 171, 172, 173, 174, 175, + 176, 158, 0, 0, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 434, 0, 169, 170, 171, + 172, 173, 174, 175, 176, 158, 0, 0, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 436, + 0, 169, 170, 171, 172, 173, 174, 175, 176, 158, + 0, 0, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 440, 0, 169, 170, 171, 172, 173, + 174, 175, 176, 158, 0, 0, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 449, 0, 169, + 170, 171, 172, 173, 174, 175, 176, 158, 0, 0, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 461, 0, 169, 170, 171, 172, 173, 174, 175, + 176, 158, 0, 0, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 471, 0, 169, 170, 171, + 172, 173, 174, 175, 176, 158, 0, 0, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 473, + 0, 169, 170, 171, 172, 173, 174, 175, 176, 158, + 0, 0, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 493, 0, 169, 170, 171, 172, 173, + 174, 175, 176, 158, 0, 0, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 169, + 170, 171, 172, 173, 174, 175, 176, 384, 0, 0, + 0, 0, 0, 158, 0, 0, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 169, + 170, 171, 172, 173, 174, 175, 176, 308, 0, 0, + 0, 0, 158, 0, 0, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 169, 170, + 171, 172, 173, 174, 175, 176, 324, 0, 0, 0, + 0, 158, 0, 0, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 169, 170, 171, + 172, 173, 174, 175, 176, 389, 0, 0, 0, 0, + 158, 0, 0, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 169, 170, 171, 172, + 173, 174, 175, 176, 328, 0, 158, 0, 0, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 169, 170, 171, 172, 173, 174, 175, 176, + 157, 158, 0, 0, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 169, 170, 171, + 172, 173, 174, 175, 176, 396, 158, 0, 0, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 169, 170, 171, 172, 173, 174, 175, 176, + 409, 158, 0, 0, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 158, 0, 0, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 0, 0, 0, 0, 0, + 169, 170, 171, 172, 173, 174, 175, 176, 159, 160, + 0, 162, 163, 164, 165, 166, 167, 168, 159, 160, + 0, 0, 163, 164, 165, 166, 167, 168, 0, 0, + 0, 169, 170, 171, 172, 173, 174, 175, 176, 0, + 0, 0, 170, 171, 172, 173, 174, 175, 176, 159, + 160, 0, 0, 163, 164, 165, 166, 167, 168, 159, + 160, 0, 0, 163, 164, 165, 166, 167, 168, 0, + 0, 0, 0, 170, 0, 172, 173, 174, 175, 176, + 0, 0, 0, 0, 0, 172, 173, 174, 175, 176 + }; + + const short + parser::yycheck_[] = + { + 0, 124, 20, 3, 4, 342, 188, 105, 8, 243, + 342, 3, 4, 247, 342, 28, 66, 66, 463, 188, + 465, 0, 467, 105, 107, 25, 11, 12, 13, 14, + 15, 114, 38, 33, 76, 118, 188, 43, 44, 45, + 46, 33, 92, 70, 76, 38, 66, 112, 113, 188, + 43, 44, 45, 46, 74, 67, 114, 38, 67, 72, + 72, 243, 62, 72, 70, 247, 67, 188, 70, 71, + 67, 72, 78, 79, 243, 72, 113, 70, 247, 67, + 262, 263, 66, 38, 266, 112, 113, 42, 66, 70, + 66, 243, 73, 262, 263, 247, 67, 266, 67, 66, + 66, 72, 336, 72, 243, 105, 112, 113, 247, 66, + 262, 263, 74, 105, 266, 70, 67, 66, 73, 112, + 113, 72, 243, 262, 263, 125, 247, 266, 113, 67, + 111, 112, 113, 38, 72, 472, 66, 42, 67, 66, + 472, 262, 263, 72, 472, 266, 66, 66, 80, 81, + 108, 109, 110, 66, 336, 66, 111, 112, 113, 66, + 342, 66, 66, 117, 118, 70, 66, 336, 73, 74, + 66, 188, 66, 342, 106, 107, 108, 109, 110, 179, + 66, 76, 113, 68, 336, 66, 186, 70, 188, 67, + 342, 66, 74, 193, 74, 66, 188, 336, 66, 76, + 434, 299, 436, 342, 66, 38, 111, 112, 113, 42, + 66, 66, 185, 66, 75, 336, 76, 299, 76, 192, + 66, 342, 76, 66, 76, 70, 243, 76, 76, 76, + 247, 66, 76, 71, 252, 25, 470, 70, 238, 473, + 73, 75, 118, 243, 75, 262, 263, 247, 66, 266, + 66, 243, 434, 66, 436, 247, 66, 71, 492, 493, + 358, 359, 262, 263, 66, 434, 266, 436, 66, 76, + 262, 263, 66, 76, 266, 76, 358, 359, 111, 112, + 113, 23, 434, 76, 436, 28, 72, 76, 470, 76, + 472, 473, 76, 76, 76, 434, 67, 436, 67, 299, + 67, 470, 67, 472, 473, 8, 404, 299, 76, 8, + 492, 493, 76, 434, 188, 436, 76, 440, 470, 336, + 472, 473, 404, 492, 493, 342, 106, 107, 108, 109, + 110, 470, 8, 472, 473, 472, 336, 252, 266, -1, + 492, 493, 342, 343, 336, -1, -1, -1, -1, 470, + 342, 472, 473, 492, 493, -1, -1, -1, 358, 359, + 333, -1, -1, -1, -1, -1, 358, 359, -1, 243, + -1, 492, 493, 247, 38, -1, -1, -1, 42, -1, + -1, 354, 355, -1, -1, -1, -1, -1, 262, 263, + -1, -1, 266, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 26, 404, -1, 70, -1, -1, 73, + 188, -1, 404, 386, -1, -1, -1, 434, -1, 436, + -1, -1, 38, -1, -1, -1, 42, -1, -1, 38, + -1, -1, -1, 42, 434, -1, 436, 60, -1, 439, + 63, 64, 434, -1, 436, -1, -1, 111, 112, 113, + -1, -1, -1, 470, 70, 472, 473, 73, -1, 432, + -1, 70, 336, -1, 73, 243, -1, -1, 342, 247, + 470, -1, 472, 473, 447, 492, 493, -1, 470, -1, + 472, 473, -1, -1, 262, 263, -1, -1, 266, -1, + -1, -1, 492, 493, -1, 111, 112, 113, -1, -1, + 492, 493, 111, 112, 113, -1, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, -1, 140, 141, 142, + 143, 144, 145, 146, 147, -1, 149, -1, -1, -1, + -1, -1, -1, -1, -1, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 188, 178, -1, -1, 336, -1, + 434, -1, 436, -1, 342, -1, -1, -1, 191, 38, + -1, -1, -1, 42, -1, 38, -1, -1, -1, 42, + -1, -1, -1, 16, 17, -1, 19, 20, -1, -1, + -1, 214, -1, -1, -1, -1, 470, -1, 472, 473, + -1, 70, -1, -1, 73, 38, -1, 70, -1, 243, + 73, -1, 235, 247, -1, -1, -1, -1, 492, 493, + -1, 244, -1, -1, -1, -1, -1, -1, 262, 263, + -1, -1, 266, 256, -1, -1, -1, 70, -1, -1, + 73, -1, 111, 112, 113, 78, 79, -1, 111, 112, + 113, -1, -1, -1, -1, -1, 434, -1, 436, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + -1, 38, -1, -1, -1, -1, -1, -1, 111, 112, + 113, -1, -1, -1, -1, 308, -1, -1, -1, -1, + -1, -1, 470, -1, 472, 473, -1, -1, -1, -1, + -1, 324, 336, 70, -1, 328, 73, -1, 342, 332, + -1, 78, 79, -1, 492, 493, 339, -1, 341, -1, + -1, 344, -1, -1, -1, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, -1, -1, -1, -1, + -1, -1, -1, -1, 111, 112, 113, -1, -1, -1, + 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 11, -1, -1, -1, -1, 389, -1, 18, 38, + -1, 21, 22, 42, 24, 25, 26, 27, -1, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 412, + 413, 414, 415, 43, 44, 45, 46, -1, -1, -1, + 434, 70, 436, -1, 73, -1, -1, -1, -1, -1, + -1, -1, 435, -1, 437, 438, -1, -1, 68, 69, + 70, -1, -1, -1, -1, -1, -1, -1, 78, 79, + -1, -1, -1, -1, -1, -1, 470, -1, 472, 473, + -1, -1, 111, 112, 113, -1, -1, -1, -1, -1, + -1, 474, -1, -1, 11, -1, -1, -1, 492, 493, + -1, 18, 112, 113, 21, 22, -1, 24, 25, 26, + 27, -1, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, -1, -1, 12, -1, 43, 44, 45, 46, + 18, -1, -1, 21, 22, -1, 24, 25, 26, 27, + -1, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 68, 69, 70, -1, 43, 44, 45, 46, -1, + -1, 78, 79, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 68, -1, 70, 38, -1, -1, -1, 42, 12, -1, + 78, 79, -1, -1, 18, 112, 113, 21, 22, -1, + 24, 25, 26, 27, -1, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 70, -1, -1, 73, 43, + 44, 45, 46, 18, 112, 113, 21, 22, -1, 24, + 25, 26, 27, -1, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 68, -1, 70, -1, 43, 44, + 45, 46, -1, -1, 78, 79, 111, 112, 113, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 80, 81, -1, 68, -1, 70, 86, 87, 88, 89, + -1, -1, -1, 78, 79, -1, 80, 81, 112, 113, + 84, 85, 86, 87, 88, 89, 106, 107, 108, 109, + 110, -1, -1, -1, -1, -1, -1, -1, -1, 103, + 104, 105, 106, 107, 108, 109, 110, 112, 113, 38, + 39, 40, 41, -1, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 71, -1, + -1, 70, 71, -1, 77, 74, -1, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, -1, -1, -1, + -1, 90, 91, -1, -1, -1, -1, -1, -1, -1, + 103, 104, 105, 106, 107, 108, 109, 110, 107, -1, + -1, 110, -1, 112, 113, 114, 115, 116, 117, 118, + 38, 39, 40, 41, -1, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, -1, + -1, -1, 70, -1, -1, -1, 74, -1, 76, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 90, 91, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 107, + -1, -1, 110, -1, 112, 113, 114, 115, 116, 117, + 118, 38, 39, 40, 41, -1, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 71, -1, -1, 70, -1, -1, 77, 74, -1, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, -1, + -1, -1, -1, 90, 91, -1, -1, -1, -1, -1, + -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, + 107, -1, -1, 110, -1, 112, 113, 114, 115, 116, + 117, 118, 38, 39, 40, 41, -1, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, -1, -1, -1, 70, -1, -1, -1, 74, -1, + -1, -1, -1, -1, -1, -1, -1, 67, -1, -1, + -1, -1, 72, -1, 90, 91, -1, 77, -1, -1, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + -1, 107, -1, -1, 110, -1, 112, 113, 114, 115, + 116, 117, 118, 103, 104, 105, 106, 107, 108, 109, + 110, 67, -1, -1, -1, -1, 72, -1, -1, -1, + -1, 77, -1, -1, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, + 106, 107, 108, 109, 110, 67, -1, -1, -1, -1, + 72, -1, -1, -1, -1, 77, -1, -1, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 103, 104, 105, 106, 107, 108, 109, 110, 67, + -1, -1, -1, -1, 72, -1, -1, -1, -1, 77, + -1, -1, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 67, -1, 103, 104, 105, 106, 107, + 108, 109, 110, 77, -1, -1, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 67, -1, 103, + 104, 105, 106, 107, 108, 109, 110, 77, -1, -1, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 67, -1, 103, 104, 105, 106, 107, 108, 109, + 110, 77, -1, -1, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 67, -1, 103, 104, 105, + 106, 107, 108, 109, 110, 77, -1, -1, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 67, + -1, 103, 104, 105, 106, 107, 108, 109, 110, 77, + -1, -1, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 67, -1, 103, 104, 105, 106, 107, + 108, 109, 110, 77, -1, -1, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 67, -1, 103, + 104, 105, 106, 107, 108, 109, 110, 77, -1, -1, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 67, -1, 103, 104, 105, 106, 107, 108, 109, + 110, 77, -1, -1, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 67, -1, 103, 104, 105, + 106, 107, 108, 109, 110, 77, -1, -1, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 67, + -1, 103, 104, 105, 106, 107, 108, 109, 110, 77, + -1, -1, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 67, -1, 103, 104, 105, 106, 107, + 108, 109, 110, 77, -1, -1, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 67, -1, 103, + 104, 105, 106, 107, 108, 109, 110, 77, -1, -1, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 67, -1, 103, 104, 105, 106, 107, 108, 109, + 110, 77, -1, -1, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 67, -1, 103, 104, 105, + 106, 107, 108, 109, 110, 77, -1, -1, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 67, + -1, 103, 104, 105, 106, 107, 108, 109, 110, 77, + -1, -1, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 67, -1, 103, 104, 105, 106, 107, + 108, 109, 110, 77, -1, -1, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 67, -1, 103, + 104, 105, 106, 107, 108, 109, 110, 77, -1, -1, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 67, -1, 103, 104, 105, 106, 107, 108, 109, + 110, 77, -1, -1, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 67, -1, 103, 104, 105, + 106, 107, 108, 109, 110, 77, -1, -1, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 67, + -1, 103, 104, 105, 106, 107, 108, 109, 110, 77, + -1, -1, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 67, -1, 103, 104, 105, 106, 107, + 108, 109, 110, 77, -1, -1, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 67, -1, 103, + 104, 105, 106, 107, 108, 109, 110, 77, -1, -1, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 67, -1, 103, 104, 105, 106, 107, 108, 109, + 110, 77, -1, -1, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 67, -1, 103, 104, 105, + 106, 107, 108, 109, 110, 77, -1, -1, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 67, + -1, 103, 104, 105, 106, 107, 108, 109, 110, 77, + -1, -1, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 67, -1, 103, 104, 105, 106, 107, + 108, 109, 110, 77, -1, -1, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, + 104, 105, 106, 107, 108, 109, 110, 71, -1, -1, + -1, -1, -1, 77, -1, -1, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, + 104, 105, 106, 107, 108, 109, 110, 72, -1, -1, + -1, -1, 77, -1, -1, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 103, 104, + 105, 106, 107, 108, 109, 110, 72, -1, -1, -1, + -1, 77, -1, -1, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, + 106, 107, 108, 109, 110, 72, -1, -1, -1, -1, + 77, -1, -1, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, + 107, 108, 109, 110, 75, -1, 77, -1, -1, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, + 76, 77, -1, -1, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, + 106, 107, 108, 109, 110, 76, 77, -1, -1, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, + 76, 77, -1, -1, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 77, -1, -1, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 103, 104, 105, + 106, 107, 108, 109, 110, -1, -1, -1, -1, -1, + 103, 104, 105, 106, 107, 108, 109, 110, 80, 81, + -1, 83, 84, 85, 86, 87, 88, 89, 80, 81, + -1, -1, 84, 85, 86, 87, 88, 89, -1, -1, + -1, 103, 104, 105, 106, 107, 108, 109, 110, -1, + -1, -1, 104, 105, 106, 107, 108, 109, 110, 80, + 81, -1, -1, 84, 85, 86, 87, 88, 89, 80, + 81, -1, -1, 84, 85, 86, 87, 88, 89, -1, + -1, -1, -1, 104, -1, 106, 107, 108, 109, 110, + -1, -1, -1, -1, -1, 106, 107, 108, 109, 110 + }; + + const unsigned char + parser::yystos_[] = + { + 0, 11, 12, 13, 14, 15, 113, 128, 129, 130, + 131, 132, 133, 134, 135, 215, 112, 215, 216, 216, + 66, 0, 130, 131, 132, 66, 92, 76, 76, 114, + 218, 180, 215, 38, 39, 40, 41, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 70, 74, 90, 91, 107, 110, 115, 116, 117, + 118, 166, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 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, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 67, 67, 72, 70, 215, 216, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 166, 70, + 71, 215, 166, 166, 117, 118, 113, 76, 77, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 103, + 104, 105, 106, 107, 108, 109, 110, 42, 70, 73, + 111, 178, 179, 215, 216, 66, 74, 76, 68, 141, + 215, 70, 66, 74, 166, 166, 166, 166, 166, 166, + 166, 166, 166, 166, 67, 166, 166, 166, 166, 166, + 166, 166, 166, 67, 72, 166, 166, 166, 166, 166, + 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, + 166, 166, 166, 166, 166, 70, 166, 215, 74, 166, + 181, 182, 215, 11, 18, 21, 22, 24, 25, 26, + 27, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 69, 70, 78, 79, 136, 137, 139, 140, 141, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 168, 169, 170, 176, 177, 203, 204, 207, + 210, 211, 212, 213, 215, 166, 181, 215, 72, 67, + 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, + 67, 67, 67, 67, 72, 67, 166, 71, 75, 71, + 215, 67, 72, 66, 12, 136, 138, 166, 76, 66, + 136, 66, 66, 66, 66, 107, 218, 222, 75, 76, + 76, 76, 166, 76, 66, 66, 176, 177, 207, 207, + 69, 137, 76, 76, 76, 76, 76, 16, 17, 19, + 20, 78, 79, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 71, 67, 66, 166, 166, 72, + 71, 166, 166, 181, 12, 136, 76, 166, 25, 166, + 142, 168, 169, 170, 207, 215, 166, 75, 75, 76, + 181, 181, 66, 66, 66, 66, 166, 166, 166, 166, + 166, 166, 166, 166, 166, 166, 166, 71, 181, 67, + 67, 166, 66, 67, 67, 66, 67, 76, 28, 72, + 67, 67, 67, 166, 166, 166, 166, 66, 67, 67, + 181, 136, 166, 136, 166, 167, 166, 215, 141, 76, + 76, 67, 67, 72, 67, 72, 67, 72, 181, 67, + 23, 67, 76, 67, 28, 76, 76, 181, 182, 76, + 182, 76, 182, 67, 136, 76, 142, 136, 166, 67, + 67, 67, 67, 67, 76, 76, 76, 136, 136 + }; + + const unsigned char + parser::yyr1_[] = + { + 0, 127, 128, 128, 129, 129, 129, 129, 129, 129, + 130, 131, 132, 132, 132, 132, 132, 133, 134, 135, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 137, 137, 138, 138, 139, 139, + 140, 140, 141, 141, 142, 142, 142, 142, 143, 143, + 144, 144, 144, 145, 146, 146, 147, 148, 148, 149, + 149, 150, 151, 152, 153, 154, 155, 156, 156, 157, + 158, 158, 159, 160, 161, 162, 162, 163, 164, 165, + 166, 166, 166, 167, 167, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 169, 169, 170, 170, + 171, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 174, 175, 176, 176, 177, 177, 178, + 178, 178, 178, 179, 179, 180, 180, 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, 204, 204, 205, 206, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 216, 217, 218, 219, + 220, 221, 221, 222, 222, 223, 224 + }; + + const signed char + parser::yyr2_[] = + { + 0, 2, 1, 0, 2, 2, 2, 1, 1, 1, + 3, 3, 1, 1, 1, 1, 1, 5, 4, 5, + 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, + 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, 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, 2, 2, 1, 1, 2, 2, 4, + 6, 5, 7, 8, 9, 3, 1, 0, 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, 3, 2, 2, 3, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, + 1, 1, 1, 2, 1, 1, 1, 1, 1, 7, + 1, 2, 1, 2, 1, 1, 1 + }; + + + + +#if T6DEBUG + const short + parser::yyrline_[] = + { + 0, 284, 284, 285, 289, 291, 293, 295, 297, 299, + 304, 308, 313, 314, 315, 316, 317, 321, 326, 331, + 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, + 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 363, 364, 368, 370, 375, 377, + 382, 383, 387, 388, 392, 394, 396, 399, 403, 405, + 410, 412, 414, 419, 424, 426, 431, 436, 438, 443, + 445, 450, 455, 460, 465, 470, 475, 480, 482, 487, + 492, 494, 499, 504, 509, 514, 516, 521, 526, 531, + 536, 537, 538, 542, 543, 547, 549, 551, 553, 555, + 557, 559, 561, 563, 565, 567, 572, 574, 579, 581, + 586, 591, 593, 595, 597, 599, 601, 603, 605, 607, + 609, 611, 613, 615, 617, 619, 621, 623, 625, 630, + 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 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, 677, 682, 687, 688, 691, 692, 696, + 698, 700, 702, 707, 709, 714, 716, 719, 723, 726, + 730, 732, 737, 742, 747, 752, 757, 762, 767, 772, + 777, 782, 787, 792, 797, 802, 807, 812, 817, 822, + 827, 832, 834, 839, 844, 846, 851, 856, 861, 862, + 863, 864, 865, 866, 867, 868, 869, 873, 878, 883, + 888, 893, 898, 903, 908, 913, 915, 920, 925, 930, + 935, 940, 942, 947, 949, 954, 959 + }; + + 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 5171 "parser.cpp" + +#line 963 "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/xsk/parser.hpp b/src/t6/xsk/parser.hpp new file mode 100644 index 00000000..a754200a --- /dev/null +++ b/src/t6/xsk/parser.hpp @@ -0,0 +1,6277 @@ +// A Bison parser, made by GNU Bison 3.7.5. + +// Skeleton interface 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. + + +/** + ** \file parser.hpp + ** Define the xsk::arc::t6::parser class. + */ + +// C++ LALR(1) parser skeleton written by Akim Demaille. + +// 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. + +#ifndef YY_T6_PARSER_HPP_INCLUDED +# define YY_T6_PARSER_HPP_INCLUDED +// "%code requires" blocks. +#line 28 "parser.ypp" + +#include "t6.hpp" +namespace xsk::arc::t6 { class lexer; } + +#line 54 "parser.hpp" + +# include +# include // std::abort +# include +# include +# include +# include + +#if defined __cplusplus +# define YY_CPLUSPLUS __cplusplus +#else +# define YY_CPLUSPLUS 199711L +#endif + +// Support move semantics when possible. +#if 201103L <= YY_CPLUSPLUS +# define YY_MOVE std::move +# define YY_MOVE_OR_COPY move +# define YY_MOVE_REF(Type) Type&& +# define YY_RVREF(Type) Type&& +# define YY_COPY(Type) Type +#else +# define YY_MOVE +# define YY_MOVE_OR_COPY copy +# define YY_MOVE_REF(Type) Type& +# define YY_RVREF(Type) const Type& +# define YY_COPY(Type) const Type& +#endif + +// Support noexcept when possible. +#if 201103L <= YY_CPLUSPLUS +# define YY_NOEXCEPT noexcept +# define YY_NOTHROW +#else +# define YY_NOEXCEPT +# define YY_NOTHROW throw () +#endif + +// Support constexpr when possible. +#if 201703 <= YY_CPLUSPLUS +# define YY_CONSTEXPR constexpr +#else +# define YY_CONSTEXPR +#endif + +#include +#ifndef T6_ASSERT +# include +# define T6_ASSERT assert +#endif + + +#ifndef YY_ATTRIBUTE_PURE +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YY_USE(E) ((void) (E)) +#else +# define YY_USE(E) /* empty */ +#endif + +#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) +# endif +# endif + +/* Debug traces. */ +#ifndef T6DEBUG +# if defined YYDEBUG +#if YYDEBUG +# define T6DEBUG 1 +# else +# define T6DEBUG 0 +# endif +# else /* ! defined YYDEBUG */ +# define T6DEBUG 1 +# endif /* ! defined YYDEBUG */ +#endif /* ! defined T6DEBUG */ + +#line 13 "parser.ypp" +namespace xsk { namespace arc { namespace t6 { +#line 197 "parser.hpp" + + + + + /// A Bison parser. + class parser + { + public: +#ifndef T6STYPE + /// A buffer to store and retrieve objects. + /// + /// Sort of a variant, but does not keep track of the nature + /// of the stored data, since that knowledge is available + /// via the current parser state. + class semantic_type + { + public: + /// Type of *this. + typedef semantic_type self_type; + + /// Empty construction. + semantic_type () YY_NOEXCEPT + : yybuffer_ () + , yytypeid_ (YY_NULLPTR) + {} + + /// Construct and fill. + template + semantic_type (YY_RVREF (T) t) + : yytypeid_ (&typeid (T)) + { + T6_ASSERT (sizeof (T) <= size); + new (yyas_ ()) T (YY_MOVE (t)); + } + +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + semantic_type (const self_type&) = delete; + /// Non copyable. + self_type& operator= (const self_type&) = delete; +#endif + + /// Destruction, allowed only if empty. + ~semantic_type () YY_NOEXCEPT + { + T6_ASSERT (!yytypeid_); + } + +# if 201103L <= YY_CPLUSPLUS + /// Instantiate a \a T in here from \a t. + template + T& + emplace (U&&... u) + { + T6_ASSERT (!yytypeid_); + T6_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (std::forward (u)...); + } +# else + /// Instantiate an empty \a T in here. + template + T& + emplace () + { + T6_ASSERT (!yytypeid_); + T6_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (); + } + + /// Instantiate a \a T in here from \a t. + template + T& + emplace (const T& t) + { + T6_ASSERT (!yytypeid_); + T6_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (t); + } +# endif + + /// Instantiate an empty \a T in here. + /// Obsolete, use emplace. + template + T& + build () + { + return emplace (); + } + + /// Instantiate a \a T in here from \a t. + /// Obsolete, use emplace. + template + T& + build (const T& t) + { + return emplace (t); + } + + /// Accessor to a built \a T. + template + T& + as () YY_NOEXCEPT + { + T6_ASSERT (yytypeid_); + T6_ASSERT (*yytypeid_ == typeid (T)); + T6_ASSERT (sizeof (T) <= size); + return *yyas_ (); + } + + /// Const accessor to a built \a T (for %printer). + template + const T& + as () const YY_NOEXCEPT + { + T6_ASSERT (yytypeid_); + T6_ASSERT (*yytypeid_ == typeid (T)); + T6_ASSERT (sizeof (T) <= size); + return *yyas_ (); + } + + /// Swap the content with \a that, of same type. + /// + /// Both variants must be built beforehand, because swapping the actual + /// data requires reading it (with as()), and this is not possible on + /// unconstructed variants: it would require some dynamic testing, which + /// should not be the variant's responsibility. + /// Swapping between built and (possibly) non-built is done with + /// self_type::move (). + template + void + swap (self_type& that) YY_NOEXCEPT + { + T6_ASSERT (yytypeid_); + T6_ASSERT (*yytypeid_ == *that.yytypeid_); + std::swap (as (), that.as ()); + } + + /// Move the content of \a that to this. + /// + /// Destroys \a that. + template + void + move (self_type& that) + { +# if 201103L <= YY_CPLUSPLUS + emplace (std::move (that.as ())); +# else + emplace (); + swap (that); +# endif + that.destroy (); + } + +# if 201103L <= YY_CPLUSPLUS + /// Move the content of \a that to this. + template + void + move (self_type&& that) + { + emplace (std::move (that.as ())); + that.destroy (); + } +#endif + + /// Copy the content of \a that to this. + template + void + copy (const self_type& that) + { + emplace (that.as ()); + } + + /// Destroy the stored \a T. + template + void + destroy () + { + as ().~T (); + yytypeid_ = YY_NULLPTR; + } + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + semantic_type (const self_type&); + /// Non copyable. + self_type& operator= (const self_type&); +#endif + + /// Accessor to raw memory as \a T. + template + T* + yyas_ () YY_NOEXCEPT + { + void *yyp = yybuffer_.yyraw; + return static_cast (yyp); + } + + /// Const accessor to raw memory as \a T. + template + const T* + yyas_ () const YY_NOEXCEPT + { + const void *yyp = yybuffer_.yyraw; + return static_cast (yyp); + } + + /// An auxiliary type to compute the largest semantic type. + union union_type + { + // expr_function + // expr_pointer + char dummy1[sizeof (ast::call)]; + + // declaration + char dummy2[sizeof (ast::decl)]; + + // decl_constant + char dummy3[sizeof (ast::decl_constant::ptr)]; + + // decl_thread + char dummy4[sizeof (ast::decl_thread::ptr)]; + + // decl_usingtree + char dummy5[sizeof (ast::decl_usingtree::ptr)]; + + // expr + // expr_or_empty + // expr_assign + // expr_increment + // expr_decrement + // expr_ternary + // expr_binary + // expr_primitive + // expr_object + char dummy6[sizeof (ast::expr)]; + + // expr_abs + char dummy7[sizeof (ast::expr_abs::ptr)]; + + // expr_angleclamp180 + char dummy8[sizeof (ast::expr_angleclamp180::ptr)]; + + // expr_anglestoforward + char dummy9[sizeof (ast::expr_anglestoforward::ptr)]; + + // expr_anglestoright + char dummy10[sizeof (ast::expr_anglestoright::ptr)]; + + // expr_anglestoup + char dummy11[sizeof (ast::expr_anglestoup::ptr)]; + + // expr_anim + char dummy12[sizeof (ast::expr_anim::ptr)]; + + // expr_animation + char dummy13[sizeof (ast::expr_animation::ptr)]; + + // expr_arguments + // expr_arguments_no_empty + char dummy14[sizeof (ast::expr_arguments::ptr)]; + + // expr_array + char dummy15[sizeof (ast::expr_array::ptr)]; + + // expr_call + char dummy16[sizeof (ast::expr_call::ptr)]; + + // expr_complement + char dummy17[sizeof (ast::expr_complement::ptr)]; + + // expr_empty_array + char dummy18[sizeof (ast::expr_empty_array::ptr)]; + + // expr_false + char dummy19[sizeof (ast::expr_false::ptr)]; + + // expr_field + char dummy20[sizeof (ast::expr_field::ptr)]; + + // expr_float + char dummy21[sizeof (ast::expr_float::ptr)]; + + // expr_game + char dummy22[sizeof (ast::expr_game::ptr)]; + + // expr_getdvar + char dummy23[sizeof (ast::expr_getdvar::ptr)]; + + // expr_getdvarcoloralpha + char dummy24[sizeof (ast::expr_getdvarcoloralpha::ptr)]; + + // expr_getdvarcolorblue + char dummy25[sizeof (ast::expr_getdvarcolorblue::ptr)]; + + // expr_getdvarcolorgreen + char dummy26[sizeof (ast::expr_getdvarcolorgreen::ptr)]; + + // expr_getdvarcolorred + char dummy27[sizeof (ast::expr_getdvarcolorred::ptr)]; + + // expr_getdvarfloat + char dummy28[sizeof (ast::expr_getdvarfloat::ptr)]; + + // expr_getdvarint + char dummy29[sizeof (ast::expr_getdvarint::ptr)]; + + // expr_getdvarvector + char dummy30[sizeof (ast::expr_getdvarvector::ptr)]; + + // expr_getfirstarraykey + char dummy31[sizeof (ast::expr_getfirstarraykey::ptr)]; + + // expr_getnextarraykey + char dummy32[sizeof (ast::expr_getnextarraykey::ptr)]; + + // expr_gettime + char dummy33[sizeof (ast::expr_gettime::ptr)]; + + // expr_hash + char dummy34[sizeof (ast::expr_hash::ptr)]; + + // expr_identifier + char dummy35[sizeof (ast::expr_identifier::ptr)]; + + // expr_integer + char dummy36[sizeof (ast::expr_integer::ptr)]; + + // expr_isdefined + char dummy37[sizeof (ast::expr_isdefined::ptr)]; + + // expr_istring + char dummy38[sizeof (ast::expr_istring::ptr)]; + + // expr_level + char dummy39[sizeof (ast::expr_level::ptr)]; + + // expr_method + char dummy40[sizeof (ast::expr_method::ptr)]; + + // expr_not + char dummy41[sizeof (ast::expr_not::ptr)]; + + // expr_parameters + char dummy42[sizeof (ast::expr_parameters::ptr)]; + + // expr_paren + char dummy43[sizeof (ast::expr_paren::ptr)]; + + // expr_path + char dummy44[sizeof (ast::expr_path::ptr)]; + + // expr_reference + char dummy45[sizeof (ast::expr_reference::ptr)]; + + // expr_self + char dummy46[sizeof (ast::expr_self::ptr)]; + + // expr_size + char dummy47[sizeof (ast::expr_size::ptr)]; + + // expr_string + char dummy48[sizeof (ast::expr_string::ptr)]; + + // expr_true + char dummy49[sizeof (ast::expr_true::ptr)]; + + // expr_undefined + char dummy50[sizeof (ast::expr_undefined::ptr)]; + + // expr_vector + char dummy51[sizeof (ast::expr_vector::ptr)]; + + // expr_vectorscale + char dummy52[sizeof (ast::expr_vectorscale::ptr)]; + + // expr_vectortoangles + char dummy53[sizeof (ast::expr_vectortoangles::ptr)]; + + // include + char dummy54[sizeof (ast::include::ptr)]; + + // program + char dummy55[sizeof (ast::program::ptr)]; + + // stmt + // stmt_or_dev + char dummy56[sizeof (ast::stmt)]; + + // stmt_assign + char dummy57[sizeof (ast::stmt_assign::ptr)]; + + // stmt_break + char dummy58[sizeof (ast::stmt_break::ptr)]; + + // stmt_breakpoint + char dummy59[sizeof (ast::stmt_breakpoint::ptr)]; + + // stmt_call + char dummy60[sizeof (ast::stmt_call::ptr)]; + + // stmt_case + char dummy61[sizeof (ast::stmt_case::ptr)]; + + // stmt_continue + char dummy62[sizeof (ast::stmt_continue::ptr)]; + + // stmt_default + char dummy63[sizeof (ast::stmt_default::ptr)]; + + // stmt_dev + char dummy64[sizeof (ast::stmt_dev::ptr)]; + + // stmt_dowhile + char dummy65[sizeof (ast::stmt_dowhile::ptr)]; + + // stmt_endon + char dummy66[sizeof (ast::stmt_endon::ptr)]; + + // stmt_expr + char dummy67[sizeof (ast::stmt_expr::ptr)]; + + // stmt_for + char dummy68[sizeof (ast::stmt_for::ptr)]; + + // stmt_foreach + char dummy69[sizeof (ast::stmt_foreach::ptr)]; + + // stmt_if + char dummy70[sizeof (ast::stmt_if::ptr)]; + + // stmt_ifelse + char dummy71[sizeof (ast::stmt_ifelse::ptr)]; + + // stmt_list + // stmt_or_dev_list + // stmt_block + char dummy72[sizeof (ast::stmt_list::ptr)]; + + // stmt_notify + char dummy73[sizeof (ast::stmt_notify::ptr)]; + + // stmt_prof_begin + char dummy74[sizeof (ast::stmt_prof_begin::ptr)]; + + // stmt_prof_end + char dummy75[sizeof (ast::stmt_prof_end::ptr)]; + + // stmt_return + char dummy76[sizeof (ast::stmt_return::ptr)]; + + // stmt_switch + char dummy77[sizeof (ast::stmt_switch::ptr)]; + + // stmt_wait + char dummy78[sizeof (ast::stmt_wait::ptr)]; + + // stmt_waittill + char dummy79[sizeof (ast::stmt_waittill::ptr)]; + + // stmt_waittillframeend + char dummy80[sizeof (ast::stmt_waittillframeend::ptr)]; + + // stmt_waittillmatch + char dummy81[sizeof (ast::stmt_waittillmatch::ptr)]; + + // stmt_while + char dummy82[sizeof (ast::stmt_while::ptr)]; + + // "field" + // "path" + // "identifier" + // "string literal" + // "localized string" + // "hash" + // "float" + // "integer" + char dummy83[sizeof (std::string)]; + }; + + /// The size of the largest semantic type. + enum { size = sizeof (union_type) }; + + /// A buffer to store semantic values. + union + { + /// Strongest alignment constraints. + long double yyalign_me; + /// A buffer large enough to store any of the semantic values. + char yyraw[size]; + } yybuffer_; + + /// Whether the content is built: if defined, the name of the stored type. + const std::type_info *yytypeid_; + }; + +#else + typedef T6STYPE semantic_type; +#endif + /// Symbol locations. + typedef xsk::arc::location location_type; + + /// Syntax errors thrown from user actions. + struct syntax_error : std::runtime_error + { + syntax_error (const location_type& l, const std::string& m) + : std::runtime_error (m) + , location (l) + {} + + syntax_error (const syntax_error& s) + : std::runtime_error (s.what ()) + , location (s.location) + {} + + ~syntax_error () YY_NOEXCEPT YY_NOTHROW; + + location_type location; + }; + + /// Token kinds. + struct token + { + 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" + ENDON = 16, // "endon" + NOTIFY = 17, // "notify" + WAIT = 18, // "wait" + WAITTILL = 19, // "waittill" + WAITTILLMATCH = 20, // "waittillmatch" + WAITTILLFRAMEEND = 21, // "waittillframeend" + IF = 22, // "if" + ELSE = 23, // "else" + DO = 24, // "do" + WHILE = 25, // "while" + FOR = 26, // "for" + FOREACH = 27, // "foreach" + IN = 28, // "in" + SWITCH = 29, // "switch" + CASE = 30, // "case" + DEFAULT = 31, // "default" + BREAK = 32, // "break" + CONTINUE = 33, // "continue" + RETURN = 34, // "return" + BREAKPOINT = 35, // "breakpoint" + PROFBEGIN = 36, // "prof_begin" + PROFEND = 37, // "prof_end" + THREAD = 38, // "thread" + TRUE = 39, // "true" + FALSE = 40, // "false" + UNDEFINED = 41, // "undefined" + SIZE = 42, // ".size" + GAME = 43, // "game" + SELF = 44, // "self" + ANIM = 45, // "anim" + LEVEL = 46, // "level" + GETNEXTARRAYKEY = 47, // "getnextarraykey" + GETFIRSTARRAYKEY = 48, // "getfirstarraykey" + GETDVARCOLORALPHA = 49, // "getdvarcoloralpha" + GETDVARCOLORBLUE = 50, // "getdvarcolorblue" + GETDVARCOLORGREEN = 51, // "getdvarcolorgreen" + GETDVARCOLORRED = 52, // "getdvarcolorred" + GETDVARVECTOR = 53, // "getdvarvector" + GETDVARFLOAT = 54, // "getdvarfloat" + GETDVARINT = 55, // "getdvarint" + GETDVAR = 56, // "getdvar" + GETTIME = 57, // "gettime" + ABS = 58, // "abs" + VECTORTOANGLES = 59, // "vectortoangles" + ANGLECLAMP180 = 60, // "angleclamp180" + ANGLESTOFORWARD = 61, // "anglestoforward" + ANGLESTORIGHT = 62, // "anglestoright" + ANGLESTOUP = 63, // "anglestoup" + VECTORSCALE = 64, // "vectorscale" + ISDEFINED = 65, // "isdefined" + LPAREN = 66, // "(" + RPAREN = 67, // ")" + LBRACE = 68, // "{" + RBRACE = 69, // "}" + LBRACKET = 70, // "[" + RBRACKET = 71, // "]" + COMMA = 72, // "," + DOT = 73, // "." + DOUBLECOLON = 74, // "::" + COLON = 75, // ":" + SEMICOLON = 76, // ";" + QMARK = 77, // "?" + INCREMENT = 78, // "++" + DECREMENT = 79, // "--" + LSHIFT = 80, // "<<" + RSHIFT = 81, // ">>" + OR = 82, // "||" + AND = 83, // "&&" + EQUALITY = 84, // "==" + INEQUALITY = 85, // "!=" + LESS_EQUAL = 86, // "<=" + GREATER_EQUAL = 87, // ">=" + LESS = 88, // "<" + GREATER = 89, // ">" + NOT = 90, // "!" + COMPLEMENT = 91, // "~" + ASSIGN = 92, // "=" + ASSIGN_ADD = 93, // "+=" + ASSIGN_SUB = 94, // "-=" + ASSIGN_MUL = 95, // "*=" + ASSIGN_DIV = 96, // "/=" + ASSIGN_MOD = 97, // "%=" + ASSIGN_BW_OR = 98, // "|=" + ASSIGN_BW_AND = 99, // "&=" + ASSIGN_BW_EXOR = 100, // "^=" + ASSIGN_RSHIFT = 101, // ">>=" + ASSIGN_LSHIFT = 102, // "<<=" + BITWISE_OR = 103, // "|" + BITWISE_AND = 104, // "&" + BITWISE_EXOR = 105, // "^" + ADD = 106, // "+" + SUB = 107, // "-" + MUL = 108, // "*" + DIV = 109, // "/" + MOD = 110, // "%" + FIELD = 111, // "field" + PATH = 112, // "path" + IDENTIFIER = 113, // "identifier" + STRING = 114, // "string literal" + ISTRING = 115, // "localized string" + HASH = 116, // "hash" + FLOAT = 117, // "float" + INTEGER = 118, // "integer" + THEN = 119, // THEN + TERN = 120, // TERN + NEG = 121, // NEG + ANIMREF = 122, // ANIMREF + PREINC = 123, // PREINC + PREDEC = 124, // PREDEC + POSTINC = 125, // POSTINC + POSTDEC = 126 // POSTDEC + }; + /// Backward compatibility alias (Bison 3.6). + typedef token_kind_type yytokentype; + }; + + /// Token kind, as returned by yylex. + typedef token::yytokentype token_kind_type; + + /// Backward compatibility alias (Bison 3.6). + typedef token_kind_type token_type; + + /// Symbol kinds. + struct symbol_kind + { + enum symbol_kind_type + { + YYNTOKENS = 127, ///< 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_ENDON = 16, // "endon" + S_NOTIFY = 17, // "notify" + S_WAIT = 18, // "wait" + S_WAITTILL = 19, // "waittill" + S_WAITTILLMATCH = 20, // "waittillmatch" + S_WAITTILLFRAMEEND = 21, // "waittillframeend" + S_IF = 22, // "if" + S_ELSE = 23, // "else" + S_DO = 24, // "do" + S_WHILE = 25, // "while" + S_FOR = 26, // "for" + S_FOREACH = 27, // "foreach" + S_IN = 28, // "in" + S_SWITCH = 29, // "switch" + S_CASE = 30, // "case" + S_DEFAULT = 31, // "default" + S_BREAK = 32, // "break" + S_CONTINUE = 33, // "continue" + S_RETURN = 34, // "return" + S_BREAKPOINT = 35, // "breakpoint" + S_PROFBEGIN = 36, // "prof_begin" + S_PROFEND = 37, // "prof_end" + S_THREAD = 38, // "thread" + S_TRUE = 39, // "true" + S_FALSE = 40, // "false" + S_UNDEFINED = 41, // "undefined" + S_SIZE = 42, // ".size" + S_GAME = 43, // "game" + S_SELF = 44, // "self" + S_ANIM = 45, // "anim" + S_LEVEL = 46, // "level" + S_GETNEXTARRAYKEY = 47, // "getnextarraykey" + S_GETFIRSTARRAYKEY = 48, // "getfirstarraykey" + S_GETDVARCOLORALPHA = 49, // "getdvarcoloralpha" + S_GETDVARCOLORBLUE = 50, // "getdvarcolorblue" + S_GETDVARCOLORGREEN = 51, // "getdvarcolorgreen" + S_GETDVARCOLORRED = 52, // "getdvarcolorred" + S_GETDVARVECTOR = 53, // "getdvarvector" + S_GETDVARFLOAT = 54, // "getdvarfloat" + S_GETDVARINT = 55, // "getdvarint" + S_GETDVAR = 56, // "getdvar" + S_GETTIME = 57, // "gettime" + S_ABS = 58, // "abs" + S_VECTORTOANGLES = 59, // "vectortoangles" + S_ANGLECLAMP180 = 60, // "angleclamp180" + S_ANGLESTOFORWARD = 61, // "anglestoforward" + S_ANGLESTORIGHT = 62, // "anglestoright" + S_ANGLESTOUP = 63, // "anglestoup" + S_VECTORSCALE = 64, // "vectorscale" + S_ISDEFINED = 65, // "isdefined" + S_LPAREN = 66, // "(" + S_RPAREN = 67, // ")" + S_LBRACE = 68, // "{" + S_RBRACE = 69, // "}" + S_LBRACKET = 70, // "[" + S_RBRACKET = 71, // "]" + S_COMMA = 72, // "," + S_DOT = 73, // "." + S_DOUBLECOLON = 74, // "::" + S_COLON = 75, // ":" + S_SEMICOLON = 76, // ";" + S_QMARK = 77, // "?" + S_INCREMENT = 78, // "++" + S_DECREMENT = 79, // "--" + S_LSHIFT = 80, // "<<" + S_RSHIFT = 81, // ">>" + S_OR = 82, // "||" + S_AND = 83, // "&&" + S_EQUALITY = 84, // "==" + S_INEQUALITY = 85, // "!=" + S_LESS_EQUAL = 86, // "<=" + S_GREATER_EQUAL = 87, // ">=" + S_LESS = 88, // "<" + S_GREATER = 89, // ">" + S_NOT = 90, // "!" + S_COMPLEMENT = 91, // "~" + S_ASSIGN = 92, // "=" + S_ASSIGN_ADD = 93, // "+=" + S_ASSIGN_SUB = 94, // "-=" + S_ASSIGN_MUL = 95, // "*=" + S_ASSIGN_DIV = 96, // "/=" + S_ASSIGN_MOD = 97, // "%=" + S_ASSIGN_BW_OR = 98, // "|=" + S_ASSIGN_BW_AND = 99, // "&=" + S_ASSIGN_BW_EXOR = 100, // "^=" + S_ASSIGN_RSHIFT = 101, // ">>=" + S_ASSIGN_LSHIFT = 102, // "<<=" + S_BITWISE_OR = 103, // "|" + S_BITWISE_AND = 104, // "&" + S_BITWISE_EXOR = 105, // "^" + S_ADD = 106, // "+" + S_SUB = 107, // "-" + S_MUL = 108, // "*" + S_DIV = 109, // "/" + S_MOD = 110, // "%" + S_FIELD = 111, // "field" + S_PATH = 112, // "path" + S_IDENTIFIER = 113, // "identifier" + S_STRING = 114, // "string literal" + S_ISTRING = 115, // "localized string" + S_HASH = 116, // "hash" + S_FLOAT = 117, // "float" + S_INTEGER = 118, // "integer" + S_THEN = 119, // THEN + S_TERN = 120, // TERN + S_NEG = 121, // NEG + S_ANIMREF = 122, // ANIMREF + S_PREINC = 123, // PREINC + S_PREDEC = 124, // PREDEC + S_POSTINC = 125, // POSTINC + S_POSTDEC = 126, // POSTDEC + S_YYACCEPT = 127, // $accept + S_root = 128, // root + S_program = 129, // program + S_inline = 130, // inline + S_include = 131, // include + S_declaration = 132, // declaration + S_decl_usingtree = 133, // decl_usingtree + S_decl_constant = 134, // decl_constant + S_decl_thread = 135, // decl_thread + S_stmt = 136, // stmt + S_stmt_or_dev = 137, // stmt_or_dev + S_stmt_list = 138, // stmt_list + S_stmt_or_dev_list = 139, // stmt_or_dev_list + S_stmt_dev = 140, // stmt_dev + S_stmt_block = 141, // stmt_block + S_stmt_expr = 142, // stmt_expr + S_stmt_call = 143, // stmt_call + S_stmt_assign = 144, // stmt_assign + S_stmt_endon = 145, // stmt_endon + S_stmt_notify = 146, // stmt_notify + S_stmt_wait = 147, // stmt_wait + S_stmt_waittill = 148, // stmt_waittill + S_stmt_waittillmatch = 149, // stmt_waittillmatch + S_stmt_waittillframeend = 150, // stmt_waittillframeend + S_stmt_if = 151, // stmt_if + S_stmt_ifelse = 152, // stmt_ifelse + S_stmt_while = 153, // stmt_while + S_stmt_dowhile = 154, // stmt_dowhile + S_stmt_for = 155, // stmt_for + S_stmt_foreach = 156, // stmt_foreach + S_stmt_switch = 157, // stmt_switch + S_stmt_case = 158, // stmt_case + S_stmt_default = 159, // stmt_default + S_stmt_break = 160, // stmt_break + S_stmt_continue = 161, // stmt_continue + S_stmt_return = 162, // stmt_return + S_stmt_breakpoint = 163, // stmt_breakpoint + S_stmt_prof_begin = 164, // stmt_prof_begin + S_stmt_prof_end = 165, // stmt_prof_end + S_expr = 166, // expr + S_expr_or_empty = 167, // expr_or_empty + S_expr_assign = 168, // expr_assign + S_expr_increment = 169, // expr_increment + S_expr_decrement = 170, // expr_decrement + S_expr_ternary = 171, // expr_ternary + S_expr_binary = 172, // expr_binary + S_expr_primitive = 173, // expr_primitive + S_expr_complement = 174, // expr_complement + S_expr_not = 175, // expr_not + S_expr_call = 176, // expr_call + S_expr_method = 177, // expr_method + S_expr_function = 178, // expr_function + S_expr_pointer = 179, // expr_pointer + S_expr_parameters = 180, // expr_parameters + 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_identifier = 215, // expr_identifier + S_expr_path = 216, // expr_path + S_expr_istring = 217, // expr_istring + S_expr_string = 218, // expr_string + S_expr_vector = 219, // expr_vector + S_expr_hash = 220, // expr_hash + S_expr_float = 221, // expr_float + S_expr_integer = 222, // expr_integer + S_expr_false = 223, // expr_false + S_expr_true = 224 // expr_true + }; + }; + + /// (Internal) symbol kind. + typedef symbol_kind::symbol_kind_type symbol_kind_type; + + /// The number of tokens. + static const symbol_kind_type YYNTOKENS = symbol_kind::YYNTOKENS; + + /// A complete symbol. + /// + /// Expects its Base type to provide access to the symbol kind + /// via kind (). + /// + /// Provide access to semantic value and location. + template + struct basic_symbol : Base + { + /// Alias to Base. + typedef Base super_type; + + /// Default constructor. + basic_symbol () + : value () + , location () + {} + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + basic_symbol (basic_symbol&& that) + : Base (std::move (that)) + , value () + , location (std::move (that.location)) + { + switch (this->kind ()) + { + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_pointer: // expr_pointer + value.move< ast::call > (std::move (that.value)); + break; + + case symbol_kind::S_declaration: // declaration + value.move< ast::decl > (std::move (that.value)); + break; + + case symbol_kind::S_decl_constant: // decl_constant + value.move< ast::decl_constant::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_decl_thread: // decl_thread + value.move< ast::decl_thread::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_decl_usingtree: // decl_usingtree + value.move< ast::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_ternary: // expr_ternary + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + case symbol_kind::S_expr_object: // expr_object + value.move< ast::expr > (std::move (that.value)); + break; + + case symbol_kind::S_expr_abs: // expr_abs + value.move< ast::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)); + break; + + case symbol_kind::S_expr_anglestoforward: // expr_anglestoforward + value.move< ast::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)); + break; + + case symbol_kind::S_expr_anglestoup: // expr_anglestoup + value.move< ast::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)); + break; + + case symbol_kind::S_expr_animation: // expr_animation + value.move< ast::expr_animation::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)); + break; + + case symbol_kind::S_expr_array: // expr_array + value.move< ast::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)); + break; + + case symbol_kind::S_expr_complement: // expr_complement + value.move< ast::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)); + break; + + case symbol_kind::S_expr_false: // expr_false + value.move< ast::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)); + break; + + case symbol_kind::S_expr_float: // expr_float + value.move< ast::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)); + break; + + case symbol_kind::S_expr_getdvar: // expr_getdvar + value.move< ast::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)); + break; + + case symbol_kind::S_expr_getdvarcolorblue: // expr_getdvarcolorblue + value.move< ast::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)); + break; + + case symbol_kind::S_expr_getdvarcolorred: // expr_getdvarcolorred + value.move< ast::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)); + break; + + case symbol_kind::S_expr_getdvarint: // expr_getdvarint + value.move< ast::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)); + break; + + case symbol_kind::S_expr_getfirstarraykey: // expr_getfirstarraykey + value.move< ast::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)); + break; + + case symbol_kind::S_expr_gettime: // expr_gettime + value.move< ast::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)); + break; + + case symbol_kind::S_expr_identifier: // expr_identifier + value.move< ast::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)); + break; + + case symbol_kind::S_expr_isdefined: // expr_isdefined + value.move< ast::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)); + break; + + case symbol_kind::S_expr_level: // expr_level + value.move< ast::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)); + break; + + case symbol_kind::S_expr_not: // expr_not + value.move< ast::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)); + break; + + case symbol_kind::S_expr_paren: // expr_paren + value.move< ast::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)); + break; + + case symbol_kind::S_expr_reference: // expr_reference + value.move< ast::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)); + break; + + case symbol_kind::S_expr_size: // expr_size + value.move< ast::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)); + break; + + case symbol_kind::S_expr_true: // expr_true + value.move< ast::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)); + break; + + case symbol_kind::S_expr_vector: // expr_vector + value.move< ast::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)); + break; + + case symbol_kind::S_expr_vectortoangles: // expr_vectortoangles + value.move< ast::expr_vectortoangles::ptr > (std::move (that.value)); + break; + + case symbol_kind::S_include: // include + value.move< ast::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_breakpoint: // stmt_breakpoint + value.move< ast::stmt_breakpoint::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_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)); + break; + + case symbol_kind::S_FIELD: // "field" + 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 > (std::move (that.value)); + break; + + default: + break; + } + + } +#endif + + /// Copy constructor. + basic_symbol (const basic_symbol& that); + + /// Constructors for typed symbols. +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, location_type&& l) + : Base (t) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const location_type& l) + : Base (t) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::call&& 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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::decl&& 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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::decl_constant::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_constant::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::decl_thread::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::expr&& 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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, ast::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_breakpoint::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_breakpoint::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_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) + : Base (t) + , value (v) + , location (l) + {} +#endif + +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, std::string&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const std::string& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif + + /// Destroy the symbol. + ~basic_symbol () + { + clear (); + } + + /// Destroy contents, and record that is empty. + void clear () YY_NOEXCEPT + { + // User destructor. + symbol_kind_type yykind = this->kind (); + basic_symbol& yysym = *this; + (void) yysym; + switch (yykind) + { + default: + break; + } + + // Value type destructor. +switch (yykind) + { + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_pointer: // expr_pointer + value.template destroy< ast::call > (); + break; + + case symbol_kind::S_declaration: // declaration + value.template destroy< ast::decl > (); + break; + + case symbol_kind::S_decl_constant: // decl_constant + value.template destroy< ast::decl_constant::ptr > (); + break; + + case symbol_kind::S_decl_thread: // decl_thread + value.template destroy< ast::decl_thread::ptr > (); + break; + + case symbol_kind::S_decl_usingtree: // decl_usingtree + value.template destroy< 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_object: // expr_object + value.template destroy< ast::expr > (); + break; + + case symbol_kind::S_expr_abs: // expr_abs + value.template destroy< ast::expr_abs::ptr > (); + break; + + case symbol_kind::S_expr_angleclamp180: // expr_angleclamp180 + value.template destroy< ast::expr_angleclamp180::ptr > (); + break; + + case symbol_kind::S_expr_anglestoforward: // expr_anglestoforward + value.template destroy< ast::expr_anglestoforward::ptr > (); + break; + + case symbol_kind::S_expr_anglestoright: // expr_anglestoright + value.template destroy< ast::expr_anglestoright::ptr > (); + break; + + case symbol_kind::S_expr_anglestoup: // expr_anglestoup + value.template destroy< ast::expr_anglestoup::ptr > (); + break; + + case symbol_kind::S_expr_anim: // expr_anim + value.template destroy< ast::expr_anim::ptr > (); + break; + + case symbol_kind::S_expr_animation: // expr_animation + value.template destroy< ast::expr_animation::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 > (); + break; + + case symbol_kind::S_expr_array: // expr_array + value.template destroy< ast::expr_array::ptr > (); + break; + + case symbol_kind::S_expr_call: // expr_call + value.template destroy< ast::expr_call::ptr > (); + break; + + case symbol_kind::S_expr_complement: // expr_complement + value.template destroy< ast::expr_complement::ptr > (); + break; + + case symbol_kind::S_expr_empty_array: // expr_empty_array + value.template destroy< ast::expr_empty_array::ptr > (); + break; + + case symbol_kind::S_expr_false: // expr_false + value.template destroy< ast::expr_false::ptr > (); + break; + + case symbol_kind::S_expr_field: // expr_field + value.template destroy< ast::expr_field::ptr > (); + break; + + case symbol_kind::S_expr_float: // expr_float + value.template destroy< ast::expr_float::ptr > (); + break; + + case symbol_kind::S_expr_game: // expr_game + value.template destroy< ast::expr_game::ptr > (); + break; + + case symbol_kind::S_expr_getdvar: // expr_getdvar + value.template destroy< ast::expr_getdvar::ptr > (); + break; + + case symbol_kind::S_expr_getdvarcoloralpha: // expr_getdvarcoloralpha + value.template destroy< ast::expr_getdvarcoloralpha::ptr > (); + break; + + case symbol_kind::S_expr_getdvarcolorblue: // expr_getdvarcolorblue + value.template destroy< ast::expr_getdvarcolorblue::ptr > (); + break; + + case symbol_kind::S_expr_getdvarcolorgreen: // expr_getdvarcolorgreen + value.template destroy< ast::expr_getdvarcolorgreen::ptr > (); + break; + + case symbol_kind::S_expr_getdvarcolorred: // expr_getdvarcolorred + value.template destroy< ast::expr_getdvarcolorred::ptr > (); + break; + + case symbol_kind::S_expr_getdvarfloat: // expr_getdvarfloat + value.template destroy< ast::expr_getdvarfloat::ptr > (); + break; + + case symbol_kind::S_expr_getdvarint: // expr_getdvarint + value.template destroy< ast::expr_getdvarint::ptr > (); + break; + + case symbol_kind::S_expr_getdvarvector: // expr_getdvarvector + value.template destroy< ast::expr_getdvarvector::ptr > (); + break; + + case symbol_kind::S_expr_getfirstarraykey: // expr_getfirstarraykey + value.template destroy< ast::expr_getfirstarraykey::ptr > (); + break; + + case symbol_kind::S_expr_getnextarraykey: // expr_getnextarraykey + value.template destroy< ast::expr_getnextarraykey::ptr > (); + break; + + case symbol_kind::S_expr_gettime: // expr_gettime + value.template destroy< ast::expr_gettime::ptr > (); + break; + + case symbol_kind::S_expr_hash: // expr_hash + value.template destroy< ast::expr_hash::ptr > (); + break; + + case symbol_kind::S_expr_identifier: // expr_identifier + value.template destroy< ast::expr_identifier::ptr > (); + break; + + case symbol_kind::S_expr_integer: // expr_integer + value.template destroy< ast::expr_integer::ptr > (); + break; + + case symbol_kind::S_expr_isdefined: // expr_isdefined + value.template destroy< ast::expr_isdefined::ptr > (); + break; + + case symbol_kind::S_expr_istring: // expr_istring + value.template destroy< ast::expr_istring::ptr > (); + break; + + case symbol_kind::S_expr_level: // expr_level + value.template destroy< ast::expr_level::ptr > (); + break; + + case symbol_kind::S_expr_method: // expr_method + value.template destroy< ast::expr_method::ptr > (); + break; + + case symbol_kind::S_expr_not: // expr_not + value.template destroy< ast::expr_not::ptr > (); + break; + + case symbol_kind::S_expr_parameters: // expr_parameters + value.template destroy< ast::expr_parameters::ptr > (); + break; + + case symbol_kind::S_expr_paren: // expr_paren + value.template destroy< ast::expr_paren::ptr > (); + break; + + case symbol_kind::S_expr_path: // expr_path + value.template destroy< ast::expr_path::ptr > (); + break; + + case symbol_kind::S_expr_reference: // expr_reference + value.template destroy< ast::expr_reference::ptr > (); + break; + + case symbol_kind::S_expr_self: // expr_self + value.template destroy< ast::expr_self::ptr > (); + break; + + case symbol_kind::S_expr_size: // expr_size + value.template destroy< ast::expr_size::ptr > (); + break; + + case symbol_kind::S_expr_string: // expr_string + value.template destroy< ast::expr_string::ptr > (); + break; + + case symbol_kind::S_expr_true: // expr_true + value.template destroy< ast::expr_true::ptr > (); + break; + + case symbol_kind::S_expr_undefined: // expr_undefined + value.template destroy< ast::expr_undefined::ptr > (); + break; + + case symbol_kind::S_expr_vector: // expr_vector + value.template destroy< ast::expr_vector::ptr > (); + break; + + case symbol_kind::S_expr_vectorscale: // expr_vectorscale + value.template destroy< ast::expr_vectorscale::ptr > (); + break; + + case symbol_kind::S_expr_vectortoangles: // expr_vectortoangles + value.template destroy< ast::expr_vectortoangles::ptr > (); + break; + + case symbol_kind::S_include: // include + value.template destroy< ast::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_breakpoint: // stmt_breakpoint + value.template destroy< ast::stmt_breakpoint::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_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 > (); + break; + + case symbol_kind::S_FIELD: // "field" + 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.template destroy< std::string > (); + break; + + default: + break; + } + + Base::clear (); + } + + /// The user-facing name of this symbol. + const char *name () const YY_NOEXCEPT + { + return parser::symbol_name (this->kind ()); + } + + /// Backward compatibility (Bison 3.6). + symbol_kind_type type_get () const YY_NOEXCEPT; + + /// Whether empty. + bool empty () const YY_NOEXCEPT; + + /// Destructive move, \a s is emptied into this. + void move (basic_symbol& s); + + /// The semantic value. + semantic_type value; + + /// The location. + location_type location; + + private: +#if YY_CPLUSPLUS < 201103L + /// Assignment operator. + basic_symbol& operator= (const basic_symbol& that); +#endif + }; + + /// Type access provider for token (enum) based symbols. + struct by_kind + { + /// Default constructor. + by_kind (); + +#if 201103L <= YY_CPLUSPLUS + /// Move constructor. + by_kind (by_kind&& that); +#endif + + /// Copy constructor. + by_kind (const by_kind& that); + + /// The symbol kind as needed by the constructor. + typedef token_kind_type kind_type; + + /// Constructor from (external) token numbers. + by_kind (kind_type t); + + /// Record that this symbol is empty. + void clear () YY_NOEXCEPT; + + /// Steal the symbol kind from \a that. + void move (by_kind& that); + + /// The (internal) type number (corresponding to \a type). + /// \a empty when empty. + symbol_kind_type kind () const YY_NOEXCEPT; + + /// Backward compatibility (Bison 3.6). + symbol_kind_type type_get () const YY_NOEXCEPT; + + /// The symbol kind. + /// \a S_YYEMPTY when empty. + symbol_kind_type kind_; + }; + + /// Backward compatibility for a private implementation detail (Bison 3.6). + typedef by_kind by_type; + + /// "External" symbols: returned by the scanner. + struct symbol_type : basic_symbol + { + /// Superclass. + typedef basic_symbol super_type; + + /// Empty symbol. + symbol_type () {} + + /// Constructor for valueless symbols, and symbols from each type. +#if 201103L <= YY_CPLUSPLUS + symbol_type (int tok, location_type l) + : super_type(token_type (tok), std::move (l)) +#else + symbol_type (int tok, const location_type& l) + : super_type(token_type (tok), l) +#endif + { + T6_ASSERT (tok == token::T6EOF + || (token::T6error <= tok && tok <= token::MOD) + || (token::THEN <= tok && tok <= token::POSTDEC)); + } +#if 201103L <= YY_CPLUSPLUS + symbol_type (int tok, std::string v, location_type l) + : super_type(token_type (tok), std::move (v), std::move (l)) +#else + symbol_type (int tok, const std::string& v, const location_type& l) + : super_type(token_type (tok), v, l) +#endif + { + T6_ASSERT ((token::FIELD <= tok && tok <= token::INTEGER)); + } + }; + + /// Build a parser object. + parser (xsk::arc::t6::lexer& lexer_yyarg, xsk::arc::ast::program::ptr& ast_yyarg); + virtual ~parser (); + +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + parser (const parser&) = delete; + /// Non copyable. + parser& operator= (const parser&) = delete; +#endif + + /// Parse. An alias for parse (). + /// \returns 0 iff parsing succeeded. + int operator() (); + + /// Parse. + /// \returns 0 iff parsing succeeded. + virtual int parse (); + +#if T6DEBUG + /// The current debugging stream. + std::ostream& debug_stream () const YY_ATTRIBUTE_PURE; + /// Set the current debugging stream. + void set_debug_stream (std::ostream &); + + /// Type for debugging levels. + typedef int debug_level_type; + /// The current debugging level. + debug_level_type debug_level () const YY_ATTRIBUTE_PURE; + /// Set the current debugging level. + void set_debug_level (debug_level_type l); +#endif + + /// Report a syntax error. + /// \param loc where the syntax error is found. + /// \param msg a description of the syntax error. + virtual void error (const location_type& loc, const std::string& msg); + + /// Report a syntax error. + void error (const syntax_error& err); + + /// The user-facing name of the symbol whose (internal) number is + /// YYSYMBOL. No bounds checking. + static const char *symbol_name (symbol_kind_type yysymbol); + + // Implementation of make_symbol for each symbol type. +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_T6EOF (location_type l) + { + return symbol_type (token::T6EOF, std::move (l)); + } +#else + static + symbol_type + make_T6EOF (const location_type& l) + { + return symbol_type (token::T6EOF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_T6error (location_type l) + { + return symbol_type (token::T6error, std::move (l)); + } +#else + static + symbol_type + make_T6error (const location_type& l) + { + return symbol_type (token::T6error, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_T6UNDEF (location_type l) + { + return symbol_type (token::T6UNDEF, std::move (l)); + } +#else + static + symbol_type + make_T6UNDEF (const location_type& l) + { + return symbol_type (token::T6UNDEF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SH_DEFINE (location_type l) + { + return symbol_type (token::SH_DEFINE, std::move (l)); + } +#else + static + symbol_type + make_SH_DEFINE (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); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DEVBEGIN (location_type l) + { + return symbol_type (token::DEVBEGIN, std::move (l)); + } +#else + static + symbol_type + make_DEVBEGIN (const location_type& l) + { + return symbol_type (token::DEVBEGIN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DEVEND (location_type l) + { + return symbol_type (token::DEVEND, std::move (l)); + } +#else + static + symbol_type + make_DEVEND (const location_type& l) + { + return symbol_type (token::DEVEND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INLINE (location_type l) + { + return symbol_type (token::INLINE, std::move (l)); + } +#else + static + symbol_type + make_INLINE (const location_type& l) + { + return symbol_type (token::INLINE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INCLUDE (location_type l) + { + return symbol_type (token::INCLUDE, std::move (l)); + } +#else + static + symbol_type + make_INCLUDE (const location_type& l) + { + return symbol_type (token::INCLUDE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_USINGTREE (location_type l) + { + return symbol_type (token::USINGTREE, std::move (l)); + } +#else + static + symbol_type + make_USINGTREE (const location_type& l) + { + return symbol_type (token::USINGTREE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ENDON (location_type l) + { + return symbol_type (token::ENDON, std::move (l)); + } +#else + static + symbol_type + make_ENDON (const location_type& l) + { + return symbol_type (token::ENDON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NOTIFY (location_type l) + { + return symbol_type (token::NOTIFY, std::move (l)); + } +#else + static + symbol_type + make_NOTIFY (const location_type& l) + { + return symbol_type (token::NOTIFY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAIT (location_type l) + { + return symbol_type (token::WAIT, std::move (l)); + } +#else + static + symbol_type + make_WAIT (const location_type& l) + { + return symbol_type (token::WAIT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITTILL (location_type l) + { + return symbol_type (token::WAITTILL, std::move (l)); + } +#else + static + symbol_type + make_WAITTILL (const location_type& l) + { + return symbol_type (token::WAITTILL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITTILLMATCH (location_type l) + { + return symbol_type (token::WAITTILLMATCH, std::move (l)); + } +#else + static + symbol_type + make_WAITTILLMATCH (const location_type& l) + { + return symbol_type (token::WAITTILLMATCH, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WAITTILLFRAMEEND (location_type l) + { + return symbol_type (token::WAITTILLFRAMEEND, std::move (l)); + } +#else + static + symbol_type + make_WAITTILLFRAMEEND (const location_type& l) + { + return symbol_type (token::WAITTILLFRAMEEND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IF (location_type l) + { + return symbol_type (token::IF, std::move (l)); + } +#else + static + symbol_type + make_IF (const location_type& l) + { + return symbol_type (token::IF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ELSE (location_type l) + { + return symbol_type (token::ELSE, std::move (l)); + } +#else + static + symbol_type + make_ELSE (const location_type& l) + { + return symbol_type (token::ELSE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DO (location_type l) + { + return symbol_type (token::DO, std::move (l)); + } +#else + static + symbol_type + make_DO (const location_type& l) + { + return symbol_type (token::DO, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_WHILE (location_type l) + { + return symbol_type (token::WHILE, std::move (l)); + } +#else + static + symbol_type + make_WHILE (const location_type& l) + { + return symbol_type (token::WHILE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FOR (location_type l) + { + return symbol_type (token::FOR, std::move (l)); + } +#else + static + symbol_type + make_FOR (const location_type& l) + { + return symbol_type (token::FOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FOREACH (location_type l) + { + return symbol_type (token::FOREACH, std::move (l)); + } +#else + static + symbol_type + make_FOREACH (const location_type& l) + { + return symbol_type (token::FOREACH, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IN (location_type l) + { + return symbol_type (token::IN, std::move (l)); + } +#else + static + symbol_type + make_IN (const location_type& l) + { + return symbol_type (token::IN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SWITCH (location_type l) + { + return symbol_type (token::SWITCH, std::move (l)); + } +#else + static + symbol_type + make_SWITCH (const location_type& l) + { + return symbol_type (token::SWITCH, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CASE (location_type l) + { + return symbol_type (token::CASE, std::move (l)); + } +#else + static + symbol_type + make_CASE (const location_type& l) + { + return symbol_type (token::CASE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DEFAULT (location_type l) + { + return symbol_type (token::DEFAULT, std::move (l)); + } +#else + static + symbol_type + make_DEFAULT (const location_type& l) + { + return symbol_type (token::DEFAULT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BREAK (location_type l) + { + return symbol_type (token::BREAK, std::move (l)); + } +#else + static + symbol_type + make_BREAK (const location_type& l) + { + return symbol_type (token::BREAK, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_CONTINUE (location_type l) + { + return symbol_type (token::CONTINUE, std::move (l)); + } +#else + static + symbol_type + make_CONTINUE (const location_type& l) + { + return symbol_type (token::CONTINUE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RETURN (location_type l) + { + return symbol_type (token::RETURN, std::move (l)); + } +#else + static + symbol_type + make_RETURN (const location_type& l) + { + return symbol_type (token::RETURN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BREAKPOINT (location_type l) + { + return symbol_type (token::BREAKPOINT, std::move (l)); + } +#else + static + symbol_type + make_BREAKPOINT (const location_type& l) + { + return symbol_type (token::BREAKPOINT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_PROFBEGIN (location_type l) + { + return symbol_type (token::PROFBEGIN, std::move (l)); + } +#else + static + symbol_type + make_PROFBEGIN (const location_type& l) + { + return symbol_type (token::PROFBEGIN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_PROFEND (location_type l) + { + return symbol_type (token::PROFEND, std::move (l)); + } +#else + static + symbol_type + make_PROFEND (const location_type& l) + { + return symbol_type (token::PROFEND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_THREAD (location_type l) + { + return symbol_type (token::THREAD, std::move (l)); + } +#else + static + symbol_type + make_THREAD (const location_type& l) + { + return symbol_type (token::THREAD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_TRUE (location_type l) + { + return symbol_type (token::TRUE, std::move (l)); + } +#else + static + symbol_type + make_TRUE (const location_type& l) + { + return symbol_type (token::TRUE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FALSE (location_type l) + { + return symbol_type (token::FALSE, std::move (l)); + } +#else + static + symbol_type + make_FALSE (const location_type& l) + { + return symbol_type (token::FALSE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_UNDEFINED (location_type l) + { + return symbol_type (token::UNDEFINED, std::move (l)); + } +#else + static + symbol_type + make_UNDEFINED (const location_type& l) + { + return symbol_type (token::UNDEFINED, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SIZE (location_type l) + { + return symbol_type (token::SIZE, std::move (l)); + } +#else + static + symbol_type + make_SIZE (const location_type& l) + { + return symbol_type (token::SIZE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GAME (location_type l) + { + return symbol_type (token::GAME, std::move (l)); + } +#else + static + symbol_type + make_GAME (const location_type& l) + { + return symbol_type (token::GAME, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SELF (location_type l) + { + return symbol_type (token::SELF, std::move (l)); + } +#else + static + symbol_type + make_SELF (const location_type& l) + { + return symbol_type (token::SELF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANIM (location_type l) + { + return symbol_type (token::ANIM, std::move (l)); + } +#else + static + symbol_type + make_ANIM (const location_type& l) + { + return symbol_type (token::ANIM, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LEVEL (location_type l) + { + return symbol_type (token::LEVEL, std::move (l)); + } +#else + static + symbol_type + make_LEVEL (const location_type& l) + { + return symbol_type (token::LEVEL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GETNEXTARRAYKEY (location_type l) + { + return symbol_type (token::GETNEXTARRAYKEY, std::move (l)); + } +#else + static + symbol_type + make_GETNEXTARRAYKEY (const location_type& l) + { + return symbol_type (token::GETNEXTARRAYKEY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GETFIRSTARRAYKEY (location_type l) + { + return symbol_type (token::GETFIRSTARRAYKEY, std::move (l)); + } +#else + static + symbol_type + make_GETFIRSTARRAYKEY (const location_type& l) + { + return symbol_type (token::GETFIRSTARRAYKEY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GETDVARCOLORALPHA (location_type l) + { + return symbol_type (token::GETDVARCOLORALPHA, std::move (l)); + } +#else + static + symbol_type + make_GETDVARCOLORALPHA (const location_type& l) + { + return symbol_type (token::GETDVARCOLORALPHA, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GETDVARCOLORBLUE (location_type l) + { + return symbol_type (token::GETDVARCOLORBLUE, std::move (l)); + } +#else + static + symbol_type + make_GETDVARCOLORBLUE (const location_type& l) + { + return symbol_type (token::GETDVARCOLORBLUE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GETDVARCOLORGREEN (location_type l) + { + return symbol_type (token::GETDVARCOLORGREEN, std::move (l)); + } +#else + static + symbol_type + make_GETDVARCOLORGREEN (const location_type& l) + { + return symbol_type (token::GETDVARCOLORGREEN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GETDVARCOLORRED (location_type l) + { + return symbol_type (token::GETDVARCOLORRED, std::move (l)); + } +#else + static + symbol_type + make_GETDVARCOLORRED (const location_type& l) + { + return symbol_type (token::GETDVARCOLORRED, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GETDVARVECTOR (location_type l) + { + return symbol_type (token::GETDVARVECTOR, std::move (l)); + } +#else + static + symbol_type + make_GETDVARVECTOR (const location_type& l) + { + return symbol_type (token::GETDVARVECTOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GETDVARFLOAT (location_type l) + { + return symbol_type (token::GETDVARFLOAT, std::move (l)); + } +#else + static + symbol_type + make_GETDVARFLOAT (const location_type& l) + { + return symbol_type (token::GETDVARFLOAT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GETDVARINT (location_type l) + { + return symbol_type (token::GETDVARINT, std::move (l)); + } +#else + static + symbol_type + make_GETDVARINT (const location_type& l) + { + return symbol_type (token::GETDVARINT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GETDVAR (location_type l) + { + return symbol_type (token::GETDVAR, std::move (l)); + } +#else + static + symbol_type + make_GETDVAR (const location_type& l) + { + return symbol_type (token::GETDVAR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GETTIME (location_type l) + { + return symbol_type (token::GETTIME, std::move (l)); + } +#else + static + symbol_type + make_GETTIME (const location_type& l) + { + return symbol_type (token::GETTIME, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ABS (location_type l) + { + return symbol_type (token::ABS, std::move (l)); + } +#else + static + symbol_type + make_ABS (const location_type& l) + { + return symbol_type (token::ABS, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_VECTORTOANGLES (location_type l) + { + return symbol_type (token::VECTORTOANGLES, std::move (l)); + } +#else + static + symbol_type + make_VECTORTOANGLES (const location_type& l) + { + return symbol_type (token::VECTORTOANGLES, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANGLECLAMP180 (location_type l) + { + return symbol_type (token::ANGLECLAMP180, std::move (l)); + } +#else + static + symbol_type + make_ANGLECLAMP180 (const location_type& l) + { + return symbol_type (token::ANGLECLAMP180, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANGLESTOFORWARD (location_type l) + { + return symbol_type (token::ANGLESTOFORWARD, std::move (l)); + } +#else + static + symbol_type + make_ANGLESTOFORWARD (const location_type& l) + { + return symbol_type (token::ANGLESTOFORWARD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANGLESTORIGHT (location_type l) + { + return symbol_type (token::ANGLESTORIGHT, std::move (l)); + } +#else + static + symbol_type + make_ANGLESTORIGHT (const location_type& l) + { + return symbol_type (token::ANGLESTORIGHT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANGLESTOUP (location_type l) + { + return symbol_type (token::ANGLESTOUP, std::move (l)); + } +#else + static + symbol_type + make_ANGLESTOUP (const location_type& l) + { + return symbol_type (token::ANGLESTOUP, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_VECTORSCALE (location_type l) + { + return symbol_type (token::VECTORSCALE, std::move (l)); + } +#else + static + symbol_type + make_VECTORSCALE (const location_type& l) + { + return symbol_type (token::VECTORSCALE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ISDEFINED (location_type l) + { + return symbol_type (token::ISDEFINED, std::move (l)); + } +#else + static + symbol_type + make_ISDEFINED (const location_type& l) + { + return symbol_type (token::ISDEFINED, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LPAREN (location_type l) + { + return symbol_type (token::LPAREN, std::move (l)); + } +#else + static + symbol_type + make_LPAREN (const location_type& l) + { + return symbol_type (token::LPAREN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RPAREN (location_type l) + { + return symbol_type (token::RPAREN, std::move (l)); + } +#else + static + symbol_type + make_RPAREN (const location_type& l) + { + return symbol_type (token::RPAREN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LBRACE (location_type l) + { + return symbol_type (token::LBRACE, std::move (l)); + } +#else + static + symbol_type + make_LBRACE (const location_type& l) + { + return symbol_type (token::LBRACE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RBRACE (location_type l) + { + return symbol_type (token::RBRACE, std::move (l)); + } +#else + static + symbol_type + make_RBRACE (const location_type& l) + { + return symbol_type (token::RBRACE, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LBRACKET (location_type l) + { + return symbol_type (token::LBRACKET, std::move (l)); + } +#else + static + symbol_type + make_LBRACKET (const location_type& l) + { + return symbol_type (token::LBRACKET, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RBRACKET (location_type l) + { + return symbol_type (token::RBRACKET, std::move (l)); + } +#else + static + symbol_type + make_RBRACKET (const location_type& l) + { + return symbol_type (token::RBRACKET, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_COMMA (location_type l) + { + return symbol_type (token::COMMA, std::move (l)); + } +#else + static + symbol_type + make_COMMA (const location_type& l) + { + return symbol_type (token::COMMA, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DOT (location_type l) + { + return symbol_type (token::DOT, std::move (l)); + } +#else + static + symbol_type + make_DOT (const location_type& l) + { + return symbol_type (token::DOT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DOUBLECOLON (location_type l) + { + return symbol_type (token::DOUBLECOLON, std::move (l)); + } +#else + static + symbol_type + make_DOUBLECOLON (const location_type& l) + { + return symbol_type (token::DOUBLECOLON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_COLON (location_type l) + { + return symbol_type (token::COLON, std::move (l)); + } +#else + static + symbol_type + make_COLON (const location_type& l) + { + return symbol_type (token::COLON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SEMICOLON (location_type l) + { + return symbol_type (token::SEMICOLON, std::move (l)); + } +#else + static + symbol_type + make_SEMICOLON (const location_type& l) + { + return symbol_type (token::SEMICOLON, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_QMARK (location_type l) + { + return symbol_type (token::QMARK, std::move (l)); + } +#else + static + symbol_type + make_QMARK (const location_type& l) + { + return symbol_type (token::QMARK, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INCREMENT (location_type l) + { + return symbol_type (token::INCREMENT, std::move (l)); + } +#else + static + symbol_type + make_INCREMENT (const location_type& l) + { + return symbol_type (token::INCREMENT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DECREMENT (location_type l) + { + return symbol_type (token::DECREMENT, std::move (l)); + } +#else + static + symbol_type + make_DECREMENT (const location_type& l) + { + return symbol_type (token::DECREMENT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LSHIFT (location_type l) + { + return symbol_type (token::LSHIFT, std::move (l)); + } +#else + static + symbol_type + make_LSHIFT (const location_type& l) + { + return symbol_type (token::LSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_RSHIFT (location_type l) + { + return symbol_type (token::RSHIFT, std::move (l)); + } +#else + static + symbol_type + make_RSHIFT (const location_type& l) + { + return symbol_type (token::RSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_OR (location_type l) + { + return symbol_type (token::OR, std::move (l)); + } +#else + static + symbol_type + make_OR (const location_type& l) + { + return symbol_type (token::OR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_AND (location_type l) + { + return symbol_type (token::AND, std::move (l)); + } +#else + static + symbol_type + make_AND (const location_type& l) + { + return symbol_type (token::AND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_EQUALITY (location_type l) + { + return symbol_type (token::EQUALITY, std::move (l)); + } +#else + static + symbol_type + make_EQUALITY (const location_type& l) + { + return symbol_type (token::EQUALITY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INEQUALITY (location_type l) + { + return symbol_type (token::INEQUALITY, std::move (l)); + } +#else + static + symbol_type + make_INEQUALITY (const location_type& l) + { + return symbol_type (token::INEQUALITY, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LESS_EQUAL (location_type l) + { + return symbol_type (token::LESS_EQUAL, std::move (l)); + } +#else + static + symbol_type + make_LESS_EQUAL (const location_type& l) + { + return symbol_type (token::LESS_EQUAL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GREATER_EQUAL (location_type l) + { + return symbol_type (token::GREATER_EQUAL, std::move (l)); + } +#else + static + symbol_type + make_GREATER_EQUAL (const location_type& l) + { + return symbol_type (token::GREATER_EQUAL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_LESS (location_type l) + { + return symbol_type (token::LESS, std::move (l)); + } +#else + static + symbol_type + make_LESS (const location_type& l) + { + return symbol_type (token::LESS, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_GREATER (location_type l) + { + return symbol_type (token::GREATER, std::move (l)); + } +#else + static + symbol_type + make_GREATER (const location_type& l) + { + return symbol_type (token::GREATER, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NOT (location_type l) + { + return symbol_type (token::NOT, std::move (l)); + } +#else + static + symbol_type + make_NOT (const location_type& l) + { + return symbol_type (token::NOT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_COMPLEMENT (location_type l) + { + return symbol_type (token::COMPLEMENT, std::move (l)); + } +#else + static + symbol_type + make_COMPLEMENT (const location_type& l) + { + return symbol_type (token::COMPLEMENT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN (location_type l) + { + return symbol_type (token::ASSIGN, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN (const location_type& l) + { + return symbol_type (token::ASSIGN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_ADD (location_type l) + { + return symbol_type (token::ASSIGN_ADD, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_ADD (const location_type& l) + { + return symbol_type (token::ASSIGN_ADD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_SUB (location_type l) + { + return symbol_type (token::ASSIGN_SUB, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_SUB (const location_type& l) + { + return symbol_type (token::ASSIGN_SUB, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_MUL (location_type l) + { + return symbol_type (token::ASSIGN_MUL, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_MUL (const location_type& l) + { + return symbol_type (token::ASSIGN_MUL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_DIV (location_type l) + { + return symbol_type (token::ASSIGN_DIV, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_DIV (const location_type& l) + { + return symbol_type (token::ASSIGN_DIV, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_MOD (location_type l) + { + return symbol_type (token::ASSIGN_MOD, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_MOD (const location_type& l) + { + return symbol_type (token::ASSIGN_MOD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_BW_OR (location_type l) + { + return symbol_type (token::ASSIGN_BW_OR, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_BW_OR (const location_type& l) + { + return symbol_type (token::ASSIGN_BW_OR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_BW_AND (location_type l) + { + return symbol_type (token::ASSIGN_BW_AND, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_BW_AND (const location_type& l) + { + return symbol_type (token::ASSIGN_BW_AND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_BW_EXOR (location_type l) + { + return symbol_type (token::ASSIGN_BW_EXOR, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_BW_EXOR (const location_type& l) + { + return symbol_type (token::ASSIGN_BW_EXOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_RSHIFT (location_type l) + { + return symbol_type (token::ASSIGN_RSHIFT, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_RSHIFT (const location_type& l) + { + return symbol_type (token::ASSIGN_RSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ASSIGN_LSHIFT (location_type l) + { + return symbol_type (token::ASSIGN_LSHIFT, std::move (l)); + } +#else + static + symbol_type + make_ASSIGN_LSHIFT (const location_type& l) + { + return symbol_type (token::ASSIGN_LSHIFT, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BITWISE_OR (location_type l) + { + return symbol_type (token::BITWISE_OR, std::move (l)); + } +#else + static + symbol_type + make_BITWISE_OR (const location_type& l) + { + return symbol_type (token::BITWISE_OR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BITWISE_AND (location_type l) + { + return symbol_type (token::BITWISE_AND, std::move (l)); + } +#else + static + symbol_type + make_BITWISE_AND (const location_type& l) + { + return symbol_type (token::BITWISE_AND, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_BITWISE_EXOR (location_type l) + { + return symbol_type (token::BITWISE_EXOR, std::move (l)); + } +#else + static + symbol_type + make_BITWISE_EXOR (const location_type& l) + { + return symbol_type (token::BITWISE_EXOR, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ADD (location_type l) + { + return symbol_type (token::ADD, std::move (l)); + } +#else + static + symbol_type + make_ADD (const location_type& l) + { + return symbol_type (token::ADD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_SUB (location_type l) + { + return symbol_type (token::SUB, std::move (l)); + } +#else + static + symbol_type + make_SUB (const location_type& l) + { + return symbol_type (token::SUB, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_MUL (location_type l) + { + return symbol_type (token::MUL, std::move (l)); + } +#else + static + symbol_type + make_MUL (const location_type& l) + { + return symbol_type (token::MUL, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_DIV (location_type l) + { + return symbol_type (token::DIV, std::move (l)); + } +#else + static + symbol_type + make_DIV (const location_type& l) + { + return symbol_type (token::DIV, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_MOD (location_type l) + { + return symbol_type (token::MOD, std::move (l)); + } +#else + static + symbol_type + make_MOD (const location_type& l) + { + return symbol_type (token::MOD, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FIELD (std::string v, location_type l) + { + return symbol_type (token::FIELD, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_FIELD (const std::string& v, const location_type& l) + { + return symbol_type (token::FIELD, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_PATH (std::string v, location_type l) + { + return symbol_type (token::PATH, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_PATH (const std::string& v, const location_type& l) + { + return symbol_type (token::PATH, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_IDENTIFIER (std::string v, location_type l) + { + return symbol_type (token::IDENTIFIER, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_IDENTIFIER (const std::string& v, const location_type& l) + { + return symbol_type (token::IDENTIFIER, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_STRING (std::string v, location_type l) + { + return symbol_type (token::STRING, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_STRING (const std::string& v, const location_type& l) + { + return symbol_type (token::STRING, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ISTRING (std::string v, location_type l) + { + return symbol_type (token::ISTRING, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_ISTRING (const std::string& v, const location_type& l) + { + return symbol_type (token::ISTRING, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_HASH (std::string v, location_type l) + { + return symbol_type (token::HASH, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_HASH (const std::string& v, const location_type& l) + { + return symbol_type (token::HASH, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_FLOAT (std::string v, location_type l) + { + return symbol_type (token::FLOAT, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_FLOAT (const std::string& v, const location_type& l) + { + return symbol_type (token::FLOAT, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_INTEGER (std::string v, location_type l) + { + return symbol_type (token::INTEGER, std::move (v), std::move (l)); + } +#else + static + symbol_type + make_INTEGER (const std::string& v, const location_type& l) + { + return symbol_type (token::INTEGER, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_THEN (location_type l) + { + return symbol_type (token::THEN, std::move (l)); + } +#else + static + symbol_type + make_THEN (const location_type& l) + { + return symbol_type (token::THEN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_TERN (location_type l) + { + return symbol_type (token::TERN, std::move (l)); + } +#else + static + symbol_type + make_TERN (const location_type& l) + { + return symbol_type (token::TERN, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_NEG (location_type l) + { + return symbol_type (token::NEG, std::move (l)); + } +#else + static + symbol_type + make_NEG (const location_type& l) + { + return symbol_type (token::NEG, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_ANIMREF (location_type l) + { + return symbol_type (token::ANIMREF, std::move (l)); + } +#else + static + symbol_type + make_ANIMREF (const location_type& l) + { + return symbol_type (token::ANIMREF, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_PREINC (location_type l) + { + return symbol_type (token::PREINC, std::move (l)); + } +#else + static + symbol_type + make_PREINC (const location_type& l) + { + return symbol_type (token::PREINC, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_PREDEC (location_type l) + { + return symbol_type (token::PREDEC, std::move (l)); + } +#else + static + symbol_type + make_PREDEC (const location_type& l) + { + return symbol_type (token::PREDEC, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_POSTINC (location_type l) + { + return symbol_type (token::POSTINC, std::move (l)); + } +#else + static + symbol_type + make_POSTINC (const location_type& l) + { + return symbol_type (token::POSTINC, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static + symbol_type + make_POSTDEC (location_type l) + { + return symbol_type (token::POSTDEC, std::move (l)); + } +#else + static + symbol_type + make_POSTDEC (const location_type& l) + { + return symbol_type (token::POSTDEC, l); + } +#endif + + + class context + { + public: + context (const parser& yyparser, const symbol_type& yyla); + const symbol_type& lookahead () const YY_NOEXCEPT { return yyla_; } + symbol_kind_type token () const YY_NOEXCEPT { return yyla_.kind (); } + const location_type& location () const YY_NOEXCEPT { return yyla_.location; } + + /// Put in YYARG at most YYARGN of the expected tokens, and return the + /// number of tokens stored in YYARG. If YYARG is null, return the + /// number of expected tokens (guaranteed to be less than YYNTOKENS). + int expected_tokens (symbol_kind_type yyarg[], int yyargn) const; + + private: + const parser& yyparser_; + const symbol_type& yyla_; + }; + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + parser (const parser&); + /// Non copyable. + parser& operator= (const parser&); +#endif + + /// Check the lookahead yytoken. + /// \returns true iff the token will be eventually shifted. + bool yy_lac_check_ (symbol_kind_type yytoken) const; + /// Establish the initial context if no initial context currently exists. + /// \returns true iff the token will be eventually shifted. + bool yy_lac_establish_ (symbol_kind_type yytoken); + /// Discard any previous initial lookahead context because of event. + /// \param event the event which caused the lookahead to be discarded. + /// Only used for debbuging output. + void yy_lac_discard_ (const char* event); + + /// Stored state numbers (used for stacks). + typedef short state_type; + + /// The arguments of the error message. + int yy_syntax_error_arguments_ (const context& yyctx, + symbol_kind_type yyarg[], int yyargn) const; + + /// Generate an error message. + /// \param yyctx the context in which the error occurred. + virtual std::string yysyntax_error_ (const context& yyctx) const; + /// Compute post-reduction state. + /// \param yystate the current state + /// \param yysym the nonterminal to push on the stack + static state_type yy_lr_goto_state_ (state_type yystate, int yysym); + + /// Whether the given \c yypact_ value indicates a defaulted state. + /// \param yyvalue the value to check + static bool yy_pact_value_is_default_ (int yyvalue); + + /// Whether the given \c yytable_ value indicates a syntax error. + /// \param yyvalue the value to check + static bool yy_table_value_is_error_ (int yyvalue); + + static const short yypact_ninf_; + static const short yytable_ninf_; + + /// Convert a scanner token kind \a t to a symbol kind. + /// In theory \a t should be a token_kind_type, but character literals + /// are valid, yet not members of the token_type enum. + static symbol_kind_type yytranslate_ (int t); + + + + // Tables. + // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + // STATE-NUM. + static const short yypact_[]; + + // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + // Performed when YYTABLE does not specify something else to do. Zero + // means the default is an error. + static const unsigned char yydefact_[]; + + // YYPGOTO[NTERM-NUM]. + static const short yypgoto_[]; + + // YYDEFGOTO[NTERM-NUM]. + static const short yydefgoto_[]; + + // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + // positive, shift that token. If negative, reduce the rule whose + // number is the opposite. If YYTABLE_NINF, syntax error. + static const short yytable_[]; + + static const short yycheck_[]; + + // YYSTOS[STATE-NUM] -- The (internal number of the) accessing + // symbol of state STATE-NUM. + static const unsigned char yystos_[]; + + // YYR1[YYN] -- Symbol number of symbol that rule YYN derives. + static const unsigned char yyr1_[]; + + // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. + static const signed char yyr2_[]; + + +#if T6DEBUG + // 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. + virtual void yy_reduce_print_ (int r) const; + /// Print the state stack on the debug stream. + virtual void yy_stack_print_ () const; + + /// Debugging level. + int yydebug_; + /// Debug stream. + std::ostream* yycdebug_; + + /// \brief Display a symbol kind, value and location. + /// \param yyo The output stream. + /// \param yysym The symbol. + template + void yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const; +#endif + + /// \brief Reclaim the memory associated to a symbol. + /// \param yymsg Why this token is reclaimed. + /// If null, print nothing. + /// \param yysym The symbol. + template + void yy_destroy_ (const char* yymsg, basic_symbol& yysym) const; + + private: + /// Type access provider for state based symbols. + struct by_state + { + /// Default constructor. + by_state () YY_NOEXCEPT; + + /// The symbol kind as needed by the constructor. + typedef state_type kind_type; + + /// Constructor. + by_state (kind_type s) YY_NOEXCEPT; + + /// Copy constructor. + by_state (const by_state& that) YY_NOEXCEPT; + + /// Record that this symbol is empty. + void clear () YY_NOEXCEPT; + + /// Steal the symbol kind from \a that. + void move (by_state& that); + + /// The symbol kind (corresponding to \a state). + /// \a symbol_kind::S_YYEMPTY when empty. + symbol_kind_type kind () const YY_NOEXCEPT; + + /// The state number used to denote an empty symbol. + /// We use the initial state, as it does not have a value. + enum { empty_state = 0 }; + + /// The state. + /// \a empty when empty. + state_type state; + }; + + /// "Internal" symbol: element of the stack. + struct stack_symbol_type : basic_symbol + { + /// Superclass. + typedef basic_symbol super_type; + /// Construct an empty symbol. + stack_symbol_type (); + /// Move or copy construction. + stack_symbol_type (YY_RVREF (stack_symbol_type) that); + /// Steal the contents from \a sym to build this. + stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym); +#if YY_CPLUSPLUS < 201103L + /// Assignment, needed by push_back by some old implementations. + /// Moves the contents of that. + stack_symbol_type& operator= (stack_symbol_type& that); + + /// Assignment, needed by push_back by other implementations. + /// Needed by some other old implementations. + stack_symbol_type& operator= (const stack_symbol_type& that); +#endif + }; + + /// A stack with random access from its top. + template > + class stack + { + public: + // Hide our reversed order. + typedef typename S::iterator iterator; + typedef typename S::const_iterator const_iterator; + typedef typename S::size_type size_type; + typedef typename std::ptrdiff_t index_type; + + stack (size_type n = 200) + : seq_ (n) + {} + +#if 201103L <= YY_CPLUSPLUS + /// Non copyable. + stack (const stack&) = delete; + /// Non copyable. + stack& operator= (const stack&) = delete; +#endif + + /// Random access. + /// + /// Index 0 returns the topmost element. + const T& + operator[] (index_type i) const + { + return seq_[size_type (size () - 1 - i)]; + } + + /// Random access. + /// + /// Index 0 returns the topmost element. + T& + operator[] (index_type i) + { + return seq_[size_type (size () - 1 - i)]; + } + + /// Steal the contents of \a t. + /// + /// Close to move-semantics. + void + push (YY_MOVE_REF (T) t) + { + seq_.push_back (T ()); + operator[] (0).move (t); + } + + /// Pop elements from the stack. + void + pop (std::ptrdiff_t n = 1) YY_NOEXCEPT + { + for (; 0 < n; --n) + seq_.pop_back (); + } + + /// Pop all elements from the stack. + void + clear () YY_NOEXCEPT + { + seq_.clear (); + } + + /// Number of elements on the stack. + index_type + size () const YY_NOEXCEPT + { + return index_type (seq_.size ()); + } + + /// Iterator on top of the stack (going downwards). + const_iterator + begin () const YY_NOEXCEPT + { + return seq_.begin (); + } + + /// Bottom of the stack. + const_iterator + end () const YY_NOEXCEPT + { + return seq_.end (); + } + + /// Present a slice of the top of a stack. + class slice + { + public: + slice (const stack& stack, index_type range) + : stack_ (stack) + , range_ (range) + {} + + const T& + operator[] (index_type i) const + { + return stack_[range_ - i]; + } + + private: + const stack& stack_; + index_type range_; + }; + + private: +#if YY_CPLUSPLUS < 201103L + /// Non copyable. + stack (const stack&); + /// Non copyable. + stack& operator= (const stack&); +#endif + /// The wrapped container. + S seq_; + }; + + + /// Stack type. + typedef stack stack_type; + + /// The stack. + stack_type yystack_; + /// The stack for LAC. + /// Logically, the yy_lac_stack's lifetime is confined to the function + /// yy_lac_check_. We just store it as a member of this class to hold + /// on to the memory and to avoid frequent reallocations. + /// Since yy_lac_check_ is const, this member must be mutable. + mutable std::vector yylac_stack_; + /// Whether an initial LAC context was established. + bool yy_lac_established_; + + + /// Push a new state on the stack. + /// \param m a debug message to display + /// if null, no trace is output. + /// \param sym the symbol + /// \warning the contents of \a s.value is stolen. + void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym); + + /// Push a new look ahead token on the state on the stack. + /// \param m a debug message to display + /// if null, no trace is output. + /// \param s the state + /// \param sym the symbol (for its value and location). + /// \warning the contents of \a sym.value is stolen. + void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); + + /// Pop \a n symbols from the stack. + void yypop_ (int n = 1); + + /// Constants. + enum + { + yylast_ = 2819, ///< Last index in yytable_. + yynnts_ = 98, ///< Number of nonterminal symbols. + yyfinal_ = 21 ///< Termination state number. + }; + + + // User arguments. + xsk::arc::t6::lexer& lexer; + xsk::arc::ast::program::ptr& ast; + + }; + + inline + parser::symbol_kind_type + parser::yytranslate_ (int t) + { + return static_cast (t); + } + + // basic_symbol. + template + parser::basic_symbol::basic_symbol (const basic_symbol& that) + : Base (that) + , value () + , location (that.location) + { + switch (this->kind ()) + { + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_pointer: // expr_pointer + value.copy< ast::call > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_declaration: // declaration + value.copy< ast::decl > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_decl_constant: // decl_constant + value.copy< ast::decl_constant::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_decl_thread: // decl_thread + value.copy< ast::decl_thread::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_decl_usingtree: // decl_usingtree + value.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_object: // expr_object + value.copy< ast::expr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_expr_abs: // expr_abs + value.copy< ast::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)); + break; + + case symbol_kind::S_expr_anglestoforward: // expr_anglestoforward + value.copy< ast::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)); + break; + + case symbol_kind::S_expr_anglestoup: // expr_anglestoup + value.copy< ast::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)); + break; + + case symbol_kind::S_expr_animation: // expr_animation + value.copy< ast::expr_animation::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)); + break; + + case symbol_kind::S_expr_array: // expr_array + value.copy< ast::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)); + break; + + case symbol_kind::S_expr_complement: // expr_complement + value.copy< ast::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)); + break; + + case symbol_kind::S_expr_false: // expr_false + value.copy< ast::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)); + break; + + case symbol_kind::S_expr_float: // expr_float + value.copy< ast::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)); + break; + + case symbol_kind::S_expr_getdvar: // expr_getdvar + value.copy< ast::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)); + break; + + case symbol_kind::S_expr_getdvarcolorblue: // expr_getdvarcolorblue + value.copy< ast::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)); + break; + + case symbol_kind::S_expr_getdvarcolorred: // expr_getdvarcolorred + value.copy< ast::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)); + break; + + case symbol_kind::S_expr_getdvarint: // expr_getdvarint + value.copy< ast::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)); + break; + + case symbol_kind::S_expr_getfirstarraykey: // expr_getfirstarraykey + value.copy< ast::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)); + break; + + case symbol_kind::S_expr_gettime: // expr_gettime + value.copy< ast::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)); + break; + + case symbol_kind::S_expr_identifier: // expr_identifier + value.copy< ast::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)); + break; + + case symbol_kind::S_expr_isdefined: // expr_isdefined + value.copy< ast::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)); + break; + + case symbol_kind::S_expr_level: // expr_level + value.copy< ast::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)); + break; + + case symbol_kind::S_expr_not: // expr_not + value.copy< ast::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)); + break; + + case symbol_kind::S_expr_paren: // expr_paren + value.copy< ast::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)); + break; + + case symbol_kind::S_expr_reference: // expr_reference + value.copy< ast::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)); + break; + + case symbol_kind::S_expr_size: // expr_size + value.copy< ast::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)); + break; + + case symbol_kind::S_expr_true: // expr_true + value.copy< ast::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)); + break; + + case symbol_kind::S_expr_vector: // expr_vector + value.copy< ast::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)); + break; + + case symbol_kind::S_expr_vectortoangles: // expr_vectortoangles + value.copy< ast::expr_vectortoangles::ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_include: // include + value.copy< ast::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_breakpoint: // stmt_breakpoint + value.copy< ast::stmt_breakpoint::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_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)); + break; + + case symbol_kind::S_FIELD: // "field" + 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 > (YY_MOVE (that.value)); + break; + + default: + break; + } + + } + + + + template + parser::symbol_kind_type + parser::basic_symbol::type_get () const YY_NOEXCEPT + { + return this->kind (); + } + + template + bool + parser::basic_symbol::empty () const YY_NOEXCEPT + { + return this->kind () == symbol_kind::S_YYEMPTY; + } + + template + void + parser::basic_symbol::move (basic_symbol& s) + { + super_type::move (s); + switch (this->kind ()) + { + case symbol_kind::S_expr_function: // expr_function + case symbol_kind::S_expr_pointer: // expr_pointer + value.move< ast::call > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_declaration: // declaration + value.move< ast::decl > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_decl_constant: // decl_constant + value.move< ast::decl_constant::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_decl_thread: // decl_thread + value.move< ast::decl_thread::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_decl_usingtree: // decl_usingtree + value.move< ast::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_ternary: // expr_ternary + case symbol_kind::S_expr_binary: // expr_binary + case symbol_kind::S_expr_primitive: // expr_primitive + case symbol_kind::S_expr_object: // expr_object + value.move< ast::expr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_expr_abs: // expr_abs + value.move< ast::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)); + break; + + case symbol_kind::S_expr_anglestoforward: // expr_anglestoforward + value.move< ast::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)); + break; + + case symbol_kind::S_expr_anglestoup: // expr_anglestoup + value.move< ast::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)); + break; + + case symbol_kind::S_expr_animation: // expr_animation + value.move< ast::expr_animation::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)); + break; + + case symbol_kind::S_expr_array: // expr_array + value.move< ast::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)); + break; + + case symbol_kind::S_expr_complement: // expr_complement + value.move< ast::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)); + break; + + case symbol_kind::S_expr_false: // expr_false + value.move< ast::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)); + break; + + case symbol_kind::S_expr_float: // expr_float + value.move< ast::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)); + break; + + case symbol_kind::S_expr_getdvar: // expr_getdvar + value.move< ast::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)); + break; + + case symbol_kind::S_expr_getdvarcolorblue: // expr_getdvarcolorblue + value.move< ast::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)); + break; + + case symbol_kind::S_expr_getdvarcolorred: // expr_getdvarcolorred + value.move< ast::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)); + break; + + case symbol_kind::S_expr_getdvarint: // expr_getdvarint + value.move< ast::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)); + break; + + case symbol_kind::S_expr_getfirstarraykey: // expr_getfirstarraykey + value.move< ast::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)); + break; + + case symbol_kind::S_expr_gettime: // expr_gettime + value.move< ast::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)); + break; + + case symbol_kind::S_expr_identifier: // expr_identifier + value.move< ast::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)); + break; + + case symbol_kind::S_expr_isdefined: // expr_isdefined + value.move< ast::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)); + break; + + case symbol_kind::S_expr_level: // expr_level + value.move< ast::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)); + break; + + case symbol_kind::S_expr_not: // expr_not + value.move< ast::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)); + break; + + case symbol_kind::S_expr_paren: // expr_paren + value.move< ast::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)); + break; + + case symbol_kind::S_expr_reference: // expr_reference + value.move< ast::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)); + break; + + case symbol_kind::S_expr_size: // expr_size + value.move< ast::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)); + break; + + case symbol_kind::S_expr_true: // expr_true + value.move< ast::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)); + break; + + case symbol_kind::S_expr_vector: // expr_vector + value.move< ast::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)); + break; + + case symbol_kind::S_expr_vectortoangles: // expr_vectortoangles + value.move< ast::expr_vectortoangles::ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_include: // include + value.move< ast::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_breakpoint: // stmt_breakpoint + value.move< ast::stmt_breakpoint::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_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)); + break; + + case symbol_kind::S_FIELD: // "field" + 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 (s.value)); + break; + + default: + break; + } + + location = YY_MOVE (s.location); + } + + // by_kind. + inline + parser::by_kind::by_kind () + : kind_ (symbol_kind::S_YYEMPTY) + {} + +#if 201103L <= YY_CPLUSPLUS + inline + parser::by_kind::by_kind (by_kind&& that) + : kind_ (that.kind_) + { + that.clear (); + } +#endif + + inline + parser::by_kind::by_kind (const by_kind& that) + : kind_ (that.kind_) + {} + + inline + parser::by_kind::by_kind (token_kind_type t) + : kind_ (yytranslate_ (t)) + {} + + inline + void + parser::by_kind::clear () YY_NOEXCEPT + { + kind_ = symbol_kind::S_YYEMPTY; + } + + inline + void + parser::by_kind::move (by_kind& that) + { + kind_ = that.kind_; + that.clear (); + } + + inline + parser::symbol_kind_type + parser::by_kind::kind () const YY_NOEXCEPT + { + return kind_; + } + + inline + parser::symbol_kind_type + parser::by_kind::type_get () const YY_NOEXCEPT + { + return this->kind (); + } + +#line 13 "parser.ypp" +} } } // xsk::arc::t6 +#line 6273 "parser.hpp" + + + + +#endif // !YY_T6_PARSER_HPP_INCLUDED diff --git a/src/t6/xsk/resolver.cpp b/src/t6/xsk/resolver.cpp new file mode 100644 index 00000000..de0621de --- /dev/null +++ b/src/t6/xsk/resolver.cpp @@ -0,0 +1,3577 @@ +// Copyright 2022 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 "stdafx.hpp" +#include "t6.hpp" + +namespace xsk::arc::t6 +{ + +std::unordered_map opcode_map; +std::unordered_map opcode_map_rev; +std::unordered_map dvar_map; + +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 gsc::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 gsc::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; +} + +std::function(const std::string&)> read_callback = nullptr; +std::unordered_map> files; + +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 + "'"); +} + +void resolver::set_reader(std::function(const std::string&)> callback) +{ + read_callback = callback; +} + +const std::array, 126> opcode_list +{{ + { std::uint8_t(opcode::OP_End),"END" }, + { std::uint8_t(opcode::OP_Return),"RETN" }, + { std::uint8_t(opcode::OP_GetUndefined),"GET_UNDEFINED" }, + { std::uint8_t(opcode::OP_GetZero),"GET_ZERO" }, + { std::uint8_t(opcode::OP_GetByte),"GET_BYTE" }, + { std::uint8_t(opcode::OP_GetNegByte),"GET_NBYTE" }, + { std::uint8_t(opcode::OP_GetUnsignedShort),"GET_USHORT" }, + { std::uint8_t(opcode::OP_GetNegUnsignedShort),"GET_NUSHORT" }, + { std::uint8_t(opcode::OP_GetInteger),"GET_INT" }, + { std::uint8_t(opcode::OP_GetFloat),"GET_FLOAT" }, + { std::uint8_t(opcode::OP_GetString),"GET_STRING" }, + { std::uint8_t(opcode::OP_GetIString),"GET_ISTRING" }, + { std::uint8_t(opcode::OP_GetVector),"GET_VECTOR" }, + { std::uint8_t(opcode::OP_GetLevelObject),"GET_LEVEL_OBJ" }, + { std::uint8_t(opcode::OP_GetAnimObject),"GET_ANIM_OBJ" }, + { std::uint8_t(opcode::OP_GetSelf),"GET_SELF" }, + { std::uint8_t(opcode::OP_GetLevel),"GET_LEVEL" }, + { std::uint8_t(opcode::OP_GetGame),"GET_GAME" }, + { std::uint8_t(opcode::OP_GetAnim),"GET_ANIM" }, + { std::uint8_t(opcode::OP_GetAnimation),"GET_ANIMATION" }, + { std::uint8_t(opcode::OP_GetGameRef),"GET_GAME_REF" }, + { std::uint8_t(opcode::OP_GetFunction),"GET_FUNCTION" }, + { std::uint8_t(opcode::OP_CreateLocalVariable),"CREATE_LOCAL_VARIABLE" }, + { std::uint8_t(opcode::OP_SafeCreateLocalVariables),"SAFE_CREATE_LOCAL_VARIABLES" }, + { std::uint8_t(opcode::OP_RemoveLocalVariables),"REMOVE_LOCAL_VARIABLES" }, + { std::uint8_t(opcode::OP_EvalLocalVariableCached),"EVAL_LOCAL_VARIABLE_CACHED" }, + { std::uint8_t(opcode::OP_EvalArray),"EVAL_ARRAY" }, + { std::uint8_t(opcode::OP_EvalLocalArrayRefCached),"EVAL_LOCAL_ARRAY_REF_CACHED" }, + { std::uint8_t(opcode::OP_EvalArrayRef),"EVAL_ARRAY_REF" }, + { std::uint8_t(opcode::OP_ClearArray),"CLEAR_ARRAY" }, + { std::uint8_t(opcode::OP_EmptyArray),"EMPTY_ARRAY" }, + { std::uint8_t(opcode::OP_GetSelfObject),"GET_SELF_OBJECT" }, + { std::uint8_t(opcode::OP_EvalFieldVariable),"EVAL_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalFieldVariableRef),"EVAL_FIELD_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_ClearFieldVariable),"CLEAR_FIELD_VARIABLE" }, + { std::uint8_t(opcode::OP_SafeSetVariableFieldCached),"SAFE_SET_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_SafeSetWaittillVariableFieldCached),"SAFE_SET_WAITTILL_VARIABLE_FIELD_CACHED" }, + { std::uint8_t(opcode::OP_ClearParams),"CLEAR_PARAMS" }, + { std::uint8_t(opcode::OP_CheckClearParams),"CHECK_CLEAR_PARAMS" }, + { std::uint8_t(opcode::OP_EvalLocalVariableRefCached),"EVAL_LOCAL_VARIABLE_REF_CACHED" }, + { std::uint8_t(opcode::OP_SetVariableField),"SET_VARIABLE_FIELD" }, + { std::uint8_t(opcode::OP_CallBuiltin),"CALL_BUILTIN_FUNC" }, + { std::uint8_t(opcode::OP_CallBuiltinMethod),"CALL_BUILTIN_METHOD" }, + { std::uint8_t(opcode::OP_Wait),"WAIT" }, + { std::uint8_t(opcode::OP_WaitTillFrameEnd),"WAITTILLFRAMEEND" }, + { std::uint8_t(opcode::OP_PreScriptCall),"PRE_CALL" }, + { std::uint8_t(opcode::OP_ScriptFunctionCall),"SCRIPT_FUNC_CALL" }, + { std::uint8_t(opcode::OP_ScriptFunctionCallPointer),"SCRIPT_FUNC_CALL_POINTER" }, + { std::uint8_t(opcode::OP_ScriptMethodCall),"SCRIPT_METHOD_CALL" }, + { std::uint8_t(opcode::OP_ScriptMethodCallPointer),"SCRIPT_METHOD_CALL_POINTER" }, + { std::uint8_t(opcode::OP_ScriptThreadCall),"SCRIPT_THREAD_CALL" }, + { std::uint8_t(opcode::OP_ScriptThreadCallPointer),"SCRIPT_THREAD_CALL_POINTER" }, + { std::uint8_t(opcode::OP_ScriptMethodThreadCall),"SCRIPT_METHOD_THREAD_CALL" }, + { std::uint8_t(opcode::OP_ScriptMethodThreadCallPointer),"SCRIPT_METHOD_THREAD_CALL_POINTER" }, + { std::uint8_t(opcode::OP_DecTop),"DEC_TOP" }, + { std::uint8_t(opcode::OP_CastFieldObject),"CAST_FIELD_OBJECT" }, + { std::uint8_t(opcode::OP_CastBool),"CAST_BOOL" }, + { std::uint8_t(opcode::OP_BoolNot),"BOOL_NOT" }, + { std::uint8_t(opcode::OP_BoolComplement),"BOOL_COMPLEMENT" }, + { std::uint8_t(opcode::OP_JumpOnFalse),"JMP_FALSE" }, + { std::uint8_t(opcode::OP_JumpOnTrue),"JMP_TRUE" }, + { std::uint8_t(opcode::OP_JumpOnFalseExpr),"JMP_EXPR_FALSE" }, + { std::uint8_t(opcode::OP_JumpOnTrueExpr),"JMP_EXPR_TRUE" }, + { std::uint8_t(opcode::OP_Jump),"JMP" }, + { std::uint8_t(opcode::OP_JumpBack),"JMP_BACK" }, + { std::uint8_t(opcode::OP_Inc),"INC" }, + { std::uint8_t(opcode::OP_Dec),"DEC" }, + { std::uint8_t(opcode::OP_Bit_Or),"BIT_OR" }, + { std::uint8_t(opcode::OP_Bit_Xor),"BIT_XOR" }, + { std::uint8_t(opcode::OP_Bit_And),"BIT_AND" }, + { std::uint8_t(opcode::OP_Equal),"EQUAL" }, + { std::uint8_t(opcode::OP_NotEqual),"NOT_EQUAL" }, + { std::uint8_t(opcode::OP_LessThan),"LESS" }, + { std::uint8_t(opcode::OP_GreaterThan),"GREATER" }, + { std::uint8_t(opcode::OP_LessThanOrEqualTo),"LESS_EQUAL" }, + { std::uint8_t(opcode::OP_GreaterThanOrEqualTo),"GREATER_EQUAL" }, + { std::uint8_t(opcode::OP_ShiftLeft),"SHIFT_LEFT" }, + { std::uint8_t(opcode::OP_ShiftRight),"SHIFT_RIGHT" }, + { std::uint8_t(opcode::OP_Plus),"PLUS" }, + { std::uint8_t(opcode::OP_Minus),"MINUS" }, + { std::uint8_t(opcode::OP_Multiply),"MULT" }, + { std::uint8_t(opcode::OP_Divide),"DIV" }, + { std::uint8_t(opcode::OP_Modulus),"MOD" }, + { std::uint8_t(opcode::OP_SizeOf),"SIZE" }, + { std::uint8_t(opcode::OP_WaitTillMatch),"WAITTILLMATCH" }, + { std::uint8_t(opcode::OP_WaitTill),"WAITTILL" }, + { std::uint8_t(opcode::OP_Notify),"NOTIFY" }, + { std::uint8_t(opcode::OP_EndOn),"ENDON" }, + { std::uint8_t(opcode::OP_VoidCodePos),"VOIDCODEPOS" }, + { std::uint8_t(opcode::OP_Switch),"SWITCH" }, + { std::uint8_t(opcode::OP_EndSwitch),"ENDSWITCH" }, + { std::uint8_t(opcode::OP_Vector),"VECTOR" }, + { std::uint8_t(opcode::OP_GetHash),"GET_HASH" }, + { std::uint8_t(opcode::OP_RealWait),"REAL_WAIT" }, + { std::uint8_t(opcode::OP_VectorConstant),"VECTOR_CONSTANT" }, + { std::uint8_t(opcode::OP_IsDefined),"IS_DEFINED" }, + { std::uint8_t(opcode::OP_VectorScale),"VECTOR_SCALE" }, + { std::uint8_t(opcode::OP_AnglesToUp),"ANGLES_TO_UP" }, + { std::uint8_t(opcode::OP_AnglesToRight),"ANGLES_TO_RIGHT" }, + { std::uint8_t(opcode::OP_AnglesToForward),"ANGLES_TO_FORDWARD" }, + { std::uint8_t(opcode::OP_AngleClamp180),"ANGLE_CLAMP_180" }, + { std::uint8_t(opcode::OP_VectorToAngles),"VECTOR_TO_ANGLES" }, + { std::uint8_t(opcode::OP_Abs),"ABS" }, + { std::uint8_t(opcode::OP_GetTime),"GET_TIME" }, + { std::uint8_t(opcode::OP_GetDvar),"GET_DVAR" }, + { std::uint8_t(opcode::OP_GetDvarInt),"GET_DVAR_INT" }, + { std::uint8_t(opcode::OP_GetDvarFloat),"GET_DVAR_FLOAT" }, + { std::uint8_t(opcode::OP_GetDvarVector),"GET_DVAR_VECTOR" }, + { std::uint8_t(opcode::OP_GetDvarColorRed),"GET_DVAR_COLOR_RED" }, + { std::uint8_t(opcode::OP_GetDvarColorGreen),"GET_DVAR_COLOR_GREEN" }, + { std::uint8_t(opcode::OP_GetDvarColorBlue),"GET_DVAR_COLOR_BLUE" }, + { std::uint8_t(opcode::OP_GetDvarColorAlpha),"GET_DVAR_COLOR_ALPHA" }, + { std::uint8_t(opcode::OP_FirstArrayKey),"FIRST_ARRAY_KEY" }, + { std::uint8_t(opcode::OP_NextArrayKey),"NEXT_ARRAY_KEY" }, + { std::uint8_t(opcode::OP_ProfileStart),"PROFILE_START" }, + { std::uint8_t(opcode::OP_ProfileStop),"PROFILE_STOP" }, + { std::uint8_t(opcode::OP_SafeDecTop),"SAFE_DEC_TOP" }, + { std::uint8_t(opcode::OP_Nop),"NOP" }, + { std::uint8_t(opcode::OP_Abort),"ABORT" }, + { std::uint8_t(opcode::OP_Object),"OBJECT" }, + { std::uint8_t(opcode::OP_ThreadObject),"THREAD_OBJECT" }, + { std::uint8_t(opcode::OP_EvalLocalVariable),"EVAL_LOCAL_VARIABLE" }, + { std::uint8_t(opcode::OP_EvalLocalVariableRef),"EVAL_LOCAL_VARIABLE_REF" }, + { std::uint8_t(opcode::OP_DevblockBegin),"DEVBLOCK_BEGIN" }, + { std::uint8_t(opcode::OP_DevblockEnd),"DEVBLOCK_END" }, + { std::uint8_t(opcode::OP_Breakpoint),"BREAKPOINT" }, +}}; + +const std::array, 3318> 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" }, + { 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" }, + { 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" }, + { 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" }, + { 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" }, + { 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 diff --git a/src/t6/xsk/resolver.hpp b/src/t6/xsk/resolver.hpp new file mode 100644 index 00000000..117b864b --- /dev/null +++ b/src/t6/xsk/resolver.hpp @@ -0,0 +1,23 @@ +// Copyright 2022 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 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 void set_reader(std::function(const std::string&)> callback); +}; + +} // namespace xsk::arc::t6 diff --git a/src/t6/xsk/t6.cpp b/src/t6/xsk/t6.cpp new file mode 100644 index 00000000..9ff8d9b5 --- /dev/null +++ b/src/t6/xsk/t6.cpp @@ -0,0 +1,153 @@ +// Copyright 2022 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 "stdafx.hpp" +#include "t6.hpp" + +namespace xsk::arc::t6 +{ + +auto opcode_size(std::uint8_t id) -> std::uint32_t +{ + switch (opcode(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_RemoveLocalVariables: + case opcode::OP_EvalArray: + case opcode::OP_EvalLocalArrayRefCached: + 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: + case opcode::OP_Breakpoint: + return 1; + case opcode::OP_GetByte: + case opcode::OP_GetNegByte: + case opcode::OP_SafeCreateLocalVariables: + case opcode::OP_EvalLocalVariableCached: + 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 std::runtime_error("Couldn't resolve instruction size for " + std::to_string(id)); + } +} + +} // namespace xsk::arc::t6 diff --git a/src/t6/xsk/t6.hpp b/src/t6/xsk/t6.hpp new file mode 100644 index 00000000..8285861c --- /dev/null +++ b/src/t6/xsk/t6.hpp @@ -0,0 +1,154 @@ +// Copyright 2022 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 "utils/xsk/utils.hpp" + +#include "assembler.hpp" +#include "disassembler.hpp" +#include "decompiler.hpp" +#include "compiler.hpp" +#include "resolver.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_Breakpoint = 0x7D, + OP_Count = 0x7E, +}; + +auto opcode_size(std::uint8_t id) -> std::uint32_t; + +} // namespace xsk::arc::t6 diff --git a/src/utils/xsk/arc/block.hpp b/src/utils/xsk/arc/block.hpp new file mode 100644 index 00000000..6127554e --- /dev/null +++ b/src/utils/xsk/arc/block.hpp @@ -0,0 +1,24 @@ +// Copyright 2022 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() : is_dev(false), abort(abort_t::abort_none) {} +}; + +} // namespace xsk::arc diff --git a/src/utils/xsk/arc/interfaces/assembler.hpp b/src/utils/xsk/arc/interfaces/assembler.hpp new file mode 100644 index 00000000..f4dabf31 --- /dev/null +++ b/src/utils/xsk/arc/interfaces/assembler.hpp @@ -0,0 +1,22 @@ +// Copyright 2022 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/src/utils/xsk/arc/interfaces/compiler.hpp b/src/utils/xsk/arc/interfaces/compiler.hpp new file mode 100644 index 00000000..29f90ade --- /dev/null +++ b/src/utils/xsk/arc/interfaces/compiler.hpp @@ -0,0 +1,23 @@ +// Copyright 2022 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_data() -> std::vector = 0; + virtual void compile(const std::string& file, std::vector& data) = 0; + virtual void read_callback(std::function(const std::string&)> func) = 0; +}; + +} // namespace xsk::arc diff --git a/src/utils/xsk/arc/interfaces/decompiler.hpp b/src/utils/xsk/arc/interfaces/decompiler.hpp new file mode 100644 index 00000000..c616b62f --- /dev/null +++ b/src/utils/xsk/arc/interfaces/decompiler.hpp @@ -0,0 +1,21 @@ +// Copyright 2022 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/src/utils/xsk/arc/interfaces/disassembler.hpp b/src/utils/xsk/arc/interfaces/disassembler.hpp new file mode 100644 index 00000000..2b46473d --- /dev/null +++ b/src/utils/xsk/arc/interfaces/disassembler.hpp @@ -0,0 +1,22 @@ +// Copyright 2022 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_data() -> std::vector = 0; + virtual void disassemble(const std::string& file, std::vector& data) = 0; +}; + +} // namespace xsk::arc diff --git a/src/utils/xsk/arc/interfaces/exception.hpp b/src/utils/xsk/arc/interfaces/exception.hpp new file mode 100644 index 00000000..75e67e83 --- /dev/null +++ b/src/utils/xsk/arc/interfaces/exception.hpp @@ -0,0 +1,46 @@ +// Copyright 2022 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/src/utils/xsk/arc/location.hpp b/src/utils/xsk/arc/location.hpp new file mode 100644 index 00000000..1a65b816 --- /dev/null +++ b/src/utils/xsk/arc/location.hpp @@ -0,0 +1,229 @@ +// Copyright 2022 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 utils::string::va("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/src/utils/xsk/arc/nodetree.cpp b/src/utils/xsk/arc/nodetree.cpp new file mode 100644 index 00000000..815247b3 --- /dev/null +++ b/src/utils/xsk/arc/nodetree.cpp @@ -0,0 +1,1917 @@ +// Copyright 2022 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 "stdafx.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_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_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_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_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_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_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_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), stmt(std::move(stmt)), use_key(use_key), array_expr(nullptr), value_expr(nullptr), key_expr(nullptr), array(nullptr), pre_expr(nullptr), cond_expr(nullptr), post_expr(nullptr), stmt0(nullptr), ctx(nullptr), ctx_post(nullptr) {} +stmt_foreach::stmt_foreach(ast::expr element, ast::expr container, ast::stmt stmt) : node(kind::stmt_foreach), value_expr(std::move(element)), array_expr(std::move(container)), stmt(std::move(stmt)), use_key(false), key_expr(nullptr), array(nullptr), pre_expr(nullptr), cond_expr(nullptr), post_expr(nullptr), stmt0(nullptr), ctx(nullptr), ctx_post(nullptr) {} +stmt_foreach::stmt_foreach(ast::expr key, ast::expr element, ast::expr container, ast::stmt stmt) : node(kind::stmt_foreach), key_expr(std::move(key)), value_expr(std::move(element)), array_expr(std::move(container)), stmt(std::move(stmt)), use_key(true), array(nullptr), pre_expr(nullptr), cond_expr(nullptr), post_expr(nullptr), stmt0(nullptr), ctx(nullptr), ctx_post(nullptr) {} +stmt_foreach::stmt_foreach(const location& loc, ast::expr element, ast::expr container, ast::stmt stmt) : node(kind::stmt_foreach, loc), value_expr(std::move(element)), array_expr(std::move(container)), stmt(std::move(stmt)), use_key(false), key_expr(nullptr), array(nullptr), pre_expr(nullptr), cond_expr(nullptr), post_expr(nullptr), stmt0(nullptr), ctx(nullptr), ctx_post(nullptr) {} +stmt_foreach::stmt_foreach(const location& loc, ast::expr key, ast::expr element, ast::expr container, ast::stmt stmt) : node(kind::stmt_foreach, loc), key_expr(std::move(key)), value_expr(std::move(element)), array_expr(std::move(container)), stmt(std::move(stmt)), use_key(true), array(nullptr), pre_expr(nullptr), cond_expr(nullptr), post_expr(nullptr), stmt0(nullptr), ctx(nullptr), ctx_post(nullptr) {} + +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) : node(kind::decl_thread), name(std::move(name)), params(std::move(params)), stmt(std::move(stmt)) {} +decl_thread::decl_thread(const location& loc, expr_identifier::ptr name, expr_parameters::ptr params, stmt_list::ptr stmt) : node(kind::decl_thread, loc), name(std::move(name)), params(std::move(params)), stmt(std::move(stmt)) {} + +decl_constant::decl_constant(expr_identifier::ptr name, expr value) : node(kind::decl_constant), name(std::move(name)), value(std::move(value)) {} +decl_constant::decl_constant(const location& loc, expr_identifier::ptr name, expr value) : node(kind::decl_constant, loc), name(std::move(name)), value(std::move(value)) {} + +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 value; +} + +auto expr_istring::print() const -> std::string +{ + return "&"s += value; +} + +auto expr_path::print() const -> std::string +{ + return utils::string::backslash(value); +} + +auto expr_identifier::print() const -> std::string +{ + return value; +} + +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_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; + 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) + data += "\n"; + + if (stmt == kind::stmt_dev) + data += stmt.print(); + else + data += stmts_pad + stmt.print(); + + 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"; + + if (stmt == kind::stmt_dev) + data += stmt.print(); + else + 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_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 +{ + return name->print() + "(" + params->print() + ")" + "\n" + stmt->print() + "\n"; +} + +auto decl_constant::print() const -> std::string +{ + return name->print() + " = "s + value.print() + ";\n"; +} + +auto decl_usingtree::print() const -> std::string +{ + return "#using_animtree"s + "(" + name->print() + ");\n"; +} + +auto decl_dev_begin::print() const -> std::string +{ + return "/#"; +} + +auto decl_dev_end::print() const -> std::string +{ + return "#/"; +} + +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(); + } + + for (const auto& entry : declarations) + { + if (entry == kind::decl_thread) + { + data += "\n"; + } + + data += entry.print(); + } + + 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_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_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_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_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_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_constant: as_constant.~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/utils/xsk/arc/nodetree.hpp b/src/utils/xsk/arc/nodetree.hpp new file mode 100644 index 00000000..f3c7ac1e --- /dev/null +++ b/src/utils/xsk/arc/nodetree.hpp @@ -0,0 +1,1924 @@ +// Copyright 2022 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_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_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_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_constant, + 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_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_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_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_constant; +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_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_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_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_constant; + 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_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_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_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; + + decl_thread(expr_identifier::ptr name, expr_parameters::ptr params, stmt_list::ptr stmt); + decl_thread(const location& loc, expr_identifier::ptr name, expr_parameters::ptr params, stmt_list::ptr stmt); + auto print() const -> std::string override; +}; + +struct decl_constant : public node +{ + using ptr = std::unique_ptr; + + expr_identifier::ptr name; + expr value; + + decl_constant(expr_identifier::ptr name, expr value); + decl_constant(const location& loc, expr_identifier::ptr name, expr value); + 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; + + std::string value; + ast::expr expr; + + 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/src/utils/xsk/arc/types.hpp b/src/utils/xsk/arc/types.hpp new file mode 100644 index 00000000..d9b736d1 --- /dev/null +++ b/src/utils/xsk/arc/types.hpp @@ -0,0 +1,179 @@ +// Copyright 2022 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 build +{ + dev, + prod, +}; + +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 +{ + none = 0x00, + vis_public = 0x01, + vis_autoexec = 0x02, + vis_private = 0x04, + unk1 = 0x08, // never seen + unk2 = 0x10, // inside dev /##/ ? + varargs_may = 0x20, // T7, T8, T9 +}; + +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/src/utils/xsk/gsc/nodetree.cpp b/src/utils/xsk/gsc/nodetree.cpp index 378aa4e3..a748bd5c 100644 --- a/src/utils/xsk/gsc/nodetree.cpp +++ b/src/utils/xsk/gsc/nodetree.cpp @@ -131,7 +131,7 @@ auto node::precedence() -> std::uint8_t 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_mul: return 10; case kind::expr_div: return 10; case kind::expr_mod: return 10; default: return 0; diff --git a/src/utils/xsk/utils.hpp b/src/utils/xsk/utils.hpp index d6e6324c..17edd946 100644 --- a/src/utils/xsk/utils.hpp +++ b/src/utils/xsk/utils.hpp @@ -24,3 +24,16 @@ #include "gsc/interfaces/disassembler.hpp" #include "gsc/interfaces/compiler.hpp" #include "gsc/interfaces/decompiler.hpp" + +// ARC Types +#include "arc/location.hpp" +#include "arc/types.hpp" +#include "arc/block.hpp" +#include "arc/nodetree.hpp" + +// ARC Interfaces +#include "arc/interfaces/exception.hpp" +#include "arc/interfaces/assembler.hpp" +#include "arc/interfaces/disassembler.hpp" +#include "arc/interfaces/compiler.hpp" +#include "arc/interfaces/decompiler.hpp"